ChatMessageReferenceView: Return read status as `unread`.

This commit is contained in:
lain 2020-06-03 18:58:58 +02:00
parent fb4ae9c720
commit c020fd4352
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ def render(
attachment:
chat_message["attachment"] &&
StatusView.render("attachment.json", attachment: chat_message["attachment"]),
seen: seen
unread: !seen
}
end

View File

@ -40,7 +40,7 @@ test "it displays a chat message" do
assert chat_message[:account_id] == user.id
assert chat_message[:chat_id]
assert chat_message[:created_at]
assert chat_message[:seen] == true
assert chat_message[:unread] == false
assert match?([%{shortcode: "firefox"}], chat_message[:emojis])
{:ok, activity} = CommonAPI.post_chat_message(recipient, user, "gkgkgk", media_id: upload.id)
@ -57,6 +57,6 @@ test "it displays a chat message" do
assert chat_message_two[:account_id] == recipient.id
assert chat_message_two[:chat_id] == chat_message[:chat_id]
assert chat_message_two[:attachment]
assert chat_message_two[:seen] == false
assert chat_message_two[:unread] == true
end
end