From 7be9d3c4142b8ef2aea83ab606f3bf2c11fbdb18 Mon Sep 17 00:00:00 2001 From: Lily Date: Sat, 9 Nov 2024 17:40:12 -0800 Subject: [PATCH] Add users to userlist on PRIVMSG event A certain irc server doesn't respond to WHO properly, and we might have missed the join. This means that we might never actually know that that user is in the channel even if they are sending messages. The best fix I could come up with client-side for this is to just add the user to the channel's userlist on a PRIVMSG event. --- data/src/client.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/data/src/client.rs b/data/src/client.rs index 0671686c..8a543806 100644 --- a/data/src/client.rs +++ b/data/src/client.rs @@ -675,6 +675,13 @@ impl Client { } } + // add user to user list if we somehow missed the join + if let Some(channel) = self.chanmap.get_mut(channel) { + if channel.users.take(&user).is_none() { + channel.users.insert(user.clone()); + } + } + // Highlight notification if message::references_user_text(user.nickname(), self.nickname(), text) { return Ok(vec![Event::Notification(