[cvslog] (2005-01-25 18:25:38 UTC) Module eggdrop1.7: Change committed!

cvslog cvs at tsss.org
Tue Jan 25 12:25:38 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2005-01-25 18:25:38 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     src/patch.h src/mod/irc.mod/chan.c

Log message:

- Use CHANMETA to define valid channel prefixes in gotmsg().
* Found by: zathras3 at hotmail.com - Patch by: Wcc

---------------------- diff included ----------------------
Index: eggdrop1.7/src/mod/irc.mod/chan.c
diff -u eggdrop1.7/src/mod/irc.mod/chan.c:1.4 eggdrop1.7/src/mod/irc.mod/chan.c:1.5
--- eggdrop1.7/src/mod/irc.mod/chan.c:1.4	Thu Jan 20 19:43:42 2005
+++ eggdrop1.7/src/mod/irc.mod/chan.c	Tue Jan 25 12:25:28 2005
@@ -6,7 +6,7 @@
  *   user kickban, kick, op, deop
  *   idle kicking
  *
- * $Id: chan.c,v 1.4 2005/01/21 01:43:42 wcc Exp $
+ * $Id: chan.c,v 1.5 2005/01/25 18:25:28 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -2186,26 +2186,29 @@
  */
 static int gotmsg(char *from, char *msg)
 {
-  char *to, *realto, buf[UHOSTLEN], *nick, buf2[512], *uhost = buf;
-  char *p, *p1, *code, *ctcp;
-  int ctcp_count = 0;
+  char *to, *realto, buf[UHOSTLEN], *nick, buf2[512], *uhost = buf, *p, *p1,
+       *code, *ctcp;
+  int ctcp_count = 0, ignoring;
   struct chanset_t *chan;
-  int ignoring;
   struct userrec *u;
   memberlist *m;
   struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
 
-  if (!strchr("&#!+@$", msg[0]))
+  /* Only handle if message is to a channel, or to @#channel. */
+  /* FIXME: Properly handle ovNotices (@+#channel), vNotices (+#channel), etc. */
+  if (!strchr(CHANMETA "@", msg[0]))
     return 0;
-  ignoring = match_ignore(from);
+
   to = newsplit(&msg);
   realto = (to[0] == '@') ? to + 1 : to;
   chan = findchan(realto);
   if (!chan)
-    return 0;                   /* Private msg to an unknown channel?? */
+    return 0; /* Unknown channel; don't process. */
+
   fixcolon(msg);
   strcpy(uhost, from);
   nick = splitnick(&uhost);
+  ignoring = match_ignore(from);
   /* Only check if flood-ctcp is active */
   if (flud_ctcp_thr && detect_avalanche(msg)) {
     u = get_user_by_host(from);
@@ -2220,8 +2223,8 @@
         u_match_mask(chan->exempts, from)))) {
       if (ban_fun) {
         check_exemptlist(chan, from);
-        u_addban(chan, quickban(chan, uhost), botnetnick,
-                 IRC_FUNKICK, now + (60 * chan->ban_time), 0);
+        u_addban(chan, quickban(chan, uhost), botnetnick, IRC_FUNKICK,
+                 now + (60 * chan->ban_time), 0);
       }
       if (kick_fun) {
         /* This can induce kickflood - arthur2 */
@@ -2255,8 +2258,7 @@
       ctcp = buf2;
       strcpy(ctcp, p1);
       strcpy(p1 - 1, p + 1);
-      detect_chan_flood(nick, uhost, from, chan,
-                        strncmp(ctcp, "ACTION ", 7) ?
+      detect_chan_flood(nick, uhost, from, chan, strncmp(ctcp, "ACTION ", 7) ?
                         FLOOD_CTCP : FLOOD_PRIVMSG, NULL);
 
       chan = findchan(realto);
@@ -2272,7 +2274,6 @@
           u = get_user_by_host(from);
           if (!ignoring || trigger_on_ignore) {
             if (!check_tcl_ctcp(nick, uhost, u, to, code, ctcp)) {
-
               chan = findchan(realto);
               if (!chan)
                 return 0;
@@ -2294,7 +2295,8 @@
       }
     }
   }
-  /* Send out possible ctcp responses */
+
+  /* Send out possible ctcp responses. */
   if (ctcp_reply[0]) {
     if (ctcp_mode != 2) {
       dprintf(DP_HELP, "NOTICE %s :%s\n", nick, ctcp_reply);
@@ -2309,6 +2311,7 @@
       last_ctcp = now;
     }
   }
+
   if (msg[0]) {
     /* Check even if we're ignoring the host. (modified by Eule 17.7.99) */
     detect_chan_flood(nick, uhost, from, chan, FLOOD_PRIVMSG, NULL);
Index: eggdrop1.7/src/patch.h
diff -u eggdrop1.7/src/patch.h:1.25 eggdrop1.7/src/patch.h:1.26
--- eggdrop1.7/src/patch.h:1.25	Tue Jan 25 11:36:19 2005
+++ eggdrop1.7/src/patch.h	Tue Jan 25 12:25:28 2005
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.25 2005/01/25 17:36:19 wcc Exp $
+ * $Id: patch.h,v 1.26 2005/01/25 18:25:28 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1106674604");            /* current unixtime */
+patch("1106677559");            /* current unixtime */
 /*
  *
  *
  */
-patch("long-udef");
+patch("gotmsg-CHANMETA");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list