summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-05-19 18:52:23 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-05-19 18:52:23 +0100
commit179762e8fdf9335909a274e5754767831e3f6288 (patch)
treecd08cb63cec6c7832c3323687c8b8fd285d3ea45
parentf767fc29fb0c192d20308a09aaa18918ac8a0875 (diff)
Enable replay logging and replaying of JOINs, PARTs, and TOPIC sets.
-rw-r--r--blabouncer.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/blabouncer.c b/blabouncer.c
index 859d3af..0e9fda8 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -1,6 +1,5 @@
// TODO:
// - Perhaps rename clients.ssl and server_ssl since they may not even be OpenSSL sockets
-// - Is it possible to replay JOINs/PARTs?
// - Move debug output into some debug function
// "server" means the real IRC server
@@ -665,6 +664,11 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
createchannel(channels, tokens[2], "TOPIC", "TOPICWHO", "0");
}
+ // Write to replay log if replay logging enabled
+ if (settings->replaylogging) {
+ writereplayline(str, settings->basedir);
+ }
+
// Write to normal log if logging enabled
if (settings->logging) {
logline(str, settings->ircnick, settings->basedir, LOG_JOINPART);
@@ -690,6 +694,11 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
removechannel(channels, tokens[2]);
}
+ // Write to replay log if replay logging enabled
+ if (settings->replaylogging) {
+ writereplayline(str, settings->basedir);
+ }
+
// Write to normal log if logging enabled
if (settings->logging) {
logline(str, settings->ircnick, settings->basedir, LOG_JOINPART);
@@ -802,6 +811,11 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
// And then finally relay to all clients
sendtoallclients(clients, str, sourcefd, settings);
+ // Write to replay log if replay logging enabled
+ if (settings->replaylogging) {
+ writereplayline(str, settings->basedir);
+ }
+
// Write to normal log if logging enabled
if (settings->logging) {
logline(str, settings->ircnick, settings->basedir, LOG_TOPIC);