summaryrefslogtreecommitdiff
path: root/lib/matrix_app_service/phoenix/controllers/v1/transaction_controller.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/matrix_app_service/phoenix/controllers/v1/transaction_controller.ex')
-rw-r--r--lib/matrix_app_service/phoenix/controllers/v1/transaction_controller.ex52
1 files changed, 0 insertions, 52 deletions
diff --git a/lib/matrix_app_service/phoenix/controllers/v1/transaction_controller.ex b/lib/matrix_app_service/phoenix/controllers/v1/transaction_controller.ex
deleted file mode 100644
index ebee348..0000000
--- a/lib/matrix_app_service/phoenix/controllers/v1/transaction_controller.ex
+++ /dev/null
@@ -1,52 +0,0 @@
-defmodule MatrixAppService.Phoenix.V1.TransactionController do
- use MatrixAppService.Phoenix, :controller
-
- @module Application.compile_env!(:matrix_app_service, :module)
-
- # %{"access_token" => access_token,
- # "events" => [
- # %{"age" => 199,
- # "content" => %{
- # "body" => "test",
- # "msgtype" => "m.room.message"},
- # "event_id" => "$pMDN7TcsCapjLRYoITwryk0anpQGs60y2Eng3lxropc",
- # "origin_server_ts" => 1588950428966,
- # "room_id" => "!SrVtqmyqzuaMnfVImP:matrix.imago.local",
- # "sender" => "@alice:matrix.imago.local",
- # "type" => "m.room.message",
- # "unsigned" => %{"age" => 199},
- # "user_id" => "@alice:matrix.imago.local"}],
- # "txn_id" => "269"}
-
- defp create_event(
- %{"age" => age,
- "content" => content,
- "event_id" => event_id,
- "origin_server_ts" => origin_server_ts,
- "room_id" => room_id,
- "sender" => sender,
- "type" => type,
- "unsigned" => unsigned,
- "user_id" => user_id
- }) do
- event =
- %MatrixAppService.Event{
- age: age,
- content: content,
- event_id: event_id,
- origin_server_ts: origin_server_ts,
- room_id: room_id,
- sender: sender,
- type: type,
- unsigned: unsigned,
- user_id: user_id
- }
-
- @module.new_event(event)
- end
-
- def create(conn, %{"events" => events}) do
- Enum.each(events, &create_event(&1))
- send_resp(conn, 200, "{}")
- end
-end