chanserv: full AKICK extban registry, [extban] enabled gate, passive extbans pushed as channel bans for the ircd to enforce
This commit is contained in:
parent
9a197fca3d
commit
f7c38cedad
10 changed files with 224 additions and 65 deletions
|
|
@ -227,9 +227,19 @@ impl Network {
|
|||
ip: &u.ip,
|
||||
gecos: &u.gecos,
|
||||
account: self.accounts.get(uid).map(String::as_str),
|
||||
// TODO(extban): capture the user's server + TLS fingerprint from the s2s
|
||||
// stream to match the `server`/`fingerprint` extbans.
|
||||
server: "",
|
||||
fingerprint: None,
|
||||
channels: self.channels_of(uid),
|
||||
})
|
||||
}
|
||||
|
||||
/// The channels `uid` is currently in (for the `channel` extban).
|
||||
pub fn channels_of(&self, uid: &str) -> Vec<String> {
|
||||
self.channels.iter().filter(|(_, c)| c.members.contains(uid)).map(|(k, _)| k.clone()).collect()
|
||||
}
|
||||
|
||||
// Every known user whose uid carries `sid` as its prefix — i.e. those behind
|
||||
// a server, used to forget them all when it splits (SQUIT).
|
||||
pub fn uids_on_server(&self, sid: &str) -> Vec<String> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue