engine: reintroduce a killed service agent
All checks were successful
CI / check (push) Successful in 3m46s
All checks were successful
CI / check (push) Successful in 3m46s
A KILL of a services pseudo-client only reintroduced BotServ bots; a killed core agent (NickServ, ChanServ, …) fell through to the forget-user path and stayed off the network until a services restart. UserKilled now recognises an agent by its fixed uid and re-emits its introduction, so an oper can't KILL services down.
This commit is contained in:
parent
4aff734340
commit
e5e04b4130
2 changed files with 21 additions and 0 deletions
|
|
@ -1044,6 +1044,17 @@ impl Engine {
|
|||
Vec::new()
|
||||
}
|
||||
NetEvent::UserKilled { uid } => {
|
||||
// A killed service agent (NickServ, ChanServ, …) has a fixed uid;
|
||||
// bring it straight back so an oper can't KILL it off the network.
|
||||
if let Some(intro) = self.services.iter().find(|s| s.uid() == uid).map(|s| NetAction::IntroduceUser {
|
||||
uid: s.uid().to_string(),
|
||||
nick: s.nick().to_string(),
|
||||
ident: "services".to_string(),
|
||||
host: s.host().to_string(),
|
||||
gecos: s.gecos().to_string(),
|
||||
}) {
|
||||
return vec![intro];
|
||||
}
|
||||
// If the ircd killed one of our bots, forget it so reconcile
|
||||
// reintroduces it (and rejoins its channels); a killed real user is
|
||||
// simply gone.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue