summaryrefslogtreecommitdiff
path: root/functions.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-09-07 17:25:01 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-09-07 17:25:01 +0100
commit3b836818fe3626798924a56f1660ab5423998094 (patch)
tree3fe8a232fb6539ba881962d1e38a9e858fd654af /functions.c
parent6ae84b9245bfaa832f847a31952b2ae33daf2299 (diff)
Avoid more replay log NICK synchronisation issues by ignoring replay log nick changes from us if not our current nick, and by completely ignoring replaying any type of replay log line from before blabouncer was launched.
Diffstat (limited to 'functions.c')
-rw-r--r--functions.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/functions.c b/functions.c
index bbbd9dd..0a03ca9 100644
--- a/functions.c
+++ b/functions.c
@@ -811,7 +811,7 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set
// Replay those lines!
for (int i = 0; i < numlines; i++) {
- if (!readreplayline(replayseconds, i, outgoingmsg, settings->basedir, settings->replaydates)) {
+ if (!readreplayline(replayseconds, i, outgoingmsg, settings, ircdstate)) {
debugprint(DEBUG_CRIT, "Error requesting replay line.\n");
return 0;
}
@@ -860,6 +860,17 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set
}
}
+ // Separate special check for if a NICK change is from us but it isn't our current nick
+ if (strncmp(tokens[1], "NICK", strlen("NICK")) == 0) {
+ extractnickfromprefix(tokens[0]);
+
+ if (strncmp(tokens[0], ircdstate->ircnick, strlen(tokens[0])) == 0) {
+ debugprint(DEBUG_FULL, "Not sending '%s' replay line '%s'.\n", tokens[1], outgoingmsg);
+ free(strcopyPtr);
+ continue;
+ }
+ }
+
free(strcopyPtr);
debugprint(DEBUG_FULL, "Sending replay line: '%s'.\n", outgoingmsg);