Re-assert +r when a registered channel is created
fedserv now handles FJOIN (channel create/burst) and sets +r on any channel that is registered, so a registered channel regains the mode after it empties and is recreated, and after a services relink. Single joins arrive as IJOIN and are ignored.
This commit is contained in:
parent
64500906d8
commit
eb22612da8
3 changed files with 45 additions and 0 deletions
|
|
@ -90,6 +90,11 @@ impl Protocol for InspIrcd {
|
|||
}
|
||||
_ => vec![],
|
||||
},
|
||||
// FJOIN <chan> <ts> <modes> [params] :<members> — channel create/burst.
|
||||
"FJOIN" => match tokens.next() {
|
||||
Some(chan) if !chan.is_empty() => vec![NetEvent::ChannelCreate { channel: chan.to_string() }],
|
||||
_ => vec![],
|
||||
},
|
||||
"QUIT" => vec![NetEvent::Quit { uid: source.unwrap_or_default() }],
|
||||
// account-registration relay from an ircd:
|
||||
// ACCTREGISTER <reqid> <origin> <kind> <account> <p2> :<p3>
|
||||
|
|
@ -232,4 +237,14 @@ mod tests {
|
|||
"{ev:?}"
|
||||
);
|
||||
}
|
||||
|
||||
// FJOIN (channel create/burst) surfaces as ChannelCreate for the channel.
|
||||
#[test]
|
||||
fn parses_fjoin_as_channel_create() {
|
||||
let ev = proto().parse(":0IR FJOIN #chan 1783845132 +tn :o,0IRAAAAAB:0");
|
||||
assert!(
|
||||
matches!(ev.as_slice(), [NetEvent::ChannelCreate { channel }] if channel == "#chan"),
|
||||
"{ev:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue