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:
parent
aab64baf86
commit
0681c7a3b2
2 changed files with 57 additions and 14 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue