From 85c3705decb5ade39d87f1ced2320a8d0c32a048 Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Wed, 26 Jul 2023 16:13:31 +0200 Subject: [PATCH] fix: add all members to channel when it is no longer token-gated --- protocol/communities/community.go | 1 + protocol/communities/manager.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/protocol/communities/community.go b/protocol/communities/community.go index 2495a34989a..97afbabab5d 100644 --- a/protocol/communities/community.go +++ b/protocol/communities/community.go @@ -2222,6 +2222,7 @@ func (o *Community) deleteTokenPermission(permissionID string) (*CommunityChange delete(o.config.CommunityDescription.TokenPermissions, permissionID) changes := o.emptyCommunityChanges() + changes.TokenPermissionsRemoved[permissionID] = permission return changes, nil } diff --git a/protocol/communities/manager.go b/protocol/communities/manager.go index 224623f28d8..5f33928dbf4 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -717,6 +717,11 @@ func (m *Manager) ReevaluateMembers(community *Community, removeAdmins bool) err viewAndPostPermissions := community.ChannelTokenPermissionsByType(chatID, protobuf.CommunityTokenPermission_CAN_VIEW_AND_POST_CHANNEL) if len(viewOnlyPermissions) == 0 && len(viewAndPostPermissions) == 0 { + // ensure all members are added back if channel permissions were removed + _, err = community.PopulateChatWithAllMembers(channelID) + if err != nil { + return err + } continue }