|
@@ -545,7 +545,7 @@ static int gotmsg(char *from, char *msg)
|
|
|
static int gotnotice(char *from, char *msg)
|
|
static int gotnotice(char *from, char *msg)
|
|
|
{
|
|
{
|
|
|
char *to = NULL, *nick = NULL, ctcpbuf[512] = "", *p = NULL, *p1 = NULL, buf[512] = "",
|
|
char *to = NULL, *nick = NULL, ctcpbuf[512] = "", *p = NULL, *p1 = NULL, buf[512] = "",
|
|
|
- *uhost = buf, *ctcp = NULL;
|
|
|
|
|
|
|
+ *uhost = buf, *ctcp = NULL, *ctcpmsg = NULL, *ptr = NULL;
|
|
|
struct userrec *u = NULL;
|
|
struct userrec *u = NULL;
|
|
|
int ignoring;
|
|
int ignoring;
|
|
|
|
|
|
|
@@ -554,7 +554,6 @@ static int gotnotice(char *from, char *msg)
|
|
|
return 0;
|
|
return 0;
|
|
|
ignoring = match_ignore(from);
|
|
ignoring = match_ignore(from);
|
|
|
to = newsplit(&msg);
|
|
to = newsplit(&msg);
|
|
|
-/* FIXME: This fixcolon() breaks the server notice display later */
|
|
|
|
|
fixcolon(msg);
|
|
fixcolon(msg);
|
|
|
strcpy(uhost, from);
|
|
strcpy(uhost, from);
|
|
|
nick = splitnick(&uhost);
|
|
nick = splitnick(&uhost);
|
|
@@ -565,7 +564,8 @@ static int gotnotice(char *from, char *msg)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
/* Check for CTCP: */
|
|
/* Check for CTCP: */
|
|
|
- p = strchr(msg, 1);
|
|
|
|
|
|
|
+ ctcpmsg = ptr = strdup(msg);
|
|
|
|
|
+ p = strchr(ctcpmsg, 1);
|
|
|
while ((p != NULL) && (*p)) {
|
|
while ((p != NULL) && (*p)) {
|
|
|
p++;
|
|
p++;
|
|
|
p1 = p;
|
|
p1 = p;
|
|
@@ -577,7 +577,7 @@ static int gotnotice(char *from, char *msg)
|
|
|
strcpy(p1 - 1, p + 1);
|
|
strcpy(p1 - 1, p + 1);
|
|
|
if (!ignoring)
|
|
if (!ignoring)
|
|
|
detect_flood(nick, uhost, from, FLOOD_CTCP);
|
|
detect_flood(nick, uhost, from, FLOOD_CTCP);
|
|
|
- p = strchr(msg, 1);
|
|
|
|
|
|
|
+ p = strchr(ctcpmsg, 1);
|
|
|
if (ctcp[0] != ' ') {
|
|
if (ctcp[0] != ' ') {
|
|
|
char *code = newsplit(&ctcp);
|
|
char *code = newsplit(&ctcp);
|
|
|
|
|
|
|
@@ -597,6 +597,7 @@ static int gotnotice(char *from, char *msg)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ free(ptr);
|
|
|
if (msg[0]) {
|
|
if (msg[0]) {
|
|
|
if (((to[0] == '$') || strchr(to, '.')) && !ignoring) {
|
|
if (((to[0] == '$') || strchr(to, '.')) && !ignoring) {
|
|
|
detect_flood(nick, uhost, from, FLOOD_NOTICE);
|
|
detect_flood(nick, uhost, from, FLOOD_NOTICE);
|