Ver Fonte

Properly lookup user when checking noflood() flags

This fixes the bot not already knowing the user for the member, which
can easily be recreated by running .reload
Bryan Drewery há 13 anos atrás
pai
commit
09bf947d8f
2 ficheiros alterados com 5 adições e 2 exclusões
  1. 2 0
      doc/UPDATES
  2. 3 2
      src/mod/irc.mod/irc.c

+ 2 - 0
doc/UPDATES

@@ -1,3 +1,5 @@
+* Really fix CAPS/COLOR flood detection not obeying x|x flags
+
 1.4.1 - http://wraith.botpack.net/milestone/1.4.1
   * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
   * Remove 'chanset +meankicks'. You can customize your kicks in doc/responses.txt and recompile.

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

@@ -122,9 +122,10 @@ detect_offense(memberlist* m, struct chanset_t *chan, char *msg)
       || chan_sentkick(m)) //sanity check
     return 0;
 
+  member_getuser(m, 0);
+
   struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0 };
-  struct userrec *u = m->user ? m->user : get_user_by_host(m->userhost);
-  get_user_flagrec(u, &fr, chan->dname, chan);
+  get_user_flagrec(m->user, &fr, chan->dname, chan);
 
   if (glob_bot(fr) ||
       chk_noflood(fr) ||