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:
Jean Chevronnet 2026-07-12 08:41:45 +00:00
parent 64500906d8
commit eb22612da8
No known key found for this signature in database
3 changed files with 45 additions and 0 deletions

View file

@ -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:?}"
);
}
}

View file

@ -12,6 +12,9 @@ pub enum NetEvent {
Privmsg { from: String, to: String, text: String },
UserConnect { uid: String, nick: String },
NickChange { uid: String, nick: String },
// A channel was created or bursted (InspIRCd FJOIN). Subsequent single joins
// arrive as IJOIN and are not surfaced.
ChannelCreate { channel: String },
Quit { uid: String },
// An ircd relaying an IRCv3 account-registration request to us as the authority.
AccountRequest { reqid: String, origin: String, kind: String, account: String, p2: String, p3: String },