summaryrefslogtreecommitdiff
path: root/message.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-12-22 16:01:16 +0000
committerLuke Bratch <luke@bratch.co.uk>2019-12-22 16:01:16 +0000
commit85dd88a180043e991c19a4c93a6ce5c7fe0a6e88 (patch)
tree2866cf5772eb3e0e2da4be0a86fc5a07b499b174 /message.c
parent2385f7b944bb22acd85e6c089e509880a45a2cb1 (diff)
Make full debug output optional for extractnickfromprefix() and stripprefix() to avoid huge debug logs when using replaymode = "lastspoke" combined with DEBUG_FULL.
Diffstat (limited to 'message.c')
-rw-r--r--message.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/message.c b/message.c
index a2c16e4..8431c31 100644
--- a/message.c
+++ b/message.c
@@ -185,14 +185,14 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
debugprint(DEBUG_FULL, "Server JOIN found and it is: %s with length %zd! Next token is '%s'. Adding to local channel list if it's us.\n", tokens[0], strlen(tokens[0]), tokens[2]);
// Next token should be the channel name but it probably needs the leading ':' stripping
debugprint(DEBUG_FULL, "processircmessage(): Channel name was '%s'\n", tokens[2]);
- stripprefix(tokens[2]);
+ stripprefix(tokens[2], 1);
debugprint(DEBUG_FULL, "processircmessage(): Channel name now '%s'\n", tokens[2]);
// If the user JOINing is us, then we must have joined a channel, so add to our local channel array.
// Copy to a temporary string so we still have the original in case we need it
char *prefixcopy = strdup(tokens[0]);
// Just get the nick for comparison
- extractnickfromprefix(prefixcopy);
+ extractnickfromprefix(prefixcopy, 1);
if (strncmp(prefixcopy, ircdstate->ircnick, strlen(tokens[0])) == 0) {
debugprint(DEBUG_FULL, "Server JOIN: nick is ours ('%s' vs '%s').\n", prefixcopy, ircdstate->ircnick);
// TODO - Saner way to initialise this since we don't have the variables yet?
@@ -233,7 +233,7 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
// Copy to a temporary string so we still have the original in case we need it
char *prefixcopy = strdup(tokens[0]);
// Just get the nick for comparison
- extractnickfromprefix(prefixcopy);
+ extractnickfromprefix(prefixcopy, 1);
if (strncmp(prefixcopy, ircdstate->ircnick, strlen(tokens[0])) == 0) {
debugprint(DEBUG_FULL, "Server PART: nick is ours ('%s' vs '%s').\n", prefixcopy, ircdstate->ircnick);
removechannel(channels, tokens[2]);
@@ -279,7 +279,7 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
if (settings->logging) {
char quitnick[MAXDATASIZE];
strcpy(quitnick, tokens[0]);
- extractnickfromprefix(quitnick);
+ extractnickfromprefix(quitnick, 1);
for (int i = 0; i < MAXCHANNELS; i++) {
if (channels[i].name[0]) {
for (int j = 0; j < MAXCHANNICKS; j++) {
@@ -396,7 +396,7 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
// Extract the topic setter from the prefix (Prefix of ":foo!bar@baz" means "foo" set the topic.)
// Copy to a temporary string so we still have the original in case we need it
char *prefixcopy = strdup(tokens[0]);
- extractnickfromprefix(prefixcopy);
+ extractnickfromprefix(prefixcopy, 1);
// Get the current time and manipulate it into a C string
time_t timenow = time(NULL);
@@ -456,7 +456,7 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
// Copy to a temporary string so we still have the original in case we need it
char *svrprefixcopy = strdup(tokens[0]);
// Just get the nick for comparison
- extractnickfromprefix(svrprefixcopy);
+ extractnickfromprefix(svrprefixcopy, 1);
if (strncmp(ircdstate->ircnick, svrprefixcopy, strlen(ircdstate->ircnick)) == 0) {
debugprint(DEBUG_FULL, "Server NICK: nick is ours ('%s' vs '%s').\n", svrprefixcopy, ircdstate->ircnick);
// Make a copy of the old nickuserhost for updategreetings() below
@@ -468,7 +468,7 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
// Temporary copy of new nickuserhost
char *prefixcopy = strdup(ircdstate->nickuserhost);
// Get nick from it
- extractnickfromprefix(prefixcopy);
+ extractnickfromprefix(prefixcopy, 1);
// Update greeting strings for relaying to new clients
updategreetings(ircdstate->greeting001, ircdstate->greeting002, ircdstate->greeting003, ircdstate->greeting004,
ircdstate->greeting005a, ircdstate->greeting005b, ircdstate->greeting005c, ircdstate->nickuserhost,
@@ -492,7 +492,7 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
if (settings->logging) {
char oldnick[MAXDATASIZE];
strcpy(oldnick, tokens[0]);
- extractnickfromprefix(oldnick);
+ extractnickfromprefix(oldnick, 1);
for (int i = 0; i < MAXCHANNELS; i++) {
if (channels[i].name[0]) {
for (int j = 0; j < MAXCHANNICKS; j++) {