fix(@desktop/communities): changing contact nickname must be reflected in users list
This commit is contained in:
parent
1c7fa14903
commit
8ae050b642
|
@ -75,7 +75,7 @@ QtObject:
|
|||
proc updateMemberVisibility*(self: CommunitiesView, statusUpdate: StatusUpdate) =
|
||||
self.joinedCommunityList.updateMemberVisibility(statusUpdate)
|
||||
self.activeCommunity.setCommunityItem(self.joinedCommunityList.getCommunityById(self.activeCommunity.communityItem.id))
|
||||
self.activeCommunity.triggerMemberUpdate()
|
||||
self.activeCommunity.triggerMembersUpdate()
|
||||
|
||||
proc populateChats(self: CommunitiesView, communities: var seq[Community]): seq[Community] =
|
||||
result = @[]
|
||||
|
|
|
@ -194,7 +194,7 @@ QtObject:
|
|||
proc getMembers*(self: CommunityItemView): QVariant {.slot.} =
|
||||
result = newQVariant(self.members)
|
||||
|
||||
proc triggerMemberUpdate*(self: CommunityItemView) =
|
||||
proc triggerMembersUpdate*(self: CommunityItemView) {.slot.} =
|
||||
self.members.triggerUpdate()
|
||||
|
||||
proc memberLastSeen*(self: CommunityItemView, pubKey: string): string {.slot.} =
|
||||
|
|
|
@ -56,7 +56,10 @@ QtObject:
|
|||
|
||||
proc userName(self: CommunityMembersView, pk: string, alias: string): string =
|
||||
if self.status.chat.contacts.hasKey(pk):
|
||||
result = ens.userNameOrAlias(self.status.chat.contacts[pk])
|
||||
if self.status.chat.contacts[pk].localNickname != "":
|
||||
result = self.status.chat.contacts[pk].localNickname
|
||||
else:
|
||||
result = ens.userNameOrAlias(self.status.chat.contacts[pk])
|
||||
else:
|
||||
result = alias
|
||||
|
||||
|
@ -114,17 +117,6 @@ QtObject:
|
|||
of CommunityMembersRoles.StatusType: result = newQVariant(self.memberStatus(communityMemberPubkey))
|
||||
of CommunityMembersRoles.Online: result = newQVariant(self.isOnline(communityMemberPubkey))
|
||||
of CommunityMembersRoles.SortKey: result = newQVariant(self.sortKey(communityMemberPubkey))
|
||||
|
||||
proc rowData(self: CommunityMembersView, index: int, column: string): string {.slot.} =
|
||||
if (index >= self.community.members.len):
|
||||
return
|
||||
let communityMemberPubkey = self.community.members[index]
|
||||
case column:
|
||||
of "alias": result = self.alias(communityMemberPubkey)
|
||||
of "address": result = communityMemberPubkey
|
||||
of "identicon": result = self.identicon(communityMemberPubkey)
|
||||
of "localNickname": result = self.localNickname(communityMemberPubkey)
|
||||
of "ensName": result = self.userName(communityMemberPubkey, self.alias(communityMemberPubkey))
|
||||
|
||||
method roleNames(self: CommunityMembersView): Table[int, string] =
|
||||
{
|
||||
|
@ -139,4 +131,4 @@ QtObject:
|
|||
|
||||
proc triggerUpdate*(self: CommunityMembersView) =
|
||||
self.beginResetModel()
|
||||
self.endResetModel()
|
||||
self.endResetModel()
|
||||
|
|
|
@ -117,6 +117,9 @@ ModalPopup {
|
|||
popup.changeNickname(nicknameInput.textField.text)
|
||||
profileModel.contacts.changeContactNickname(fromAuthor, nicknameInput.textField.text)
|
||||
popup.close()
|
||||
if (!!chatsModel.communities.activeCommunity) {
|
||||
chatsModel.communities.activeCommunity.triggerMembersUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue