fix: fix pin counter not updating for communities

Fixes #3014
This commit is contained in:
Jonathan Rainville 2021-07-22 13:09:34 -04:00 committed by Iuri Matias
parent 54570bce6e
commit 0455bcdcf1
2 changed files with 6 additions and 4 deletions

View File

@ -322,7 +322,9 @@ QtObject:
for chat in chats:
if (chat.communityId != ""):
self.communities.updateCommunityChat(chat)
return
if(self.channelView.activeChannel.id == chat.id):
self.activeChannelChanged()
continue
self.messageView.upsertChannel(chat.id)
self.channelView.chats.updateChat(chat)
if(self.channelView.activeChannel.id == chat.id):

View File

@ -68,6 +68,8 @@ QtObject:
proc setup(self: ChatMessageList) =
self.QAbstractListModel.setup
proc countChanged*(self: ChatMessageList) {.signal.}
proc fetchMoreMessagesButton(self: ChatMessageList): Message =
result = Message()
result.contentType = ContentType.FetchMoreMessagesButton;
@ -96,7 +98,6 @@ QtObject:
result.status = status
result.setup
proc hasMessage*(self: ChatMessageList, messageId: string): bool =
return self.messageIndex.hasKey(messageId)
@ -116,6 +117,7 @@ QtObject:
for i in countup(0, self.messages.len - 1):
self.messageIndex[self.messages[i].id] = i
self.endRemoveRows()
self.countChanged()
return true
@ -155,8 +157,6 @@ QtObject:
method rowCount(self: ChatMessageList, index: QModelIndex = nil): int =
return self.messages.len
proc countChanged*(self: ChatMessageList) {.signal.}
proc count*(self: ChatMessageList): int {.slot.} =
self.messages.len