summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre de Lacroix <pierre@pdelacroix.com>2021-06-28 17:46:55 +0200
committerPierre de Lacroix <pierre@pdelacroix.com>2021-06-28 17:46:55 +0200
commita7b411da89dd7b5e1c415754dd231450d9d838d6 (patch)
tree8ea5664d8c8a6363ceb58c19ab38cbb08a314773
parentMerge branch 'add-redacts-to-event-struct' into 'master' (diff)
add delegations for Client.join/2 and Client.upload/3
-rw-r--r--lib/matrix_app_service/client.ex4
-rw-r--r--lib/matrix_app_service/client_behaviour.ex2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/matrix_app_service/client.ex b/lib/matrix_app_service/client.ex
index 2e86c7e..5853e7d 100644
--- a/lib/matrix_app_service/client.ex
+++ b/lib/matrix_app_service/client.ex
@@ -124,6 +124,8 @@ defmodule MatrixAppService.Client do
defdelegate get_data(client, id, key), to: Polyjuice.Client.Account
defdelegate get_profile(client, id), to: Polyjuice.Client.Profile
- defdelegate put_displayname(client, id, name), to: Polyjuice.Client.Profile
+ defdelegate put_displayname(client, id, displayname), to: Polyjuice.Client.Profile
+ defdelegate put_avatar_url(client, id, avatar_url), to: Polyjuice.Client.Profile
defdelegate join(client, room_id), to: Polyjuice.Client.Room
+ defdelegate upload(client, data, opts), to: Polyjuice.Client.Media
end
diff --git a/lib/matrix_app_service/client_behaviour.ex b/lib/matrix_app_service/client_behaviour.ex
index 7a1f7fe..b7e2602 100644
--- a/lib/matrix_app_service/client_behaviour.ex
+++ b/lib/matrix_app_service/client_behaviour.ex
@@ -31,5 +31,7 @@ defmodule MatrixAppService.ClientBehaviour do
@callback get_profile(Polyjuice.Client.LowLevel.t(), String.t()) :: {:ok, map()} | any
@callback get_data(Polyjuice.Client.LowLevel.t(), String.t(), String.t()) :: {:ok, map()} | any
@callback put_displayname(Polyjuice.Client.LowLevel.t(), String.t(), String.t()) :: :ok | any
+ @callback put_avatar_url(Polyjuice.Client.LowLevel.t(), String.t(), String.t()) :: :ok | any
@callback join(Polyjuice.Client.LowLevel.t(), String.t()) :: :ok | any
+ @callback upload(Polyjuice.Client.LowLevel.t(), binary, Keyword.t()) :: {:ok, String.t()} | Any
end