From ae1390b2bef4dc6a1a113cddaee37d745b559b1f Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 25 Nov 2022 00:03:17 +0000 Subject: Implement fake QUIT handling via a NOTICE when doing a replay. Since user QUIT messages don't contain channel names, clients that didn't know which channels a nick was in when receiving a quit message for that nick can't show a per-channel QUIT notification. Some clients just display the QUIT message in the server status window, others silently ignore it. Cater for those clients by sending a NOTICE about the QUIT rather than replaying it - assuming the nick isn't still in any of our channels. --- functions.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'functions.h') diff --git a/functions.h b/functions.h index 28b6413..5799aa6 100644 --- a/functions.h +++ b/functions.h @@ -205,6 +205,10 @@ int removenickfromallchannels(char *nickuserhost, struct channel *channels, int // Returns 1 on success or 0 on failure int updatenickinallchannels(char *nickuserhost, char *newnick, struct channel *channels, int maxchannelcount); +// Check if "nick" is in a channel or not. +// Return 1 if it is, or 0 if not. +int isnickinanychannel(struct channel *channels, int maxchannelcount, char *nick); + // Populate our channels struct with all nicks in a RPL_NAMREPLY // Returns 1 on success or 0 on failure int addnamereplytochannel(char *namereply, struct channel *channels, int maxchannelcount); -- cgit v1.2.3