[cvslog] Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Sun Dec 16 08:57:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2001-12-16 14:56:11 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

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

Log message:

applied Eule's membercheck 2 & 3 patches

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.249 eggdrop1.6/doc/UPDATES1.6:1.250
--- eggdrop1.6/doc/UPDATES1.6:1.249	Sun Dec 16 08:40:17 2001
+++ eggdrop1.6/doc/UPDATES1.6	Sun Dec 16 08:55:59 2001
@@ -1,10 +1,12 @@
-$Id: UPDATES1.6,v 1.249 2001/12/16 14:40:17 guppy Exp $
+$Id: UPDATES1.6,v 1.250 2001/12/16 14:55:59 guppy Exp $
 
 Changes in eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.8
 Found by  Fixed by  What...
+          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
 DFrank    guppy     small make install bug related to doc cleanups
           Wcc       major cleanup of config files and related documents
Index: eggdrop1.6/src/chan.h
diff -u eggdrop1.6/src/chan.h:1.22 eggdrop1.6/src/chan.h:1.23
--- eggdrop1.6/src/chan.h:1.22	Wed Nov 28 17:17:41 2001
+++ eggdrop1.6/src/chan.h	Sun Dec 16 08:55:59 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.22 2001/11/28 23:17:41 guppy Exp $
+ * $Id: chan.h,v 1.23 2001/12/16 14:55:59 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.6/src/cmds.c
diff -u eggdrop1.6/src/cmds.c:1.66 eggdrop1.6/src/cmds.c:1.67
--- eggdrop1.6/src/cmds.c:1.66	Tue Dec  4 13:58:06 2001
+++ eggdrop1.6/src/cmds.c	Sun Dec 16 08:55:59 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.66 2001/12/04 19:58:06 guppy Exp $
+ * $Id: cmds.c,v 1.67 2001/12/16 14:55:59 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1586,7 +1586,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)
     nfree(tmpchg);
@@ -2390,6 +2390,7 @@
   int idx2;
   char *handle;
   struct userrec *u2;
+  module_entry *me;
 
   if (!par[0]) {
     dprintf(idx, "Usage: -user <hand>\n");
@@ -2428,6 +2429,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);
@@ -2501,7 +2507,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);
   }
 }
 
