[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Wed Dec 19 00:26:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-12-19 06:25:19 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 lib/eggdrop/module.h modules/irc/chan.c
     modules/irc/cmdsirc.c modules/irc/msgcmds.c src/chan.h src/cmds.c
     src/modules.c src/patch.h src/proto.h src/userrec.c

Log message:

added Eule's membercheck 2 and 3 patches from eggdrop1.6 (Eule can you please check these over as the diff seemed to fail alot and I had to manually patch it)

---------------------- diff included ----------------------
Index: eggdrop1.7/doc/UPDATES1.6
diff -u eggdrop1.7/doc/UPDATES1.6:1.172 eggdrop1.7/doc/UPDATES1.6:1.173
--- eggdrop1.7/doc/UPDATES1.6:1.172	Wed Dec 19 00:03:29 2001
+++ eggdrop1.7/doc/UPDATES1.6	Wed Dec 19 00:25:08 2001
@@ -1,4 +1,4 @@
-$Id: UPDATES1.6,v 1.172 2001/12/19 06:03:29 guppy Exp $
+$Id: UPDATES1.6,v 1.173 2001/12/19 06:25:08 guppy Exp $
 
 Changes in eggdrop: (since v1.6.0)
 ----------------------------------
@@ -6,6 +6,8 @@
 1.6.8
 Found by  Fixed by  What...
 |^Raven^| guppy     made tcl_hand2nick _a lot_ faster
+          Eule      more membercheck fixes for nick bans, nick +k users, -user, and
+                    -host.
           BarkerJr  only show fake alerts once every 10 seconds to prevent flooding
           BarkerJr  updated doc/MODULES a bit
 RandomAPB Wcc       show the user port as users instead of telnet and the bot port
Index: eggdrop1.7/lib/eggdrop/module.h
diff -u eggdrop1.7/lib/eggdrop/module.h:1.7 eggdrop1.7/lib/eggdrop/module.h:1.8
--- eggdrop1.7/lib/eggdrop/module.h:1.7	Tue Dec 18 01:04:21 2001
+++ eggdrop1.7/lib/eggdrop/module.h	Wed Dec 19 00:25:08 2001
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.7 2001/12/18 07:04:21 guppy Exp $
+ * $Id: module.h,v 1.8 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -378,7 +378,7 @@
 /* #define memset ((void *(*)(void *, int, size_t))global[254]) */
 /* #define strcasecmp ((int (*)(const char *, const char *))global[255]) */
 /* 256 - 259 */
-/* #define strncasecmp ((int (*)(const char *, const char *, size_t))global[256]) */
+#define fixfrom ((char *(*)(char *))global[256])
 #define is_file ((int (*)(const char *))global[257])
 /* #define must_be_owner (*(int *)(global[258])) */
 #define tandbot (*(tand_t **)(global[259]))
Index: eggdrop1.7/modules/irc/chan.c
diff -u eggdrop1.7/modules/irc/chan.c:1.5 eggdrop1.7/modules/irc/chan.c:1.6
--- eggdrop1.7/modules/irc/chan.c:1.5	Sun Dec  9 20:50:55 2001
+++ eggdrop1.7/modules/irc/chan.c	Wed Dec 19 00:25:08 2001
@@ -6,7 +6,7 @@
  *   user kickban, kick, op, deop
  *   idle kicking
  *
- * $Id: chan.c,v 1.5 2001/12/10 02:50:55 guppy Exp $
+ * $Id: chan.c,v 1.6 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -763,7 +763,7 @@
   }
 }
 
