From 179762e8fdf9335909a274e5754767831e3f6288 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 19 May 2019 18:52:23 +0100 Subject: Enable replay logging and replaying of JOINs, PARTs, and TOPIC sets. --- blabouncer.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3