@@ -2510,6 +2516,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, "Usage: -host [handle] <hostmask>\n");
@@ -2558,6 +2565,11 @@
   if (delhost_by_handle(handle, host)) {
     putlog(LOG_CMDS, "*", "#%s# -host %s %s", dcc[idx].nick, handle, host);
     dprintf(idx, "Removed '%s' from %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.6/src/mod/irc.mod/chan.c
diff -u eggdrop1.6/src/mod/irc.mod/chan.c:1.73 eggdrop1.6/src/mod/irc.mod/chan.c:1.74
--- eggdrop1.6/src/mod/irc.mod/chan.c:1.73	Tue Dec  4 13:58:06 2001
+++ eggdrop1.6/src/mod/irc.mod/chan.c	Sun Dec 16 08:56:00 2001
@@ -6,7 +6,7 @@
  *   user kickban, kick, op, deop
  *   idle kicking
  *
- * $Id: chan.c,v 1.73 2001/12/04 19:58:06 guppy Exp $
+ * $Id: chan.c,v 1.74 2001/12/16 14:56:00 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 && !egg_strcasecmp(u->handle, hand)) {
+      if ((u && !egg_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);
       }
@@ -1867,10 +1869,12 @@
   memberlist *m, *mm;
   struct chanset_t *chan;
   struct userrec *u;
+  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
   strcpy(uhost, from);
   nick = splitnick(&uhost);
   fixcolon(msg);
+  clear_chanlist_member(nick);	/* Cache for nick 'nick' is meaningless now. */
   for (chan = chanset; chan; chan = chan->next) { 
     m = ismember(chan, nick);
     if (m) {
@@ -1895,25 +1899,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.6/src/mod/irc.mod/cmdsirc.c
diff -u eggdrop1.6/src/mod/irc.mod/cmdsirc.c:1.27 eggdrop1.6/src/mod/irc.mod/cmdsirc.c:1.28
--- eggdrop1.6/src/mod/irc.mod/cmdsirc.c:1.27	Tue Dec  4 13:58:07 2001
+++ eggdrop1.6/src/mod/irc.mod/cmdsirc.c	Sun Dec 16 08:56:00 2001
@@ -2,7 +2,7 @@
  * chancmds.c -- part of irc.mod
  *   handles commands direclty relating to channel interaction
  *
- * $Id: cmdsirc.c,v 1.27 2001/12/04 19:58:07 guppy Exp $
+ * $Id: cmdsirc.c,v 1.28 2001/12/16 14:56:00 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.6/src/mod/irc.mod/msgcmds.c
diff -u eggdrop1.6/src/mod/irc.mod/msgcmds.c:1.25 eggdrop1.6/src/mod/irc.mod/msgcmds.c:1.26
--- eggdrop1.6/src/mod/irc.mod/msgcmds.c:1.25	Tue Dec  4 13:58:07 2001
+++ eggdrop1.6/src/mod/irc.mod/msgcmds.c	Sun Dec 16 08:56:00 2001
@@ -2,7 +2,7 @@
  * msgcmds.c -- part of irc.mod
  *   all commands entered via /MSG
  *
- * $Id: msgcmds.c,v 1.25 2001/12/04 19:58:07 guppy Exp $
+ * $Id: msgcmds.c,v 1.26 2001/12/16 14:56:00 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -216,7 +216,7 @@
       maskhost(s, s1);
       dprintf(DP_HELP, "NOTICE %s :%s: %s\n", nick, IRC_ADDHOSTMASK, 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, IRC_ADDHOSTMASK, par);
       addhost_by_handle(u->handle, par);
-      check_this_user(u->handle);
+      check_this_user(u->handle, 0, NULL);
       return 1;
     }
   }
Index: eggdrop1.6/src/mod/module.h
diff -u eggdrop1.6/src/mod/module.h:1.54 eggdrop1.6/src/mod/module.h:1.55
--- eggdrop1.6/src/mod/module.h:1.54	Sat Oct 20 14:03:09 2001
+++ eggdrop1.6/src/mod/module.h	Sun Dec 16 08:55:59 2001
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.54 2001/10/20 19:03:09 guppy Exp $
+ * $Id: module.h,v 1.55 2001/12/16 14:55:59 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -437,7 +437,8 @@
 #define str_unescape ((void (*)(char *, register const char))global[264])
 #define egg_strcatn ((int (*)(char *dst, const char *src, size_t max))global[265])
 #define clear_chanlist_member ((void (*)(const char *nick))global[266])
-/* 168 - 271 */
+#define fixfrom ((char *(*)(char *))global[267])
+/* 268 - 271 */
 /* Please don't modify socklist directly, unless there's no other way.
  * Its structure might be changed, or it might be completely removed,
  * so you can't rely on it without a version-check.
Index: eggdrop1.6/src/modules.c
diff -u eggdrop1.6/src/modules.c:1.59 eggdrop1.6/src/modules.c:1.60
--- eggdrop1.6/src/modules.c:1.59	Sun Oct 21 02:06:08 2001
+++ eggdrop1.6/src/modules.c	Sun Dec 16 08:55:59 2001
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.59 2001/10/21 07:06:08 guppy Exp $
+ * $Id: modules.c,v 1.60 2001/12/16 14:55:59 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -528,7 +528,7 @@
   (Function) str_unescape,
   (Function) egg_strcatn,
   (Function) clear_chanlist_member,
-  (Function) 0,
+  (Function) fixfrom,
   /* 268 - 271 */
   (Function) & socklist,	/* sock_list *				*/
   (Function) sockoptions,
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.625 eggdrop1.6/src/patch.h:1.626
--- eggdrop1.6/src/patch.h:1.625	Sun Dec 16 08:40:17 2001
+++ eggdrop1.6/src/patch.h	Sun Dec 16 08:55:59 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.625 2001/12/16 14:40:17 guppy Exp $
+ * $Id: patch.h,v 1.626 2001/12/16 14:55:59 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1008513523");		/* current unixtime */
+patch("1008514418");		/* current unixtime */
 /*
  *
  *
  */
-patch("fakemsg");
+patch("membercheck2patch("membercheck2");3");
 /*
  *
  *
Index: eggdrop1.6/src/proto.h
diff -u eggdrop1.6/src/proto.h:1.46 eggdrop1.6/src/proto.h:1.47
--- eggdrop1.6/src/proto.h:1.46	Sun Sep 23 15:17:47 2001
+++ eggdrop1.6/src/proto.h	Sun Dec 16 08:55:59 2001
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.46 2001/09/23 20:17:47 guppy Exp $
+ * $Id: proto.h,v 1.47 2001/12/16 14:55:59 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -291,6 +291,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.6/src/userrec.c
diff -u eggdrop1.6/src/userrec.c:1.35 eggdrop1.6/src/userrec.c:1.36
--- eggdrop1.6/src/userrec.c:1.35	Sun Oct 14 13:10:31 2001
+++ eggdrop1.6/src/userrec.c	Sun Dec 16 08:55:59 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.35 2001/10/14 18:10:31 poptix Exp $
+ * $Id: userrec.c,v 1.36 2001/12/16 14:55:59 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -172,7 +172,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