parent
a21bebcacc
commit
b26565e653
|
@ -62,8 +62,7 @@ proc init*(self: Controller) =
|
|||
var args = MessagesArgs(e)
|
||||
if(self.chatId != args.chatId):
|
||||
return
|
||||
for message in args.messages:
|
||||
self.delegate.messageAdded(message)
|
||||
self.delegate.messagesAdded(args.messages)
|
||||
|
||||
self.events.on(SIGNAL_SENDING_SUCCESS) do(e:Args):
|
||||
let args = MessageSendingSuccess(e)
|
||||
|
|
|
@ -44,7 +44,7 @@ method onPinMessage*(self: AccessInterface, messageId: string, actionInitiatedBy
|
|||
method onUnpinMessage*(self: AccessInterface, messageId: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method messageAdded*(self: AccessInterface, message: MessageDto) {.base.} =
|
||||
method messagesAdded*(self: AccessInterface, messages: seq[MessageDto]) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method onSendingMessageSuccess*(self: AccessInterface, message: MessageDto) {.base.} =
|
||||
|
|
|
@ -289,7 +289,10 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
|||
|
||||
self.view.initialMessagesAreLoaded()
|
||||
|
||||
method messageAdded*(self: Module, message: MessageDto) =
|
||||
method messagesAdded*(self: Module, messages: seq[MessageDto]) =
|
||||
var items: seq[Item]
|
||||
|
||||
for message in messages:
|
||||
let sender = self.controller.getContactDetails(message.`from`)
|
||||
|
||||
let renderedMessageText = self.controller.getRenderedText(message.parsedText)
|
||||
|
@ -356,12 +359,14 @@ method messageAdded*(self: Module, message: MessageDto) =
|
|||
message.quotedMessage.deleted,
|
||||
)
|
||||
|
||||
self.view.model().insertItemBasedOnClock(item)
|
||||
items.add(item)
|
||||
|
||||
self.view.model().insertItemsBasedOnClock(items)
|
||||
|
||||
method removeNewMessagesMarker*(self: Module)
|
||||
|
||||
method onSendingMessageSuccess*(self: Module, message: MessageDto) =
|
||||
self.messageAdded(message)
|
||||
self.messagesAdded(@[message])
|
||||
self.view.emitSendingMessageSuccessSignal()
|
||||
self.removeNewMessagesMarker()
|
||||
|
||||
|
|
Loading…
Reference in New Issue