Add ChanServ MODE command
MODE <#channel> <modes> lets the founder set channel modes through ChanServ (sourced from ChanServ). The mode string is passed through, so simple modes and masks work; founder-gated.
This commit is contained in:
parent
f15c9998be
commit
dbc45a0b6a
2 changed files with 31 additions and 2 deletions
|
|
@ -968,8 +968,13 @@ mod tests {
|
|||
assert!(out.iter().any(|a| matches!(a, NetAction::ChannelMode { channel, modes, .. } if channel == "#room" && modes == "+rnt-s")), "mlock applied: {out:?}");
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAB", "MLOCK #room"), "+nt-s"));
|
||||
|
||||
// A different, unidentified user cannot set the lock or drop it.
|
||||
// Founder sets modes directly via ChanServ MODE.
|
||||
let out = to_cs(&mut e, "000AAAAAB", "MODE #room +S");
|
||||
assert!(out.iter().any(|a| matches!(a, NetAction::ChannelMode { channel, modes, .. } if channel == "#room" && modes == "+S")), "MODE applies: {out:?}");
|
||||
|
||||
// A different, unidentified user cannot change modes, set the lock, or drop it.
|
||||
e.handle(NetEvent::UserConnect { uid: "000AAAAAC".into(), nick: "bob".into() });
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAC", "MODE #room +i"), "founder"));
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAC", "MLOCK #room +i"), "founder"));
|
||||
assert!(notice(&to_cs(&mut e, "000AAAAAC", "DROP #room"), "founder"));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue