fix: trigger changes in membership verification on chat update

This commit is contained in:
Richard Ramos 2020-12-08 09:40:03 -04:00 committed by Iuri Matias
parent 10d82124fe
commit 92bd8a1b96
1 changed files with 3 additions and 2 deletions

View File

@ -26,9 +26,12 @@ QtObject:
result.chatMembers = newChatMembersView(status) result.chatMembers = newChatMembersView(status)
result.setup result.setup
proc membershipChanged*(self: ChatItemView) {.signal.}
proc setChatItem*(self: ChatItemView, chatItem: Chat) = proc setChatItem*(self: ChatItemView, chatItem: Chat) =
self.chatItem = chatItem self.chatItem = chatItem
self.chatMembers.setMembers(chatItem.members) self.chatMembers.setMembers(chatItem.members)
self.membershipChanged()
proc id*(self: ChatItemView): string {.slot.} = result = ?.self.chatItem.id proc id*(self: ChatItemView): string {.slot.} = result = ?.self.chatItem.id
@ -118,8 +121,6 @@ QtObject:
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0") let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")
return self.chatItem.isMember(pubKey) return self.chatItem.isMember(pubKey)
proc membershipChanged*(self: ChatItemView) {.signal.}
QtProperty[bool] isMember: QtProperty[bool] isMember:
read = isMember read = isMember
notify = membershipChanged notify = membershipChanged