projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'recipients-experiments' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
pleroma_api
/
views
/
chat_view.ex
diff --git
a/lib/pleroma/web/pleroma_api/views/chat_view.ex
b/lib/pleroma/web/pleroma_api/views/chat_view.ex
index 91d50dd1e4e94984097cd1c9e2a705a898e9e91b..1c996da119474501a145a75e766f8cf7044a0ecf 100644
(file)
--- a/
lib/pleroma/web/pleroma_api/views/chat_view.ex
+++ b/
lib/pleroma/web/pleroma_api/views/chat_view.ex
@@
-6,24
+6,23
@@
defmodule Pleroma.Web.PleromaAPI.ChatView do
use Pleroma.Web, :view
alias Pleroma.Chat
use Pleroma.Web, :view
alias Pleroma.Chat
- alias Pleroma.ChatMessageReference
+ alias Pleroma.Chat
.
MessageReference
alias Pleroma.User
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.User
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MastodonAPI.AccountView
- alias Pleroma.Web.PleromaAPI.ChatMessageReferenceView
+ alias Pleroma.Web.PleromaAPI.Chat
.
MessageReferenceView
def render("show.json", %{chat: %Chat{} = chat} = opts) do
recipient = User.get_cached_by_ap_id(chat.recipient)
def render("show.json", %{chat: %Chat{} = chat} = opts) do
recipient = User.get_cached_by_ap_id(chat.recipient)
-
- last_message = opts[:last_message] || ChatMessageReference.last_message_for_chat(chat)
+ last_message = opts[:last_message] || MessageReference.last_message_for_chat(chat)
%{
id: chat.id |> to_string(),
account: AccountView.render("show.json", Map.put(opts, :user, recipient)),
%{
id: chat.id |> to_string(),
account: AccountView.render("show.json", Map.put(opts, :user, recipient)),
- unread: M
ap.get(chat, :unread) || ChatM
essageReference.unread_count_for_chat(chat),
+ unread: MessageReference.unread_count_for_chat(chat),
last_message:
last_message &&
last_message:
last_message &&
-
Chat
MessageReferenceView.render("show.json", chat_message_reference: last_message),
+ MessageReferenceView.render("show.json", chat_message_reference: last_message),
updated_at: Utils.to_masto_date(chat.updated_at)
}
end
updated_at: Utils.to_masto_date(chat.updated_at)
}
end