Update account peers if ns group has peers

This commit is contained in:
bcmmbaga
2024-07-18 21:04:58 +03:00
parent 36d4c21671
commit 3e76deaa87
2 changed files with 37 additions and 16 deletions

View File

@@ -490,3 +490,13 @@ func isGroupLinkedToUser(users map[string]*User, groupID string) (bool, *User) {
}
return false, nil
}
// anyGroupHasPeers checks if any of the given groups in the account have peers.
func anyGroupHasPeers(account *Account, groupIDs []string) bool {
for _, groupID := range groupIDs {
if group, exists := account.Groups[groupID]; exists && group.HasPeers() {
return true
}
}
return false
}