mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 06:47:01 +00:00
fix(@desktop/communities): show members in spectate mode for open communities and hide for closed communities
This commit is contained in:
parent
645d9c8276
commit
8c874a90d2
@ -290,9 +290,10 @@ proc toCommunityDto*(jsonObj: JsonNode): CommunityDto =
|
|||||||
|
|
||||||
var membersObj: JsonNode
|
var membersObj: JsonNode
|
||||||
if(jsonObj.getProp("members", membersObj) and membersObj.kind == JObject):
|
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:
|
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.members.add(toChannelMember(memberObj, memberId, joined = result.isMember))
|
|
||||||
|
|
||||||
var tagsObj: JsonNode
|
var tagsObj: JsonNode
|
||||||
if(jsonObj.getProp("tags", tagsObj)):
|
if(jsonObj.getProp("tags", tagsObj)):
|
||||||
|
@ -517,7 +517,7 @@ QtObject:
|
|||||||
self.events.emit(SIGNAL_COMMUNITY_CHANNEL_EDITED, data)
|
self.events.emit(SIGNAL_COMMUNITY_CHANNEL_EDITED, data)
|
||||||
|
|
||||||
# members list was changed
|
# 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,
|
self.events.emit(SIGNAL_COMMUNITY_MEMBERS_CHANGED,
|
||||||
CommunityMembersArgs(communityId: community.id, members: community.members))
|
CommunityMembersArgs(communityId: community.id, members: community.members))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user