Просмотр исходного кода

* Fixed -NOTICE- *** bug

svn: 1034
Bryan Drewery 22 лет назад
Родитель
Сommit
cb149cd4c7
2 измененных файлов с 6 добавлено и 4 удалено
  1. 1 0
      doc/UPDATES
  2. 5 4
      src/mod/server.mod/servmsg.c

+ 1 - 0
doc/UPDATES

@@ -20,6 +20,7 @@ This is a summary of ChangeLog basically.
 16.Bot specific channels (cmd_botjoin/cmd_botpart)
 16.Bot specific channels (cmd_botjoin/cmd_botpart)
 17.Added CFG: servport.
 17.Added CFG: servport.
 18.Fixed setting ban/invite/exempt on hub, and leafs not setting it.
 18.Fixed setting ban/invite/exempt on hub, and leafs not setting it.
+19.Annoying log -NOTICE- *** should be fixed.
 
 
 1.1.7
 1.1.7
 
 

+ 5 - 4
src/mod/server.mod/servmsg.c

@@ -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);