odoo/odoo#159104

Created by fw-bot
Merged at 829deb043cc59f16e57a8d09882e31721b2b31f5

Statuses:

label
odoo-dev:saas-17.1-17.0-fix-chat-deleted-message-counter-aku-ZJ3c-fw
head
50b84fbe8a9926a0c409f6978ec2783a77a48abb
merged
1 year ago by Discuss, Alexandre Kühn (aku)
odoo/odoo
17.0 #158943
saas-17.1 #159104
saas-17.2 #159192
18.0
saas-18.1
saas-18.2
saas-18.3
saas-18.4
master #159362

[FW][FIX] mail: opening chat with deleted new message should mark as read

Before this commit, when a user of in chat posted a message and deleted it, all other users kept the chat as unread.

Steps to reproduce:
- Connect as Admin and March Demo
- Send a message to Admin as Demo in DM chat
- Demo deletes this message
- Marc opens the chat => the unread counter is 1 and cannot be removed

This happens because when a message is deleted, there's still a trace of it but the message is empty. However, empty messages could not be candidate of setting the last message being seing by a member, thus members were unable to mark the chat as read until someone else posted a newer message (and did not delete it).

This commit fixes the issue by taking empty messages into account for setting last message message of member, which allow to mark thread as read even when newer messages have been deleted.

opw-3764410

Forward-Port-Of: #158943