Explorar el Código

* Don't auto add a hostmask if it will conflict with another user

svn: 1575
Bryan Drewery hace 21 años
padre
commit
2ced7095b4
Se han modificado 2 ficheros con 7 adiciones y 3 borrados
  1. 1 0
      doc/UPDATES
  2. 6 3
      src/mod/irc.mod/irc.c

+ 1 - 0
doc/UPDATES

@@ -70,6 +70,7 @@ This is a summary of ChangeLog basically.
 * Recoded and spiffed up cmd_userlist.
 * Recoded and spiffed up cmd_userlist.
 * When connecting with a floodless iline, bot will now dump msgs instead of queueing them to server.
 * When connecting with a floodless iline, bot will now dump msgs instead of queueing them to server.
 * Removed the checks for duplicate msgs in the queue, they're there for a reason. (also is slow)
 * Removed the checks for duplicate msgs in the queue, they're there for a reason. (also is slow)
+* Don't auto add a hostmask that would conflict with another user.
 
 
 1.1.9
 1.1.9
 
 

+ 6 - 3
src/mod/irc.mod/irc.c

@@ -457,14 +457,17 @@ check_hostmask()
     return;
     return;
 
 
   char s[UHOSTLEN + 2] = "", *tmp = botuserhost;
   char s[UHOSTLEN + 2] = "", *tmp = botuserhost;
+  struct userrec *u = NULL;
 
 
   checked_hostmask = 1;
   checked_hostmask = 1;
 
 
   sprintf(s, "*!%s", tmp);		/* just add actual user@ident, regardless of ~ */
   sprintf(s, "*!%s", tmp);		/* just add actual user@ident, regardless of ~ */
 
 
-  for (struct list_type *q = (struct list_type *) get_user(&USERENTRY_HOSTS, conf.bot->u); q; q = q->next) {
-    if (!egg_strcasecmp(q->extra, s))
-      return;
+  /* dont add the host if it conflicts with another in the userlist */
+  if (u = get_user_by_host(s)) {
+    if (u != conf.bot->u)
+      putlog(LOG_WARN, "*", "My automatic hostmask '%s' would conflict with user: '%s'. (Not adding)", s, u->handle);
+    return;
   }
   }
 
 
   addhost_by_handle(conf.bot->nick, s);
   addhost_by_handle(conf.bot->nick, s);