From b242624c4774e59c4ddf2ff322b15759500efc9c Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Mon, 16 Jan 2023 19:29:30 +0100 Subject: [PATCH] fix(chat/messages): use timestamp instead of whisperTimestamp iterates: #8962 --- src/app/modules/main/activity_center/module.nim | 2 +- .../main/chat_section/chat_content/messages/module.nim | 6 +++--- src/app/modules/main/chat_section/chat_content/module.nim | 2 +- src/app_service/service/message/dto/message.nim | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/modules/main/activity_center/module.nim b/src/app/modules/main/activity_center/module.nim index 39e9e0ea3a..6f63201a96 100644 --- a/src/app/modules/main/activity_center/module.nim +++ b/src/app/modules/main/activity_center/module.nim @@ -91,7 +91,7 @@ proc createMessageItemFromDto(self: Module, message: MessageDto, chatDetails: Ch message.image, message.containsContactMentions(), message.seen, - timestamp = message.whisperTimestamp, + timestamp = message.timestamp, clock = message.clock, ContentType(message.contentType), message.messageType, diff --git a/src/app/modules/main/chat_section/chat_content/messages/module.nim b/src/app/modules/main/chat_section/chat_content/messages/module.nim index 25cfe2d49b..63ad0b580c 100644 --- a/src/app/modules/main/chat_section/chat_content/messages/module.nim +++ b/src/app/modules/main/chat_section/chat_content/messages/module.nim @@ -228,7 +228,7 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se message.image, message.containsContactMentions(), message.seen, - timestamp = message.whisperTimestamp, + timestamp = message.timestamp, clock = message.clock, message.contentType.ContentType, message.messageType, @@ -341,7 +341,7 @@ method messagesAdded*(self: Module, messages: seq[MessageDto]) = message.image, message.containsContactMentions(), message.seen, - timestamp = message.whisperTimestamp, + timestamp = message.timestamp, clock = message.clock, message.contentType.ContentType, message.messageType, @@ -638,7 +638,7 @@ method getMessageById*(self: Module, messageId: string): message_item.Item = message.image, message.containsContactMentions(), message.seen, - timestamp = message.whisperTimestamp, + timestamp = message.timestamp, clock = message.clock, message.contentType.ContentType, message.messageType, diff --git a/src/app/modules/main/chat_section/chat_content/module.nim b/src/app/modules/main/chat_section/chat_content/module.nim index d71ca45178..0482f7c927 100644 --- a/src/app/modules/main/chat_section/chat_content/module.nim +++ b/src/app/modules/main/chat_section/chat_content/module.nim @@ -181,7 +181,7 @@ proc buildPinnedMessageItem(self: Module, messageId: string, actionInitiatedBy: message.image, message.containsContactMentions(), message.seen, - timestamp = message.whisperTimestamp, + timestamp = message.timestamp, clock = message.clock, message.contentType.ContentType, message.messageType, diff --git a/src/app_service/service/message/dto/message.nim b/src/app_service/service/message/dto/message.nim index 7ebf8f2e31..3080944788 100644 --- a/src/app_service/service/message/dto/message.nim +++ b/src/app_service/service/message/dto/message.nim @@ -85,7 +85,6 @@ type TransactionParameters* = object type MessageDto* = object id*: string communityId*: string - whisperTimestamp*: int64 `from`*: string alias*: string seen*: bool @@ -205,7 +204,6 @@ proc toMessageDto*(jsonObj: JsonNode): MessageDto = result = MessageDto() discard jsonObj.getProp("id", result.id) discard jsonObj.getProp("communityId", result.communityId) - discard jsonObj.getProp("whisperTimestamp", result.whisperTimestamp) discard jsonObj.getProp("from", result.from) discard jsonObj.getProp("alias", result.alias) discard jsonObj.getProp("seen", result.seen)