From 0548a9421be1f7cb4b1e802cef903996612a4d08 Mon Sep 17 00:00:00 2001 From: Ivan Sein Date: Thu, 21 Apr 2022 17:24:39 +0200 Subject: [PATCH] Do not manually update room last message with invisible messages. Signed-off-by: Ivan Sein --- NextcloudTalk/NCChatController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NextcloudTalk/NCChatController.m b/NextcloudTalk/NCChatController.m index bebda5f2..0f24bd31 100644 --- a/NextcloudTalk/NCChatController.m +++ b/NextcloudTalk/NCChatController.m @@ -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]; }