summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2024-03-31 22:23:59 +0100
committerLuke Bratch <luke@bratch.co.uk>2024-03-31 22:23:59 +0100
commit33bb47c623d1c605a5a131ef882feb6df42570b7 (patch)
tree22f972d9b6eb586c7492db59c5d9a2b5692e4f39
parent7ac369cbe46739beac37d97642b65b98c46ffc4d (diff)
Don't bother trying to do removenickfromchannel() after a PART or a KICK if we just did removechannel() because the PARTing/KICKed nick was ours.
-rw-r--r--TODO9
-rw-r--r--message.c30
2 files changed, 13 insertions, 26 deletions
diff --git a/TODO b/TODO
index c0000c8..506f977 100644
--- a/TODO
+++ b/TODO
@@ -35,15 +35,6 @@ Debug log ("checking client socket <i> out of <fdmax>") gets busy after fdmax ge
Combine custom BLABOUNCER commands with stdin commands (or ditch stdin?).
-KICK not handled (temporary work in kick-support-20230409.diff)
-KICK:
-Sun Apr 9 03:35:31 2023: BOUNCER-SERVER RECEIVED: ':bbnick!bbuser@2a06:5844:e:551:0:0:0:1d KICK #bla12 bbounce2 :bbnick
-Sun Apr 9 03:35:31 2023: Server KICK: nick is NOT ours ('bbnick' vs 'bbounce2').
-PART:
-Sun Apr 9 04:16:09 2023: BOUNCER-SERVER RECEIVED: ':bbounce2!l_bratch@2a06:5844:e:551:0:0:0:1d PART #bla12 :Leaving
-Sun Apr 9 04:16:09 2023: Server PART: nick is ours ('bbounce2' vs 'bbounce2').
-^^Reminder, joining channels (and getting the nick list) seems to be broken right now (TG reminder).
-
Crash when requesting 30 hour replay.
Users in channel not being populated observed once - 27/07/2023 #pipewire on irc.oftc.net. (and again 14/09/2023)
diff --git a/message.c b/message.c
index 9d85f63..07292be 100644
--- a/message.c
+++ b/message.c
@@ -240,16 +240,14 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
// Just get the nick for comparison
extractnickfromprefix(prefixcopy, 1);
if ((strlen(prefixcopy) == strlen(ircdstate->ircnick)) && (strncmp(prefixcopy, ircdstate->ircnick, strlen(tokens[0])) == 0)) {
- debugprint(DEBUG_FULL, "Server PART: nick is ours ('%s' vs '%s').\n", prefixcopy, ircdstate->ircnick);
+ debugprint(DEBUG_FULL, "Server PART: nick is ours ('%s' vs '%s'), removing channel.\n", prefixcopy, ircdstate->ircnick);
removechannel(channels, ircdstate->maxchannelcount, tokens[2]);
} else {
- debugprint(DEBUG_FULL, "Server PART: nick is NOT ours ('%s' vs '%s').\n", prefixcopy, ircdstate->ircnick);
- }
-
- // Remove the PARTing nick from our local channel struct
- // TODO - don't bother with this if we did removechannel() above?
- if (!removenickfromchannel(tokens[0], tokens[2], channels, ircdstate->maxchannelcount)) {
- debugprint(DEBUG_CRIT, "Failed to remove nick from channel struct.\n");
+ debugprint(DEBUG_FULL, "Server PART: nick is NOT ours ('%s' vs '%s'), removing nick from channel.\n", prefixcopy, ircdstate->ircnick);
+ // Remove the PARTing nick from our local channel struct
+ if (!removenickfromchannel(tokens[0], tokens[2], channels, ircdstate->maxchannelcount)) {
+ debugprint(DEBUG_CRIT, "Failed to remove nick from channel struct.\n");
+ }
}
// And then send to all clients
@@ -276,17 +274,15 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
// If the user being KICKed is us, then we must have left a channel, so remove it from our local channel array.
// (If it's not us, then it's another user being KICKed from a channel, so just pass straight through to letting all our clients know.)
if ((strlen(tokens[3]) == strlen(ircdstate->ircnick)) && (strncmp(tokens[3], ircdstate->ircnick, strlen(tokens[3])) == 0)) {
- debugprint(DEBUG_FULL, "Server KICK: nick is ours ('%s' vs '%s').\n", tokens[3], ircdstate->ircnick);
+ debugprint(DEBUG_FULL, "Server KICK: nick is ours ('%s' vs '%s'), removing channel.\n", tokens[3], ircdstate->ircnick);
removechannel(channels, ircdstate->maxchannelcount, tokens[2]);
} else {
- debugprint(DEBUG_FULL, "Server KICK: nick is NOT ours ('%s' vs '%s').\n", tokens[3], ircdstate->ircnick);
- }
-
- // Remove the KICKed nick from our local channel struct
- // TODO - removenickfromchannel() first argument expects ":nick!user@host" but we're passing "nick" here
- // TODO - don't bother with this if we did removechannel() above?
- if (!removenickfromchannel(tokens[3], tokens[2], channels, ircdstate->maxchannelcount)) {
- debugprint(DEBUG_CRIT, "Server KICK: Failed to remove nick from channel struct.\n");
+ debugprint(DEBUG_FULL, "Server KICK: nick is NOT ours ('%s' vs '%s'), removing nick from channel.\n", tokens[3], ircdstate->ircnick);
+ // Remove the KICKed nick from our local channel struct
+ // TODO - removenickfromchannel() first argument expects ":nick!user@host" but we're passing "nick" here
+ if (!removenickfromchannel(tokens[3], tokens[2], channels, ircdstate->maxchannelcount)) {
+ debugprint(DEBUG_CRIT, "Server KICK: Failed to remove nick from channel struct.\n");
+ }
}
// And then send to all clients