Do not manually update room last message with invisible messages.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2022-04-21 17:24:39 +02:00
Родитель 0bbbd5bfd8
Коммит 0548a9421b
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -404,7 +404,7 @@ NSString * const NCChatControllerDidReceiveCallEndedMessageNotification
NCChatMessage *lastMessage = [storedMessages lastObject];
// Make sure we update the unread flags for the room (lastMessage can already be set, but there still might be unread flags)
if (lastMessage.timestamp >= self->_room.lastActivity) {
if (lastMessage.timestamp >= self->_room.lastActivity && !lastMessage.isUpdateMessage) {
self->_room.lastActivity = lastMessage.timestamp;
[[NCRoomsManager sharedInstance] updateLastMessage:lastMessage withNoUnreadMessages:YES forRoom:self->_room];
}
@ -433,7 +433,7 @@ NSString * const NCChatControllerDidReceiveCallEndedMessageNotification
NCChatMessage *lastMessage = [storedMessages lastObject];
// Make sure we update the unread flags for the room (lastMessage can already be set, but there still might be unread flags)
if (lastMessage.timestamp >= self->_room.lastActivity) {
if (lastMessage.timestamp >= self->_room.lastActivity && !lastMessage.isUpdateMessage) {
self->_room.lastActivity = lastMessage.timestamp;
[[NCRoomsManager sharedInstance] updateLastMessage:lastMessage withNoUnreadMessages:YES forRoom:self->_room];
}
@ -605,7 +605,7 @@ NSString * const NCChatControllerDidReceiveCallEndedMessageNotification
for (NCChatMessage *message in storedMessages) {
// Update the current room with the new message
if (message.messageId == lastKnownMessage && message.timestamp > self->_room.lastActivity) {
if (message.messageId == lastKnownMessage && message.timestamp > self->_room.lastActivity && !message.isUpdateMessage) {
self->_room.lastActivity = message.timestamp;
[[NCRoomsManager sharedInstance] updateLastMessage:message withNoUnreadMessages:YES forRoom:self->_room];
}