Skip to content

Commit

Permalink
fix: add all members to channel when it is no longer token-gated
Browse files Browse the repository at this point in the history
  • Loading branch information
osmaczko committed Jul 27, 2023
1 parent b44885c commit 85c3705
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions protocol/communities/community.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 5 additions & 0 deletions protocol/communities/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 85c3705

Please sign in to comment.