diff options
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 10 |
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"); |