-static void check_this_user(char *hand)
+static void check_this_user(char *hand, int delete, char *host)
 {
   char s[UHOSTLEN];
   memberlist *m;
@@ -775,7 +775,9 @@
     for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
       sprintf(s, "%s!%s", m->nick, m->userhost);
       u = m->user ? m->user : get_user_by_host(s);
-      if (u && !strcasecmp(u->handle, hand)) {
+      if ((u && !strcasecmp(u->handle, hand) && delete < 2) ||
+	  (!u && delete == 2 && wild_match(host, fixfrom(s)))) {
+        u = delete ? NULL : u;
 	get_user_flagrec(u, &fr, chan->dname);
 	check_this_member(chan, m->nick, &fr);
       }
@@ -1860,11 +1862,13 @@
   memberlist *m, *mm;
   struct chanset_t *chan;
   struct userrec *u;
+  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
   fixcolon(msg);
   strncpyz(buf, from, sizeof buf);
   nick = strtok(buf, "!");
   uhost = strtok(NULL, "!");
+  clear_chanlist_member(nick);	/* Cache for nick 'nick' is meaningless now. */
   for (chan = chanset; chan; chan = chan->next) { 
     m = ismember(chan, nick);
     if (m) {
@@ -1889,25 +1893,23 @@
        */
       /* Compose a nick!user at host for the new nick */
       sprintf(s1, "%s!%s", msg, uhost);
-      /* Enforcing bans & haven't already kicked them? */
-      if (channel_enforcebans(chan) && chan_sentkick(m) &&
-	  (u_match_mask(global_bans, s1) ||
-	   u_match_mask(chan->bans, s1)) &&
-	  !(use_exempts &&
-	   (u_match_mask(global_exempts,s1) ||
-	    u_match_mask(chan->exempts, s1))))
-	refresh_ban_kick(chan, s1, msg);
       strcpy(m->nick, msg);
       detect_chan_flood(msg, uhost, from, chan, FLOOD_NICK, NULL);
       /* Any pending kick to the old nick is lost. Ernst 18/3/1998 */
-      if (chan_sentkick(m))
+      if (chan_sentkick(m)) {
 	m->flags &= ~SENTKICK;
+	m->flags |= STOPCHECK;
+      }
+      /* nick-ban or nick is +k or something? */
+      if (!chan_stopcheck(m)) {
+	get_user_flagrec(m->user ? m->user : get_user_by_host(s1), &fr, chan->dname);
+	check_this_member(chan, m->nick, &fr);
+      }
       u = get_user_by_host(from); /* make sure this is in the loop, someone could have changed the record
                                      in an earlier iteration of the loop */
       check_tcl_nick(nick, uhost, u, chan->dname, msg);
     }
   }
-  clear_chanlist_member(msg);	/* Cache for nick 'msg' is meaningless now. */
   return 0;
 }
 
Index: eggdrop1.7/modules/irc/cmdsirc.c
diff -u eggdrop1.7/modules/irc/cmdsirc.c:1.2 eggdrop1.7/modules/irc/cmdsirc.c:1.3
--- eggdrop1.7/modules/irc/cmdsirc.c:1.2	Sat Dec  8 13:17:43 2001
+++ eggdrop1.7/modules/irc/cmdsirc.c	Wed Dec 19 00:25:08 2001
@@ -2,7 +2,7 @@
  * chancmds.c -- part of irc.mod
  *   handles commands direclty relating to channel interaction
  *
- * $Id: cmdsirc.c,v 1.2 2001/12/08 19:17:43 ite Exp $
+ * $Id: cmdsirc.c,v 1.3 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -868,7 +868,7 @@
     dprintf(idx, "Added hostmask %s to %s.\n", p1, u->handle);
     addhost_by_handle(hand, p1);
     get_user_flagrec(u, &user, chan->dname);
-    check_this_user(hand);
+    check_this_user(hand, 0, NULL);
   }
   putlog(LOG_CMDS, "*", "#%s# adduser %s %s", dcc[idx].nick, nick,
 	 hand == nick ? "" : hand);
Index: eggdrop1.7/modules/irc/msgcmds.c
diff -u eggdrop1.7/modules/irc/msgcmds.c:1.2 eggdrop1.7/modules/irc/msgcmds.c:1.3
--- eggdrop1.7/modules/irc/msgcmds.c:1.2	Sat Dec  8 13:17:43 2001
+++ eggdrop1.7/modules/irc/msgcmds.c	Wed Dec 19 00:25:08 2001
@@ -2,7 +2,7 @@
  * msgcmds.c -- part of irc.mod
  *   all commands entered via /MSG
  *
