NickServ: add SET HIDE STATUS for last-seen privacy
Lets an account keep its last-seen/online line in INFO visible only to itself and to opers. Default stays public (Anope's default). Accepts STATUS (with USERMASK as an alias) per Anope's SET HIDE <field> grammar.
This commit is contained in:
parent
39d7421c06
commit
053f8cf832
12 changed files with 116 additions and 19 deletions
|
|
@ -17,6 +17,7 @@ pub enum Event {
|
|||
AccountGreetSet { account: String, greet: String },
|
||||
AccountAutoOpSet { account: String, on: bool },
|
||||
AccountKillSet { account: String, on: bool },
|
||||
AccountHideStatusSet { account: String, on: bool },
|
||||
AccountPasswordSet { account: String, scram256: String, scram512: String },
|
||||
AccountDropped { account: String },
|
||||
AccountVerified { account: String },
|
||||
|
|
@ -151,6 +152,7 @@ impl Event {
|
|||
| Event::AccountGreetSet { .. }
|
||||
| Event::AccountAutoOpSet { .. }
|
||||
| Event::AccountKillSet { .. }
|
||||
| Event::AccountHideStatusSet { .. }
|
||||
| Event::AccountPasswordSet { .. }
|
||||
| Event::AccountDropped { .. }
|
||||
| Event::AccountVerified { .. }
|
||||
|
|
@ -287,6 +289,11 @@ pub(crate) fn apply(accounts: &mut HashMap<String, Account>, channels: &mut Hash
|
|||
a.no_protect = !on;
|
||||
}
|
||||
}
|
||||
Event::AccountHideStatusSet { account, on } => {
|
||||
if let Some(a) = accounts.get_mut(&key(&account)) {
|
||||
a.hide_status = 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