mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-22 04:21:44 +00:00
parent
f4ed7f09cd
commit
cfd227f9f2
@ -115,6 +115,12 @@ method init*(self: Controller) =
|
||||
return
|
||||
self.delegate.onMessageEdited(args.message)
|
||||
|
||||
self.events.on(SIGNAL_CHAT_HISTORY_CLEARED) do (e: Args):
|
||||
var args = ChatArgs(e)
|
||||
if(self.chatId != args.chatId):
|
||||
return
|
||||
self.delegate.onHistoryCleared()
|
||||
|
||||
method getMySectionId*(self: Controller): string =
|
||||
return self.sectionId
|
||||
|
||||
|
@ -281,6 +281,9 @@ method onMessageEdited*(self: Module, message: MessageDto) =
|
||||
let renderedMessageText = self.controller.getRenderedText(message.parsedText)
|
||||
self.view.model().updateEditedMsg(message.id, renderedMessageText, message.containsContactMentions())
|
||||
|
||||
method onHistoryCleared*(self: Module) =
|
||||
self.view.model().clear()
|
||||
|
||||
method updateChatIdentifier*(self: Module) =
|
||||
# Delete the old ChatIdentifier message first
|
||||
self.view.model().removeItem(CHAT_IDENTIFIER_MESSAGE_ID)
|
||||
|
@ -30,3 +30,6 @@ method onMessageDeleted*(self: AccessInterface, messageId: string) {.base.} =
|
||||
|
||||
method editMessage*(self: AccessInterface, messageId: string, updatedMsg: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method onHistoryCleared*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
@ -350,4 +350,8 @@ QtObject:
|
||||
let index = self.createIndex(ind, 0, nil)
|
||||
self.dataChanged(index, index, @[ModelRole.MessageText.int, ModelRole.MessageContainsMentions.int, ModelRole.IsEdited.int])
|
||||
|
||||
|
||||
proc clear*(self: Model) =
|
||||
self.beginResetModel()
|
||||
self.items = @[]
|
||||
self.endResetModel()
|
||||
self.countChanged()
|
Loading…
x
Reference in New Issue
Block a user