fix parsing of JOIN messages for certain servers, thanks van Kanakarakis

This commit is contained in:
Nico Golde 2012-06-28 15:41:57 +02:00
parent 9a0ea4ada1
commit a5a7d1b376
2 changed files with 5 additions and 7 deletions

View File

@ -2,6 +2,8 @@
- -k now specifies an environment variable that contains the
server key. This behaviour has been changed in order to not
expose the password in the process list.
- Fix parsing of JOIN messages for certain servers.
Thanks Ivan Kanakarakis!
1.6 (2011-01-31):
- fix regression introduced for handling unknown commands

10
ii.c
View File

@ -347,13 +347,9 @@ static void proc_server_cmd(char *buf) {
} else if(!strncmp("ERROR", argv[TOK_CMD], 6))
snprintf(message, PIPE_BUF, "-!- error %s", argv[TOK_TEXT] ? argv[TOK_TEXT] : "unknown");
else if(!strncmp("JOIN", argv[TOK_CMD], 5)) {
if(argv[TOK_TEXT] != NULL){
p = strchr(argv[TOK_TEXT], ' ');
if(p)
*p = 0;
}
argv[TOK_CHAN] = argv[TOK_TEXT];
snprintf(message, PIPE_BUF, "-!- %s(%s) has joined %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT]);
if (argv[TOK_TEXT] != NULL)
argv[TOK_CHAN] = argv[TOK_TEXT];
snprintf(message, PIPE_BUF, "-!- %s(%s) has joined %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
} else if(!strncmp("PART", argv[TOK_CMD], 5)) {
snprintf(message, PIPE_BUF, "-!- %s(%s) has left %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
} else if(!strncmp("MODE", argv[TOK_CMD], 5))