NickServ: add SET KILL to toggle nick protection
Nick protection was unconditional. SET KILL OFF lets an account opt out — an unidentified user keeping one of its nicks is no longer prompted or renamed to a guest. Stored inverted (no_protect) so protection stays the default. Accepts Anope's ON/QUICK/IMMED/OFF; grace is a fixed interval here, so the finer variants simply enable protection like ON.
This commit is contained in:
parent
87e21ff85f
commit
2c4bc9079c
11 changed files with 106 additions and 9 deletions
|
|
@ -16,6 +16,7 @@ pub enum Event {
|
|||
AccountEmailSet { account: String, email: Option<String> },
|
||||
AccountGreetSet { account: String, greet: String },
|
||||
AccountAutoOpSet { account: String, on: bool },
|
||||
AccountKillSet { account: String, on: bool },
|
||||
AccountPasswordSet { account: String, scram256: String, scram512: String },
|
||||
AccountDropped { account: String },
|
||||
AccountVerified { account: String },
|
||||
|
|
@ -149,6 +150,7 @@ impl Event {
|
|||
| Event::AccountEmailSet { .. }
|
||||
| Event::AccountGreetSet { .. }
|
||||
| Event::AccountAutoOpSet { .. }
|
||||
| Event::AccountKillSet { .. }
|
||||
| Event::AccountPasswordSet { .. }
|
||||
| Event::AccountDropped { .. }
|
||||
| Event::AccountVerified { .. }
|
||||
|
|
@ -280,6 +282,11 @@ pub(crate) fn apply(accounts: &mut HashMap<String, Account>, channels: &mut Hash
|
|||
a.no_autoop = !on;
|
||||
}
|
||||
}
|
||||
Event::AccountKillSet { account, on } => {
|
||||
if let Some(a) = accounts.get_mut(&key(&account)) {
|
||||
a.no_protect = !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