alias Pleroma.Chat
alias Pleroma.User
+ alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.Web.PleromaAPI.ChatMessageView
account: AccountView.render("show.json", Map.put(opts, :user, recipient)),
unread: chat.unread,
last_message:
- last_message && ChatMessageView.render("show.json", chat: chat, object: last_message)
+ last_message && ChatMessageView.render("show.json", chat: chat, object: last_message),
+ updated_at: Utils.to_masto_date(chat.updated_at)
}
end
alias Pleroma.Chat
alias Pleroma.Object
alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.Web.PleromaAPI.ChatMessageView
alias Pleroma.Web.PleromaAPI.ChatView
id: "#{chat.id}",
account: AccountView.render("show.json", user: recipient),
unread: 0,
- last_message: nil
+ last_message: nil,
+ updated_at: Utils.to_masto_date(chat.updated_at)
}
{:ok, chat_message_creation} = CommonAPI.post_chat_message(user, recipient, "hello")