- * $Id: msgcmds.c,v 1.2 2001/12/08 19:17:43 ite Exp $
+ * $Id: msgcmds.c,v 1.3 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -216,7 +216,7 @@
       maskhost(s, s1);
       dprintf(DP_HELP, "NOTICE %s :%s: %s\n", nick, _("Added hostmask"), s1);
       addhost_by_handle(who, s1);
-      check_this_user(who);
+      check_this_user(who, 0, NULL);
       return 1;
     }
   }
@@ -256,7 +256,7 @@
       putlog(LOG_CMDS, "*", "(%s!%s) !*! ADDHOST %s", nick, host, par);
       dprintf(DP_HELP, "NOTICE %s :%s: %s\n", nick, _("Added hostmask"), par);
       addhost_by_handle(u->handle, par);
-      check_this_user(u->handle);
+      check_this_user(u->handle, 0, NULL);
       return 1;
     }
   }
Index: eggdrop1.7/src/chan.h
diff -u eggdrop1.7/src/chan.h:1.25 eggdrop1.7/src/chan.h:1.26
--- eggdrop1.7/src/chan.h:1.25	Sat Dec  1 11:35:06 2001
+++ eggdrop1.7/src/chan.h	Wed Dec 19 00:25:08 2001
@@ -3,7 +3,7 @@
  *   stuff common to chan.c and mode.c
  *   users.h needs to be loaded too
  *
- * $Id: chan.h,v 1.25 2001/12/01 17:35:06 ite Exp $
+ * $Id: chan.h,v 1.26 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -56,6 +56,7 @@
 #define WASOP       0x0100	/* was an op before a split		*/
 #define STOPWHO     0x0200
 #define FULL_DELAY  0x0400
+#define STOPCHECK   0x0800
 
 #define chan_hasvoice(x) (x->flags & CHANVOICE)
 #define chan_hasop(x) (x->flags & CHANOP)
@@ -67,6 +68,7 @@
 #define chan_sentdevoice(x) (x->flags & SENTDEVOICE)
 #define chan_issplit(x) (x->split > 0)
 #define chan_wasop(x) (x->flags & WASOP)
+#define chan_stopcheck(x) (x->flags & STOPCHECK)
 
 /* Why duplicate this struct for exempts and invites only under another
  * name? <cybah>
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.81 eggdrop1.7/src/cmds.c:1.82
--- eggdrop1.7/src/cmds.c:1.81	Sun Dec  9 21:22:29 2001
+++ eggdrop1.7/src/cmds.c	Wed Dec 19 00:25:08 2001
@@ -3,7 +3,7 @@
  *   commands from a user via dcc
  *   (split in 2, this portion contains no-irc commands)
  *
- * $Id: cmds.c,v 1.81 2001/12/10 03:22:29 guppy Exp $
+ * $Id: cmds.c,v 1.82 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1613,7 +1613,7 @@
   if (chg && (me = module_find("irc", 0, 0))) {
     Function *func = me->funcs;
     
-    (func[IRC_CHECK_THIS_USER]) (hand);
+    (func[IRC_CHECK_THIS_USER]) (hand, 0, NULL);
   }
   if (tmpchg)
     free(tmpchg);
@@ -2416,6 +2416,7 @@
   int idx2;
   char *handle;
   struct userrec *u2;
+  module_entry *me;
 
   if (!par[0]) {
     dprintf(idx, "Usage: -user <hand>\n");
@@ -2454,6 +2455,11 @@
     dprintf(idx, "Can't remove users who aren't bots!\n");
     return;
   }
+  if ((me = module_find("irc", 0, 0))) {
+    Function *func = me->funcs;
+
+   (func[IRC_CHECK_THIS_USER]) (handle, 1, NULL);
+  }
   if (deluser(handle)) {
     putlog(LOG_CMDS, "*", "#%s# -user %s", dcc[idx].nick, handle);
     dprintf(idx, "Deleted %s.\n", handle);
@@ -2527,7 +2533,7 @@
   if ((me = module_find("irc", 0, 0))) {
     Function *func = me->funcs;
 
-    (func[IRC_CHECK_THIS_USER]) (handle);
+    (func[IRC_CHECK_THIS_USER]) (handle, 0, NULL);
   }
 }
 
@@ -2536,6 +2542,7 @@
   char *handle, *host;
   struct userrec *u2;
   struct flag_record fr = {FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
+  module_entry *me;
 
   if (!par[0]) {
     dprintf(idx, "%s: -host [%s] <%s>\n", _("Usage"), _("handle"), 
@@ -2585,6 +2592,11 @@
   if (delhost_by_handle(handle, host)) {
     putlog(LOG_CMDS, "*", "#%s# -host %s %s", dcc[idx].nick, handle, host);
     dprintf(idx, _("Removed '%1$s' from %2$s\n"), host, handle);
+    if ((me = module_find("irc", 0, 0))) {
+      Function *func = me->funcs;
+
+      (func[IRC_CHECK_THIS_USER]) (handle, 2, host);
+    }
   } else
     dprintf(idx, _("Failed.\n"));
 }
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.90 eggdrop1.7/src/modules.c:1.91
--- eggdrop1.7/src/modules.c:1.90	Tue Dec 18 01:04:21 2001
+++ eggdrop1.7/src/modules.c	Wed Dec 19 00:25:08 2001
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.90 2001/12/18 07:04:21 guppy Exp $
+ * $Id: modules.c,v 1.91 2001/12/19 06:25:08 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -458,7 +458,7 @@
   (Function) 0,			/* memset				*/
   (Function) 0,			/* strcasecmp				*/
   /* 256 - 259 */
