summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/matrix_app_service/application.ex6
-rw-r--r--lib/matrix_app_service/bridge.ex4
-rw-r--r--lib/matrix_app_service/bridge/room.ex4
-rw-r--r--lib/matrix_app_service/bridge/user.ex4
-rw-r--r--lib/matrix_app_service/migrations.ex6
-rw-r--r--lib/matrix_app_service_web/auth_plug.ex6
-rw-r--r--lib/matrix_app_service_web/set_config_plug.ex1
7 files changed, 26 insertions, 5 deletions
diff --git a/lib/matrix_app_service/application.ex b/lib/matrix_app_service/application.ex
index 408d5ab..df9acab 100644
--- a/lib/matrix_app_service/application.ex
+++ b/lib/matrix_app_service/application.ex
@@ -49,15 +49,15 @@ defmodule MatrixAppService.Application do
:ok
end
- def start_endpoint?() do
+ def start_endpoint? do
Application.get_env(:matrix_app_service, :internal_supervisor, false)
end
- def start_repo?() do
+ def start_repo? do
Application.get_env(:matrix_app_service, :internal_repo, false)
end
- def endpoint_config() do
+ def endpoint_config do
[
transaction_adapter: Application.fetch_env!(:matrix_app_service, :transaction_adapter),
room_adapter: Application.fetch_env!(:matrix_app_service, :room_adapter),
diff --git a/lib/matrix_app_service/bridge.ex b/lib/matrix_app_service/bridge.ex
index e0e0fee..42f3450 100644
--- a/lib/matrix_app_service/bridge.ex
+++ b/lib/matrix_app_service/bridge.ex
@@ -1,3 +1,7 @@
defmodule MatrixAppService.Bridge do
+ @moduledoc """
+ This module is used when the library uses its own repo.
+ """
+
use MatrixAppService.BridgeConfig, repo: MatrixAppService.Repo
end
diff --git a/lib/matrix_app_service/bridge/room.ex b/lib/matrix_app_service/bridge/room.ex
index 73ef1ea..e8613a1 100644
--- a/lib/matrix_app_service/bridge/room.ex
+++ b/lib/matrix_app_service/bridge/room.ex
@@ -1,4 +1,8 @@
defmodule MatrixAppService.Bridge.Room do
+ @moduledoc """
+ Schema and helpers for keeping track of room correspondence.
+ """
+
use Ecto.Schema
import Ecto.Changeset
diff --git a/lib/matrix_app_service/bridge/user.ex b/lib/matrix_app_service/bridge/user.ex
index 7bf604a..93cafbf 100644
--- a/lib/matrix_app_service/bridge/user.ex
+++ b/lib/matrix_app_service/bridge/user.ex
@@ -1,4 +1,8 @@
defmodule MatrixAppService.Bridge.User do
+ @moduledoc """
+ Schema and helpers for keeping track of user correspondence.
+ """
+
use Ecto.Schema
import Ecto.Changeset
diff --git a/lib/matrix_app_service/migrations.ex b/lib/matrix_app_service/migrations.ex
index 6ae5344..8b3c9f1 100644
--- a/lib/matrix_app_service/migrations.ex
+++ b/lib/matrix_app_service/migrations.ex
@@ -1,4 +1,10 @@
defmodule MatrixAppService.Migrations do
+ @moduledoc """
+ Module containing migrations for tables used in bridge mode. Should be used like this:
+
+ TODO: example
+ """
+
use Ecto.Migration
def change do
diff --git a/lib/matrix_app_service_web/auth_plug.ex b/lib/matrix_app_service_web/auth_plug.ex
index be38fb0..ee431aa 100644
--- a/lib/matrix_app_service_web/auth_plug.ex
+++ b/lib/matrix_app_service_web/auth_plug.ex
@@ -17,11 +17,13 @@ defmodule MatrixAppServiceWeb.AuthPlug do
@doc false
@impl Plug
- def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token) when is_binary(homeserver_token) do
+ def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token)
+ when is_binary(homeserver_token) do
verify_access_token(conn, homeserver_token)
end
- def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token) when is_function(homeserver_token, 0) do
+ def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token)
+ when is_function(homeserver_token, 0) do
verify_access_token(conn, homeserver_token.())
end
diff --git a/lib/matrix_app_service_web/set_config_plug.ex b/lib/matrix_app_service_web/set_config_plug.ex
index 10296e2..a7fdf89 100644
--- a/lib/matrix_app_service_web/set_config_plug.ex
+++ b/lib/matrix_app_service_web/set_config_plug.ex
@@ -1,5 +1,6 @@
defmodule MatrixAppServiceWeb.SetConfigPlug do
@moduledoc """
+ This plug allows to set compile time configuration as private conn parameters.
"""
@behaviour Plug