feat(@desktop/chat): update lastMessageTimestamp on message sent
iterates: #6634
This commit is contained in:
parent
876099b369
commit
781ec30e7f
|
@ -61,6 +61,10 @@ proc getActiveChatId*(self: Controller): string =
|
|||
|
||||
|
||||
proc init*(self: Controller) =
|
||||
self.events.on(SIGNAL_SENDING_SUCCESS) do(e:Args):
|
||||
let args = MessageSendingSuccess(e)
|
||||
self.delegate.updateLastMessageTimestamp(args.chat.id, args.chat.timestamp.int)
|
||||
|
||||
self.events.on(SIGNAL_NEW_MESSAGE_RECEIVED) do(e: Args):
|
||||
let args = MessagesArgs(e)
|
||||
if (self.sectionId != args.sectionId or args.messages.len == 0):
|
||||
|
|
|
@ -310,3 +310,6 @@ method onMeMentionedInEditedMessage*(self: AccessInterface, chatId: string, edit
|
|||
|
||||
method downloadMessages*(self: AccessInterface, chatId: string, filePath: string) =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method updateLastMessageTimestamp*(self: AccessInterface, chatId: string, lastMessageTimestamp: int) =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
|
|
@ -363,7 +363,7 @@ proc updateBadgeNotifications(self: Module, chatId: string, hasUnreadMessages: b
|
|||
# update parent module
|
||||
self.updateParentBadgeNotifications()
|
||||
|
||||
proc updateLastMessageTimestamp(self: Module, chatId: string, lastMessageTimestamp: int) =
|
||||
method updateLastMessageTimestamp*(self: Module, chatId: string, lastMessageTimestamp: int) =
|
||||
self.view.chatsModel().updateLastMessageTimestampForItemById(chatId, lastMessageTimestamp)
|
||||
|
||||
method onActiveSectionChange*(self: Module, sectionId: string) =
|
||||
|
|
Loading…
Reference in New Issue