diff --git a/src/app/modules/main/chat_section/chat_content/users/module.nim b/src/app/modules/main/chat_section/chat_content/users/module.nim index 1927e3dfa1..9df4e7651d 100644 --- a/src/app/modules/main/chat_section/chat_content/users/module.nim +++ b/src/app/modules/main/chat_section/chat_content/users/module.nim @@ -97,8 +97,9 @@ method contactUpdated*(self: Module, publicKey: string) = alias = contactDetails.dto.alias, icon = contactDetails.icon, isContact = contactDetails.dto.isContact, - trustStatus = contactDetails.dto.trustStatus, isBlocked = contactDetails.dto.isBlocked, + trustStatus = contactDetails.dto.trustStatus, + contactRequest = toContactStatus(contactDetails.dto.contactRequestState), ) method userProfileUpdated*(self: Module) = @@ -152,6 +153,7 @@ proc processChatMember(self: Module, member: ChatMember, reset: bool = false): isContact = contactDetails.dto.isContact, isBlocked = contactDetails.dto.isBlocked, isCurrentUser = isMe, + contactRequest = toContactStatus(contactDetails.dto.contactRequestState), memberRole = member.role, joined = member.joined, trustStatus = contactDetails.dto.trustStatus, @@ -208,6 +210,7 @@ method onChatMemberUpdated*(self: Module, publicKey: string, memberRole: MemberR memberRole, joined, trustStatus = contactDetails.dto.trustStatus, + contactRequest = toContactStatus(contactDetails.dto.contactRequestState), ) method addGroupMembers*(self: Module, pubKeys: seq[string]) = diff --git a/src/app/modules/main/module.nim b/src/app/modules/main/module.nim index 80c17acc9d..f217f2231b 100644 --- a/src/app/modules/main/module.nim +++ b/src/app/modules/main/module.nim @@ -1897,6 +1897,7 @@ proc createMemberItem[T]( isBlocked = contactDetails.dto.isBlocked, isCurrentUser = contactDetails.isCurrentUser, trustStatus = contactDetails.dto.trustStatus, + contactRequest = toContactStatus(contactDetails.dto.contactRequestState), memberRole = role, membershipRequestState = state, requestToJoinId = requestId, @@ -1916,6 +1917,7 @@ method contactUpdated*[T](self: Module[T], contactId: string) = isContact = contactDetails.dto.isContact, isBlocked = contactDetails.dto.isBlocked, trustStatus = contactDetails.dto.trustStatus, + contactRequest = toContactStatus(contactDetails.dto.contactRequestState), ) {.pop.} diff --git a/src/app/modules/shared_models/member_model.nim b/src/app/modules/shared_models/member_model.nim index 58c475967b..15596a0a2b 100644 --- a/src/app/modules/shared_models/member_model.nim +++ b/src/app/modules/shared_models/member_model.nim @@ -293,6 +293,7 @@ QtObject: joined: bool, membershipRequestState: MembershipRequestState = MembershipRequestState.None, trustStatus: TrustStatus, + contactRequest: ContactRequest, callDataChanged: bool = true, ): seq[int] = let ind = self.findIndexForMember(pubKey) @@ -318,6 +319,7 @@ QtObject: updateRole(joined, Joined) updateRole(trustStatus, TrustStatus) updateRole(isBlocked, IsBlocked) + updateRole(contactRequest, ContactRequest) var updatedMembershipRequestState = membershipRequestState if updatedMembershipRequestState == MembershipRequestState.None: @@ -364,6 +366,7 @@ QtObject: item.joined, item.membershipRequestState, item.trustStatus, + item.contactRequest, callDataChanged = false, ) @@ -432,6 +435,7 @@ QtObject: isContact: bool, isBlocked: bool, trustStatus: TrustStatus, + contactRequest: ContactRequest ) = let ind = self.findIndexForMember(pubKey) if ind == -1: @@ -451,6 +455,7 @@ QtObject: joined = self.items[ind].joined, self.items[ind].membershipRequestState, trustStatus, + contactRequest, ) proc setOnlineStatus*(self: Model, pubKey: string, onlineStatus: OnlineStatus) = diff --git a/src/app/modules/shared_models/section_model.nim b/src/app/modules/shared_models/section_model.nim index 1e2beb0ee3..cfadf5e97d 100644 --- a/src/app/modules/shared_models/section_model.nim +++ b/src/app/modules/shared_models/section_model.nim @@ -346,6 +346,7 @@ QtObject: isContact: bool, isBlocked: bool, trustStatus: TrustStatus, + contactRequest: ContactRequest, ) = for item in self.items: item.members.updateItem( @@ -359,6 +360,7 @@ QtObject: isContact, isBlocked, trustStatus, + contactRequest, ) proc getNthEnabledItem*(self: SectionModel, nth: int): SectionItem = diff --git a/test/nim/member_model_test.nim b/test/nim/member_model_test.nim index 69a0165dbc..b6742edf21 100644 --- a/test/nim/member_model_test.nim +++ b/test/nim/member_model_test.nim @@ -44,9 +44,11 @@ suite "updating member items": alias = "", icon = "", isContact = false, + isBlocked = false, memberRole = MemberRole.None, joined = false, trustStatus = TrustStatus.Unknown, + contactRequest = ContactRequest.None, callDataChanged = false, ) # Two updated roles, because preferredDisplayName gets updated too @@ -64,9 +66,11 @@ suite "updating member items": alias = "", icon = "icon", isContact = true, + isBlocked = false, memberRole = MemberRole.None, joined = false, trustStatus = TrustStatus.Unknown, + contactRequest = ContactRequest.None, callDataChanged = false, ) check(updatedRoles.len() == 2) diff --git a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml index e69e46648c..8b63dc02cf 100644 --- a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml @@ -196,8 +196,6 @@ Item { id: profileContextMenuComponent ProfileContextMenu { - id: profileContextMenu - property string pubKey margins: 8