-  (Function) 0,			/* strncasecmp				*/
+  (Function) fixfrom,
   (Function) is_file,
   (Function) 0,
   (Function) & tandbot,		/* tand_t *				*/
Index: eggdrop1.7/src/patch.h
diff -u eggdrop1.7/src/patch.h:1.558 eggdrop1.7/src/patch.h:1.559
--- eggdrop1.7/src/patch.h:1.558	Wed Dec 19 00:03:30 2001
+++ eggdrop1.7/src/patch.h	Wed Dec 19 00:25:08 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.558 2001/12/19 06:03:30 guppy Exp $
+ * $Id: patch.h,v 1.559 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,17 +41,17 @@
  *
  *
  */
-patch("1008741691");		/* current unixtime */
+patch("1008742958");		/* current unixtime */
 /*
  *
  *
  */
-patch("speedyhand2nick");
+patch("membercheck2and3");
 /*
  *
  *
  */
-patch("speedyhand2nick");
+patch("membercheck2and3");
 /*
  *
  *
Index: eggdrop1.7/src/proto.h
diff -u eggdrop1.7/src/proto.h:1.59 eggdrop1.7/src/proto.h:1.60
--- eggdrop1.7/src/proto.h:1.59	Tue Dec 18 01:04:22 2001
+++ eggdrop1.7/src/proto.h	Wed Dec 19 00:25:08 2001
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.59 2001/12/18 07:04:22 guppy Exp $
+ * $Id: proto.h,v 1.60 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -261,6 +261,7 @@
 struct userrec *check_dcclist_hand(char *);
 void touch_laston(struct userrec *, char *, time_t);
 void user_del_chan(char *);
+char *fixfrom(char *);
 
 /* users.c */
 void addignore(char *, char *, char *, time_t);
Index: eggdrop1.7/src/userrec.c
diff -u eggdrop1.7/src/userrec.c:1.38 eggdrop1.7/src/userrec.c:1.39
--- eggdrop1.7/src/userrec.c:1.38	Thu Oct 18 20:55:05 2001
+++ eggdrop1.7/src/userrec.c	Wed Dec 19 00:25:08 2001
@@ -4,7 +4,7 @@
  *   a bunch of functions to find and change user records
  *   change and check user (and channel-specific) flags
  *
- * $Id: userrec.c,v 1.38 2001/10/19 01:55:05 tothwolf Exp $
+ * $Id: userrec.c,v 1.39 2001/12/19 06:25:08 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -66,7 +66,7 @@
 /* Convert "nick!~user at host", "nick!+user at host" and "nick!-user at host"
  * to "nick!user at host" if necessary. (drummer)
  */
-static char *fixfrom(char *s)
+char *fixfrom(char *s)
 {
   char *p;
   static char buf[512];
----------------------- End of diff -----------------------



More information about the Changes mailing list