invite: route INVITE for a remote target to its server and deliver inbound INVITE

This commit is contained in:
Jean Chevronnet 2026-08-16 19:11:57 +00:00
parent 559a102e48
commit ef84846267
2 changed files with 44 additions and 0 deletions

View file

@ -281,6 +281,18 @@ impl Command for Invite {
return CmdResult::Fail;
}
let Some(tuid) = s.find_nick(tnick) else {
// remote target: route the invite to the server that owns it
if let Some((tuuid, _)) = s.find_remote(tnick) {
let iuuid = s.users[&uid].uuid.clone();
s.route_invite(&iuuid, &tuuid, chan);
let rnick = s
.remote_users
.get(&tuuid)
.map(|r| r.nick.clone())
.unwrap_or_else(|| tnick.to_string());
s.numeric(uid, RPL_INVITING, &format!("{rnick} {chan}"));
return CmdResult::Ok;
}
s.numeric(
uid,
ERR_NOSUCHNICK,