Browse Source

StreamerView: Actually send Chats, not ChatMessages.

1570-levenshtein-distance-user-search
lain 4 years ago
parent
commit
767ce8b803
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      lib/pleroma/web/pleroma_api/views/chat_view.ex
  2. +2
    -2
      lib/pleroma/web/views/streamer_view.ex

+ 1
- 1
lib/pleroma/web/pleroma_api/views/chat_view.ex View File

@@ -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(),


+ 2
- 2
lib/pleroma/web/views/streamer_view.ex View File

@@ -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}
)

%{


Loading…
Cancel
Save