aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-29 16:02:45 +0200
committerlain <lain@soykaf.club>2020-05-29 16:02:45 +0200
commit767ce8b8030562935ccd9f7c3d9ed83af0735db0 (patch)
treea8bd8b5b1f4ac53cf21222dc8b6e9eeb25c34106 /lib
parent863c02b25d1c6128fab88c33d2c4c3565a6c378f (diff)
downloadpleroma-767ce8b8030562935ccd9f7c3d9ed83af0735db0.tar.gz
StreamerView: Actually send Chats, not ChatMessages.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/pleroma_api/views/chat_view.ex2
-rw-r--r--lib/pleroma/web/views/streamer_view.ex4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/pleroma_api/views/chat_view.ex b/lib/pleroma/web/pleroma_api/views/chat_view.ex
index 08d5110c3..223b64987 100644
--- a/lib/pleroma/web/pleroma_api/views/chat_view.ex
+++ b/lib/pleroma/web/pleroma_api/views/chat_view.ex
@@ -14,7 +14,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatView do
def render("show.json", %{chat: %Chat{} = chat} = opts) do
recipient = User.get_cached_by_ap_id(chat.recipient)
- last_message = Chat.last_message_for_chat(chat)
+ last_message = opts[:message] || Chat.last_message_for_chat(chat)
%{
id: chat.id |> to_string(),
diff --git a/lib/pleroma/web/views/streamer_view.ex b/lib/pleroma/web/views/streamer_view.ex
index 949e2ed37..5e953d770 100644
--- a/lib/pleroma/web/views/streamer_view.ex
+++ b/lib/pleroma/web/views/streamer_view.ex
@@ -16,9 +16,9 @@ defmodule Pleroma.Web.StreamerView do
chat = Chat.get(user.id, hd(recipients -- [user.ap_id]))
representation =
- Pleroma.Web.PleromaAPI.ChatMessageView.render(
+ Pleroma.Web.PleromaAPI.ChatView.render(
"show.json",
- %{object: object, chat: chat}
+ %{message: object, chat: chat}
)
%{