diff options
author | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-06-11 07:04:31 +0200 |
---|---|---|
committer | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-06-11 07:04:31 +0200 |
commit | b031cab1ea9a30a11e648b981cfbb909e5993c21 (patch) | |
tree | 3add81541413c91d46f9227d915b553fb82f2b00 | |
parent | fix error responses (diff) |
improve client bindings
-rw-r--r-- | lib/matrix_app_service/client.ex | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/matrix_app_service/client.ex b/lib/matrix_app_service/client.ex index 519f5a2..f166b88 100644 --- a/lib/matrix_app_service/client.ex +++ b/lib/matrix_app_service/client.ex @@ -11,4 +11,20 @@ defmodule MatrixAppService.Client do storage: storage } end + + def create_room(options) do + client_with_options(options) + |> Polyjuice.Client.Room.create_room(options) + end + + def create_alias(room_id, room_alias, options \\ []) do + client_with_options(options) + |> Polyjuice.Client.Room.create_alias(room_id, room_alias) + end + + defp client_with_options(options) do + user_id = Keyword.get(options, :user_id, nil) + storage = Keyword.get(options, :storage, nil) + client(user_id, storage) + end end |