Add NickServ LOGOUT command
Clears the account (RPL_LOGGEDOUT) and renames the user to a configurable guest nick (default Guest) via SVSNICK.
This commit is contained in:
parent
a382ac8ad3
commit
60fc687162
7 changed files with 77 additions and 2 deletions
|
|
@ -54,4 +54,22 @@ impl ServiceCtx {
|
|||
value: account.to_string(),
|
||||
});
|
||||
}
|
||||
|
||||
// Log a user out: clearing the accountname the ircd turns into RPL_LOGGEDOUT
|
||||
// (901) and drops from account-tag / WHOX. The inverse of `login`.
|
||||
pub fn logout(&mut self, uid: &str) {
|
||||
self.actions.push(NetAction::Metadata {
|
||||
target: uid.to_string(),
|
||||
key: "accountname".to_string(),
|
||||
value: String::new(),
|
||||
});
|
||||
}
|
||||
|
||||
// Force a user's nick (SVSNICK), e.g. to a guest nick after logout.
|
||||
pub fn force_nick(&mut self, uid: &str, nick: &str) {
|
||||
self.actions.push(NetAction::ForceNick {
|
||||
uid: uid.to_string(),
|
||||
nick: nick.to_string(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue