ircv3: close server-support-table gaps — BOT=B ISUPPORT, account-extban (a: matcher + ACCOUNTEXTBAN=a), draft/read-marker cap (gates MARKREAD sync), and no-implicit-names (suppress the post-JOIN NAMES burst)
This commit is contained in:
parent
c9bd8e7492
commit
bcd958d2d3
6 changed files with 75 additions and 5 deletions
16
src/modules/accountban.rs
Normal file
16
src/modules/accountban.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//! The `a:` matching extban (IRCv3 account-extban): match a user by the services
|
||||
//! account they are logged into. `+b a:spammer` bans the account `spammer` (glob),
|
||||
//! `+e a:trusted` exempts one. A user with no account never matches. Dispatched
|
||||
//! from the channel ban matcher; advertised via `ACCOUNTEXTBAN=a`.
|
||||
|
||||
use crate::channels::glob_match;
|
||||
use crate::server::Server;
|
||||
use crate::Uid;
|
||||
|
||||
/// Does `uid`'s logged-in account match the glob `mask` (the part after `a:`)?
|
||||
pub fn matches(s: &Server, uid: Uid, mask: &str) -> bool {
|
||||
match s.users.get(&uid).and_then(|u| u.account.as_deref()) {
|
||||
Some(acct) => glob_match(mask, acct),
|
||||
None => false, // not logged in — an account ban can't match
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue