From e546de81cbecac2b02d29a02d6c6fd7d0785d739 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 14 Sep 2019 13:11:20 +0100 Subject: Handle ignoring replay messages from before we launched better to avoid misleading error messages going to clients. --- functions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'functions.c') diff --git a/functions.c b/functions.c index 0a03ca9..af8d5dd 100644 --- a/functions.c +++ b/functions.c @@ -786,7 +786,7 @@ int channelindex(struct channel *channels, char *name) { } // Send the requested number of lines of replay log to the requested client. -// 'sourcefd' is the client to send to, and replayseconds is the number of +// 'sourcefd' is the client to send to, and 'replayseconds' is the number of // seconds of replay log to replay. // Returns 1 for success or 0 for failure. int doreplay(int sourcefd, int replayseconds, struct client *clients, struct settings *settings, struct ircdstate *ircdstate, struct channel *channels) { @@ -811,9 +811,13 @@ 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, ircdstate)) { + int ret = readreplayline(replayseconds, i, outgoingmsg, settings, ircdstate); + if (ret == 0) { debugprint(DEBUG_CRIT, "Error requesting replay line.\n"); return 0; + } else if (ret == -1) { + debugprint(DEBUG_FULL, "doreplay(): readreplayline() said to ignore replay line.\n"); + continue; } // Check if the replay line is a TOPIC, a JOIN, or a PART so we don't -- cgit v1.2.3