chanserv: channel seen checks channel membership, not global presence
All checks were successful
CI / check (push) Successful in 3m45s

This commit is contained in:
Jean Chevronnet 2026-07-17 01:54:55 +00:00
parent 66eb644a07
commit fcca7ac12b
No known key found for this signature in database
2 changed files with 18 additions and 8 deletions

View file

@ -12,7 +12,9 @@ pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, net:
ctx.notice(me, from.uid, "Syntax: SEEN <#channel> <nick>");
return;
};
if net.uid_by_nick(nick).is_some() {
// Present in THIS channel right now — online elsewhere doesn't count.
let here = net.uid_by_nick(nick).is_some_and(|uid| net.channel_members(chan).iter().any(|m| m == uid));
if here {
ctx.notice(me, from.uid, format!("{}: \x02{nick}\x02 is here right now.", from.nick));
return;
}