- recipient: chat.recipient,
- recipient_account: AccountView.render("show.json", Map.put(opts, :user, recipient)),
- unread: chat.unread
+ account: AccountView.render("show.json", Map.put(opts, :user, recipient)),
+ unread: MessageReference.unread_count_for_chat(chat),
+ last_message:
+ last_message &&
+ MessageReferenceView.render("show.json", chat_message_reference: last_message),
+ updated_at: Utils.to_masto_date(chat.updated_at)