Cap and freeze-gate GroupServ registration
This commit is contained in:
parent
0c85c5b569
commit
fa9eaece45
4 changed files with 22 additions and 0 deletions
|
|
@ -657,6 +657,11 @@ impl Db {
|
|||
names
|
||||
}
|
||||
|
||||
/// How many groups `account` is the founder of (bounds group registration).
|
||||
pub fn groups_founded(&self, account: &str) -> usize {
|
||||
self.net.groups.iter().filter(|g| g.founder.eq_ignore_ascii_case(account)).count()
|
||||
}
|
||||
|
||||
/// The groups an account belongs to (founder or member).
|
||||
pub fn groups_of(&self, account: &str) -> Vec<String> {
|
||||
self.net
|
||||
|
|
|
|||
|
|
@ -401,6 +401,9 @@ impl Store for Db {
|
|||
fn groups_of(&self, account: &str) -> Vec<String> {
|
||||
Db::groups_of(self, account)
|
||||
}
|
||||
fn groups_founded(&self, account: &str) -> usize {
|
||||
Db::groups_founded(self, account)
|
||||
}
|
||||
fn channel_caps(&self, channel: &str, account: &str) -> Caps {
|
||||
Db::channel_caps(self, channel, account)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue