Fix ctcp reply so it has a chance to work

This commit is contained in:
Arnaud Cornet 2007-12-11 00:23:49 +01:00
parent 73c4a8f1f1
commit 7c3fc4bc27
1 changed files with 9 additions and 1 deletions

View File

@ -1791,12 +1791,20 @@ static int irc_ctcp(struct link_server *server, struct line *line)
if (line->elemc != 2)
return OK_COPY;
if (!line->origin)
return OK_COPY;
char *nick;
nick = nick_from_ircmask(line->origin);
if (strcmp(line->elemv[1], "\001VERSION\001") == 0) {
WRITE_LINE1(CONN(server), NULL, "NOTICE",
WRITE_LINE2(CONN(server), NULL, "NOTICE", nick,
"\001VERSION bip" BIP_VERSION "\001");
/* change to OK_FORGET, for bip to hide client versions */
free(nick);
return OK_COPY;
}
free(nick);
return OK_COPY;
}