From 8c874a90d2d0ff4473b181d975c210d9a1de5b7d Mon Sep 17 00:00:00 2001 From: mprakhov Date: Tue, 11 Apr 2023 23:22:49 +0200 Subject: [PATCH] fix(@desktop/communities): show members in spectate mode for open communities and hide for closed communities --- src/app_service/service/community/dto/community.nim | 5 +++-- src/app_service/service/community/service.nim | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app_service/service/community/dto/community.nim b/src/app_service/service/community/dto/community.nim index 50e433e4ea..cc12067b93 100644 --- a/src/app_service/service/community/dto/community.nim +++ b/src/app_service/service/community/dto/community.nim @@ -290,9 +290,10 @@ proc toCommunityDto*(jsonObj: JsonNode): CommunityDto = var membersObj: JsonNode if(jsonObj.getProp("members", membersObj) and membersObj.kind == JObject): + # Do not show members list in closed communities + let joined = result.isMember or result.tokenPermissions.len == 0 for memberId, memberObj in membersObj: - # Do not display members list until the user became a community member - result.members.add(toChannelMember(memberObj, memberId, joined = result.isMember)) + result.members.add(toChannelMember(memberObj, memberId, joined)) var tagsObj: JsonNode if(jsonObj.getProp("tags", tagsObj)): diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index a042d856b2..4f36b75bad 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -517,7 +517,7 @@ QtObject: self.events.emit(SIGNAL_COMMUNITY_CHANNEL_EDITED, data) # members list was changed - if community.isMember and community.members != prev_community.members: + if (community.isMember or community.tokenPermissions.len == 0) and community.members != prev_community.members: self.events.emit(SIGNAL_COMMUNITY_MEMBERS_CHANGED, CommunityMembersArgs(communityId: community.id, members: community.members))