Set channel mode +r when a channel is registered
ChanServ sends FMODE to mark a registered channel +r (the m_services c_registered mode), and -r on drop. Sourced from our server, which the ircd requires for that mode, with a low TS so it applies to the existing channel.
This commit is contained in:
parent
89593ebeb4
commit
64500906d8
5 changed files with 33 additions and 6 deletions
|
|
@ -922,16 +922,20 @@ mod tests {
|
|||
// Not identified yet: refused.
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAB", "REGISTER #room"), "must be identified"));
|
||||
|
||||
// Identify, then register.
|
||||
// Identify, then register: sets +r on the channel.
|
||||
e.handle(NetEvent::Privmsg { from: "000AAAAAB".into(), to: "42SAAAAAA".into(), text: "IDENTIFY sesame".into() });
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAB", "REGISTER #room"), "now registered"));
|
||||
let out = to_cs(&mut e, "000AAAAAB", "REGISTER #room");
|
||||
assert!(notice(&out, "now registered"));
|
||||
assert!(out.iter().any(|a| matches!(a, NetAction::ChannelMode { channel, modes } if channel == "#room" && modes == "+r")), "register sets +r: {out:?}");
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAB", "INFO #room"), "alice"));
|
||||
|
||||
// A different, unidentified user cannot drop it.
|
||||
e.handle(NetEvent::UserConnect { uid: "000AAAAAC".into(), nick: "bob".into() });
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAC", "DROP #room"), "founder"));
|
||||
|
||||
// The founder can.
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAB", "DROP #room"), "dropped"));
|
||||
// The founder can, which also clears +r.
|
||||
let out = to_cs(&mut e, "000AAAAAB", "DROP #room");
|
||||
assert!(notice(&out, "dropped"));
|
||||
assert!(out.iter().any(|a| matches!(a, NetAction::ChannelMode { channel, modes } if channel == "#room" && modes == "-r")), "drop clears +r: {out:?}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue