diff options
author | lain <lain@soykaf.club> | 2020-06-03 12:30:12 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-06-03 12:30:12 +0200 |
commit | aa22fce8f46cf2e7f871b3584fbfff7ac2ebe4c2 (patch) | |
tree | 861f95fdb3b8d01ad699db9ffc987678a3a41839 /lib/pleroma/chat.ex | |
parent | 2c6ebe709a9fb84bedb5d50c24715fd4532272f9 (diff) | |
download | pleroma-aa22fce8f46cf2e7f871b3584fbfff7ac2ebe4c2.tar.gz |
ChatMessageReference: Introduce and switch in chat controller.
Diffstat (limited to 'lib/pleroma/chat.ex')
-rw-r--r-- | lib/pleroma/chat.ex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/chat.ex b/lib/pleroma/chat.ex index 4c92a58c7..211b872f9 100644 --- a/lib/pleroma/chat.ex +++ b/lib/pleroma/chat.ex @@ -72,6 +72,11 @@ defmodule Pleroma.Chat do |> unique_constraint(:user_id, name: :chats_user_id_recipient_index) end + def get_by_id(id) do + __MODULE__ + |> Repo.get(id) + end + def get(user_id, recipient) do __MODULE__ |> Repo.get_by(user_id: user_id, recipient: recipient) |