summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blabouncer.c7
-rw-r--r--replay.c3
-rw-r--r--replay.h2
3 files changed, 12 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c
index f250959..0d17468 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -449,6 +449,10 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set
return 1;
}
+ // Announce the start
+ snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :Starting log replay....", ircdstrings->ircnick);
+ sendtoclient(sourcefd, outgoingmsg, clients, settings);
+
// Replay those lines!
for (int i = 0; i < numlines; i++) {
if (!readreplayline(replayseconds, i, outgoingmsg, settings->basedir)) {
@@ -459,6 +463,9 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set
sendtoclient(sourcefd, outgoingmsg, clients, settings);
}
+ // Announce the end
+ snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :Log replay complete.", ircdstrings->ircnick);
+
return 1;
}
diff --git a/replay.c b/replay.c
index a898a7b..abd55c7 100644
--- a/replay.c
+++ b/replay.c
@@ -266,6 +266,9 @@ int writereplayline(char *str, char *basedir) {
// Prepend the unixtime timestamp
snprintf(line, MAXCHAR, "%s %s", timenowstr, str);
+ // Ensure the line finishes with CRLF
+ appendcrlf(line);
+
printf("Complete replay log string to write: '%s', length '%ld'.\n", line, strlen(line));
// Write complete line to file
diff --git a/replay.h b/replay.h
index 983e05b..169f297 100644
--- a/replay.h
+++ b/replay.h
@@ -9,6 +9,8 @@
#include <ctype.h>
#include <limits.h>
+#include "functions.h"
+
#define MAXCHAR 1000
#define TIMELEN 11 // 32-bit unixtime is up to 10 characters (+1 for null char) // TODO - Make this Year 2038 proof
#define TIMELENF 11 // [HH:MM:SS] = 10 characters + 1 for null char