diff options
Diffstat (limited to 'lib/matrix_app_service.ex')
-rw-r--r-- | lib/matrix_app_service.ex | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/matrix_app_service.ex b/lib/matrix_app_service.ex index 49acd1b..289d276 100644 --- a/lib/matrix_app_service.ex +++ b/lib/matrix_app_service.ex @@ -21,6 +21,7 @@ defmodule MatrixAppService do In your Phoenix Router: ``` + require MatrixAppServiceWeb.Router MatrixAppServiceWeb.Router.routes() ``` @@ -33,20 +34,26 @@ defmodule MatrixAppService do For instance: ``` + @behaviour MatrixAppService.Adapter.Room + @impl MatrixAppService.Adapter.Room def query_alias(room_alias) do # Do something with the room alias # If the room exists, return :ok end + @behaviour MatrixAppService.Adapter.User + @impl MatrixAppService.Adapter.User def query_user(user_id) do # Do something with the user ID # If the user exists, return :ok end + @behaviour MatrixAppService.Adapter.Transaction + @impl MatrixAppService.Adapter.Transaction - def new_event(%MatrixAppService.Event{type: type, content: content}) + def new_event(%MatrixAppService.Event{type: type, content: content}) do # Do something with the event end ``` |