NickServ: add SET AUTOOP per-account auto-op opt-out
A user with SET AUTOOP OFF is never auto-opped on join, even where they hold channel access — they op themselves via ChanServ UP. Stored inverted (no_autoop) so the default stays auto-op. Join gates on both the channel setting and the account preference; either can opt out.
This commit is contained in:
parent
0027decdb7
commit
87e21ff85f
11 changed files with 111 additions and 11 deletions
|
|
@ -15,6 +15,7 @@ pub enum Event {
|
|||
CertRemoved { account: String, fp: String },
|
||||
AccountEmailSet { account: String, email: Option<String> },
|
||||
AccountGreetSet { account: String, greet: String },
|
||||
AccountAutoOpSet { account: String, on: bool },
|
||||
AccountPasswordSet { account: String, scram256: String, scram512: String },
|
||||
AccountDropped { account: String },
|
||||
AccountVerified { account: String },
|
||||
|
|
@ -147,6 +148,7 @@ impl Event {
|
|||
| Event::CertRemoved { .. }
|
||||
| Event::AccountEmailSet { .. }
|
||||
| Event::AccountGreetSet { .. }
|
||||
| Event::AccountAutoOpSet { .. }
|
||||
| Event::AccountPasswordSet { .. }
|
||||
| Event::AccountDropped { .. }
|
||||
| Event::AccountVerified { .. }
|
||||
|
|
@ -273,6 +275,11 @@ pub(crate) fn apply(accounts: &mut HashMap<String, Account>, channels: &mut Hash
|
|||
a.greet = greet;
|
||||
}
|
||||
}
|
||||
Event::AccountAutoOpSet { account, on } => {
|
||||
if let Some(a) = accounts.get_mut(&key(&account)) {
|
||||
a.no_autoop = !on;
|
||||
}
|
||||
}
|
||||
Event::AccountPasswordSet { account, scram256, scram512 } => {
|
||||
if let Some(a) = accounts.get_mut(&key(&account)) {
|
||||
a.scram256 = Some(scram256);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue