mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-18 09:37:59 +00:00
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) =
|
proc updateMemberVisibility*(self: CommunitiesView, statusUpdate: StatusUpdate) =
|
||||||
self.joinedCommunityList.updateMemberVisibility(statusUpdate)
|
self.joinedCommunityList.updateMemberVisibility(statusUpdate)
|
||||||
self.activeCommunity.setCommunityItem(self.joinedCommunityList.getCommunityById(self.activeCommunity.communityItem.id))
|
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] =
|
proc populateChats(self: CommunitiesView, communities: var seq[Community]): seq[Community] =
|
||||||
result = @[]
|
result = @[]
|
||||||
|
@ -194,7 +194,7 @@ QtObject:
|
|||||||
proc getMembers*(self: CommunityItemView): QVariant {.slot.} =
|
proc getMembers*(self: CommunityItemView): QVariant {.slot.} =
|
||||||
result = newQVariant(self.members)
|
result = newQVariant(self.members)
|
||||||
|
|
||||||
proc triggerMemberUpdate*(self: CommunityItemView) =
|
proc triggerMembersUpdate*(self: CommunityItemView) {.slot.} =
|
||||||
self.members.triggerUpdate()
|
self.members.triggerUpdate()
|
||||||
|
|
||||||
proc memberLastSeen*(self: CommunityItemView, pubKey: string): string {.slot.} =
|
proc memberLastSeen*(self: CommunityItemView, pubKey: string): string {.slot.} =
|
||||||
|
@ -56,7 +56,10 @@ QtObject:
|
|||||||
|
|
||||||
proc userName(self: CommunityMembersView, pk: string, alias: string): string =
|
proc userName(self: CommunityMembersView, pk: string, alias: string): string =
|
||||||
if self.status.chat.contacts.hasKey(pk):
|
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:
|
else:
|
||||||
result = alias
|
result = alias
|
||||||
|
|
||||||
@ -114,17 +117,6 @@ QtObject:
|
|||||||
of CommunityMembersRoles.StatusType: result = newQVariant(self.memberStatus(communityMemberPubkey))
|
of CommunityMembersRoles.StatusType: result = newQVariant(self.memberStatus(communityMemberPubkey))
|
||||||
of CommunityMembersRoles.Online: result = newQVariant(self.isOnline(communityMemberPubkey))
|
of CommunityMembersRoles.Online: result = newQVariant(self.isOnline(communityMemberPubkey))
|
||||||
of CommunityMembersRoles.SortKey: result = newQVariant(self.sortKey(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] =
|
method roleNames(self: CommunityMembersView): Table[int, string] =
|
||||||
{
|
{
|
||||||
@ -139,4 +131,4 @@ QtObject:
|
|||||||
|
|
||||||
proc triggerUpdate*(self: CommunityMembersView) =
|
proc triggerUpdate*(self: CommunityMembersView) =
|
||||||
self.beginResetModel()
|
self.beginResetModel()
|
||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
@ -117,6 +117,9 @@ ModalPopup {
|
|||||||
popup.changeNickname(nicknameInput.textField.text)
|
popup.changeNickname(nicknameInput.textField.text)
|
||||||
profileModel.contacts.changeContactNickname(fromAuthor, nicknameInput.textField.text)
|
profileModel.contacts.changeContactNickname(fromAuthor, nicknameInput.textField.text)
|
||||||
popup.close()
|
popup.close()
|
||||||
|
if (!!chatsModel.communities.activeCommunity) {
|
||||||
|
chatsModel.communities.activeCommunity.triggerMembersUpdate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user