summaryrefslogtreecommitdiff
path: root/functions.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-05-27 11:09:36 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-05-27 11:09:36 +0100
commitab84512bc06ade328169d38ffb64f3820aa80dc4 (patch)
tree5b42b9ce5bebdb36965261b822bad7cdcb15c7f8 /functions.c
parentff5b7166b8021e4562119852a9682cd09105601f (diff)
Only compare nick instead of full nick!user@host when processing server JOIN/PART/NICK. Also handle the "new" nick already being set in greeting strings during a server NICK if it's changing our nick.
Diffstat (limited to 'functions.c')
-rw-r--r--functions.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/functions.c b/functions.c
index 94c653e..3ca7b06 100644
--- a/functions.c
+++ b/functions.c
@@ -17,6 +17,16 @@ void updategreetingnick(char *greeting, char *greetingnum, char *newnick, char *
ret = strstr(greeting, searchstr);
}
+ // Perhaps the new nick is already present (seen for instance when connecting to another bouncer like Miau)
+ if (ret == NULL) {
+ snprintf(searchstr, MAXDATASIZE, " %s %s ", greetingnum, newnick);
+ ret = strstr(greeting, searchstr);
+ if (ret != NULL) {
+ printf("updategreetingnick(): newnick is already present, returning.\n");
+ return;
+ }
+ }
+
// If ret *still* not found, abandon ship
if (ret == NULL) {
printf("Error updating greeting string, substring not found. Exiting!\n");