fix(community): only checkPermissions if the community has permissions
This commit is contained in:
parent
79365ef576
commit
329f5c8316
|
@ -1433,6 +1433,10 @@ func (o *Community) TokenPermissions() map[string]*protobuf.CommunityTokenPermis
|
||||||
return o.config.CommunityDescription.TokenPermissions
|
return o.config.CommunityDescription.TokenPermissions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *Community) HasTokenPermissions() bool {
|
||||||
|
return len(o.config.CommunityDescription.TokenPermissions) > 0
|
||||||
|
}
|
||||||
|
|
||||||
func (o *Community) TokenPermissionsByType(permissionType protobuf.CommunityTokenPermission_Type) []*protobuf.CommunityTokenPermission {
|
func (o *Community) TokenPermissionsByType(permissionType protobuf.CommunityTokenPermission_Type) []*protobuf.CommunityTokenPermission {
|
||||||
permissions := make([]*protobuf.CommunityTokenPermission, 0)
|
permissions := make([]*protobuf.CommunityTokenPermission, 0)
|
||||||
for _, tokenPermission := range o.TokenPermissions() {
|
for _, tokenPermission := range o.TokenPermissions() {
|
||||||
|
|
|
@ -732,7 +732,7 @@ func (m *Messenger) Start() (*MessengerResponse, error) {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
for _, c := range adminCommunities {
|
for _, c := range adminCommunities {
|
||||||
if c.Joined() {
|
if c.Joined() && c.HasTokenPermissions() {
|
||||||
go m.communitiesManager.CheckMemberPermissionsPeriodically(c.ID())
|
go m.communitiesManager.CheckMemberPermissionsPeriodically(c.ID())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue