summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre de Lacroix <pierre@pdelacroix.com>2020-06-11 07:04:31 +0200
committerPierre de Lacroix <pierre@pdelacroix.com>2020-06-11 07:04:31 +0200
commitb031cab1ea9a30a11e648b981cfbb909e5993c21 (patch)
tree3add81541413c91d46f9227d915b553fb82f2b00
parentfix error responses (diff)
improve client bindings
-rw-r--r--lib/matrix_app_service/client.ex16
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