chanserv: drop a lost account's channels on takeover

When a registration conflict takes an account name away from this node,
the channels it had registered locally as founder can't transfer to the
name's new owner, so they are dropped (releasing the registered mode) and
the former session is told which were released.
This commit is contained in:
Jean Chevronnet 2026-07-12 13:45:07 +00:00
parent aab64baf86
commit 0681c7a3b2
No known key found for this signature in database
2 changed files with 57 additions and 14 deletions

View file

@ -648,6 +648,15 @@ impl Db {
self.channels.values()
}
/// Names of channels founded by `account` (case-insensitive).
pub fn channels_owned_by(&self, account: &str) -> Vec<String> {
self.channels
.values()
.filter(|c| c.founder.eq_ignore_ascii_case(account))
.map(|c| c.name.clone())
.collect()
}
/// Set the mode-lock (chars to keep set / unset) for a registered channel.
pub fn set_mlock(&mut self, name: &str, on: &str, off: &str) -> Result<(), ChanError> {
let k = key(name);