parent
54570bce6e
commit
0455bcdcf1
|
@ -322,7 +322,9 @@ QtObject:
|
||||||
for chat in chats:
|
for chat in chats:
|
||||||
if (chat.communityId != ""):
|
if (chat.communityId != ""):
|
||||||
self.communities.updateCommunityChat(chat)
|
self.communities.updateCommunityChat(chat)
|
||||||
return
|
if(self.channelView.activeChannel.id == chat.id):
|
||||||
|
self.activeChannelChanged()
|
||||||
|
continue
|
||||||
self.messageView.upsertChannel(chat.id)
|
self.messageView.upsertChannel(chat.id)
|
||||||
self.channelView.chats.updateChat(chat)
|
self.channelView.chats.updateChat(chat)
|
||||||
if(self.channelView.activeChannel.id == chat.id):
|
if(self.channelView.activeChannel.id == chat.id):
|
||||||
|
|
|
@ -68,6 +68,8 @@ QtObject:
|
||||||
proc setup(self: ChatMessageList) =
|
proc setup(self: ChatMessageList) =
|
||||||
self.QAbstractListModel.setup
|
self.QAbstractListModel.setup
|
||||||
|
|
||||||
|
proc countChanged*(self: ChatMessageList) {.signal.}
|
||||||
|
|
||||||
proc fetchMoreMessagesButton(self: ChatMessageList): Message =
|
proc fetchMoreMessagesButton(self: ChatMessageList): Message =
|
||||||
result = Message()
|
result = Message()
|
||||||
result.contentType = ContentType.FetchMoreMessagesButton;
|
result.contentType = ContentType.FetchMoreMessagesButton;
|
||||||
|
@ -96,7 +98,6 @@ QtObject:
|
||||||
result.status = status
|
result.status = status
|
||||||
result.setup
|
result.setup
|
||||||
|
|
||||||
|
|
||||||
proc hasMessage*(self: ChatMessageList, messageId: string): bool =
|
proc hasMessage*(self: ChatMessageList, messageId: string): bool =
|
||||||
return self.messageIndex.hasKey(messageId)
|
return self.messageIndex.hasKey(messageId)
|
||||||
|
|
||||||
|
@ -116,6 +117,7 @@ QtObject:
|
||||||
for i in countup(0, self.messages.len - 1):
|
for i in countup(0, self.messages.len - 1):
|
||||||
self.messageIndex[self.messages[i].id] = i
|
self.messageIndex[self.messages[i].id] = i
|
||||||
self.endRemoveRows()
|
self.endRemoveRows()
|
||||||
|
self.countChanged()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
@ -155,8 +157,6 @@ QtObject:
|
||||||
method rowCount(self: ChatMessageList, index: QModelIndex = nil): int =
|
method rowCount(self: ChatMessageList, index: QModelIndex = nil): int =
|
||||||
return self.messages.len
|
return self.messages.len
|
||||||
|
|
||||||
proc countChanged*(self: ChatMessageList) {.signal.}
|
|
||||||
|
|
||||||
proc count*(self: ChatMessageList): int {.slot.} =
|
proc count*(self: ChatMessageList): int {.slot.} =
|
||||||
self.messages.len
|
self.messages.len
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue