diff --git a/src/app/modules/main/chat_section/chat_content/messages/controller.nim b/src/app/modules/main/chat_section/chat_content/messages/controller.nim index 872e7e2922..856b2336cb 100644 --- a/src/app/modules/main/chat_section/chat_content/messages/controller.nim +++ b/src/app/modules/main/chat_section/chat_content/messages/controller.nim @@ -212,11 +212,11 @@ proc init*(self: Controller) = if (community.id == self.sectionId): self.delegate.updateCommunityDetails(community) - self.events.on(SIGNAL_MESSAGE_FIRST_UNSEEN) do(e: Args): - let args = MessageFirstUnseen(e) + self.events.on(SIGNAL_FIRST_UNSEEN_MESSAGE_LOADED) do(e: Args): + let args = FirstUnseenMessageLoadedArgs(e) if (args.chatId != self.chatId): return - self.delegate.onFirstUnseenMessageId(args.messageId) + self.delegate.onFirstUnseenMessageLoaded(args.messageId) proc getMySectionId*(self: Controller): string = return self.sectionId diff --git a/src/app/modules/main/chat_section/chat_content/messages/io_interface.nim b/src/app/modules/main/chat_section/chat_content/messages/io_interface.nim index f1d3685245..018b0f4cf3 100644 --- a/src/app/modules/main/chat_section/chat_content/messages/io_interface.nim +++ b/src/app/modules/main/chat_section/chat_content/messages/io_interface.nim @@ -159,5 +159,5 @@ method markAllMessagesRead*(self: AccessInterface) = method updateCommunityDetails*(self: AccessInterface, community: CommunityDto) = raise newException(ValueError, "No implementation available") -method onFirstUnseenMessageId*(self: AccessInterface, messageId: string) = - raise newException(ValueError, "No implementation available") \ No newline at end of file +method onFirstUnseenMessageLoaded*(self: AccessInterface, messageId: string) = + raise newException(ValueError, "No implementation available") 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 4a4165882b..f926c07c96 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 @@ -716,7 +716,7 @@ proc updateItemsByAlbum(self: Module, items: var seq[Item], message: MessageDto) return true return false -method onFirstUnseenMessageId*(self: Module, messageId: string) = +method onFirstUnseenMessageLoaded*(self: Module, messageId: string) = self.view.model().setFirstUnseenMessageId(messageId) self.view.model().resetNewMessagesMarker() let index = self.view.model().findIndexForMessageId(messageId) diff --git a/src/app_service/service/message/service.nim b/src/app_service/service/message/service.nim index 7803f8646f..753a746f9d 100644 --- a/src/app_service/service/message/service.nim +++ b/src/app_service/service/message/service.nim @@ -40,7 +40,7 @@ const WEEK_AS_MILLISECONDS = initDuration(seconds = 60*60*24*7).inMilliSeconds # Signals which may be emitted by this service: const SIGNAL_MESSAGES_LOADED* = "messagesLoaded" -const SIGNAL_MESSAGE_FIRST_UNSEEN* = "messageFirstUnseen" +const SIGNAL_FIRST_UNSEEN_MESSAGE_LOADED* = "firstUnseenMessageLoaded" const SIGNAL_NEW_MESSAGE_RECEIVED* = "newMessageReceived" const SIGNAL_MESSAGE_PINNED* = "messagePinned" const SIGNAL_MESSAGE_UNPINNED* = "messageUnpinned" @@ -117,7 +117,7 @@ type ReloadMessagesArgs* = ref object of Args communityId*: string - MessageFirstUnseen* = ref object of Args + FirstUnseenMessageLoadedArgs* = ref object of Args chatId*: string messageId*: string @@ -687,8 +687,8 @@ QtObject: else: discard responseObj.getProp("messageId", messageId) - self.events.emit(SIGNAL_MESSAGE_FIRST_UNSEEN, MessageFirstUnseen(chatId: chatId, messageId: messageId)) - + self.events.emit(SIGNAL_FIRST_UNSEEN_MESSAGE_LOADED, FirstUnseenMessageLoadedArgs(chatId: chatId, messageId: messageId)) + except Exception as e: error "error: ", procName="onGetFirstUnseenMessageIdFor", errName = e.name, errDesription = e.msg