[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Wed Dec 19 00:35:20 CST 2001


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

Modified files:
     doc/UPDATES1.6 modules/irc/tclirc.c src/patch.h

Log message:

applied my morespeedyness.diff from eggdrop1.6

---------------------- diff included ----------------------
Index: eggdrop1.7/doc/UPDATES1.6
diff -u eggdrop1.7/doc/UPDATES1.6:1.174 eggdrop1.7/doc/UPDATES1.6:1.175
--- eggdrop1.7/doc/UPDATES1.6:1.174	Wed Dec 19 00:28:02 2001
+++ eggdrop1.7/doc/UPDATES1.6	Wed Dec 19 00:31:45 2001
@@ -1,10 +1,16 @@
-$Id: UPDATES1.6,v 1.174 2001/12/19 06:28:02 guppy Exp $
+$Id: UPDATES1.6,v 1.175 2001/12/19 06:31:45 guppy Exp $
 
 Changes in eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.8
 Found by  Fixed by  What...
+various   guppy     tcl_pushmode now accepts any irc modes instead of the standard ones
+          guppy     made tcl_chanlist (when matching chanflags), tcl_handonchan, and
+                    tcl_nick2hand much faster
+various   guppy     tcl_pushmode now accepts any irc modes instead of the standard ones
+          guppy     made tcl_chanlist (when matching chanflags), tcl_handonchan, and
+                    tcl_nick2hand much faster
           Eule      a bunch of small fixes to gotjoin, gotkick, got367, a
                     modes-per-line calcuation, and to include_lk
 |^Raven^| guppy     made tcl_hand2nick _a lot_ faster
Index: eggdrop1.7/modules/irc/tclirc.c
diff -u eggdrop1.7/modules/irc/tclirc.c:1.4 eggdrop1.7/modules/irc/tclirc.c:1.5
--- eggdrop1.7/modules/irc/tclirc.c:1.4	Wed Dec 19 00:03:29 2001
+++ eggdrop1.7/modules/irc/tclirc.c	Wed Dec 19 00:31:45 2001
@@ -1,7 +1,7 @@
 /*
  * tclirc.c -- part of irc.mod
  *
- * $Id: tclirc.c,v 1.4 2001/12/19 06:03:29 guppy Exp $
+ * $Id: tclirc.c,v 1.5 2001/12/19 06:31:45 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -26,10 +26,8 @@
  */
 static int tcl_chanlist STDVAR
 {
-  char s1[121];
   int f;
   memberlist *m;
-  struct userrec *u;
   struct chanset_t *chan;
   struct flag_record plus = {FR_CHAN | FR_GLOBAL | FR_BOT, 0, 0, 0, 0, 0},
  		     minus = {FR_CHAN | FR_GLOBAL | FR_BOT, 0, 0, 0, 0, 0},
@@ -55,10 +53,9 @@
       !plus.chan && !plus.udef_chan && !plus.bot && !f)
     return TCL_OK;
   minus.match = plus.match ^ (FR_AND | FR_OR);
+
   for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
-    simple_sprintf(s1, "%s!%s", m->nick, m->userhost);
-    u = get_user_by_host(s1);
-    get_user_flagrec(u, &user, argv[1]);
+    get_user_flagrec(m->user, &user, argv[1]);
     user.match = plus.match;
     if (flagrec_eq(&plus, &user)) {
       if (!f || !flagrec_eq(&minus, &user))
@@ -212,7 +209,7 @@
 static int tcl_handonchan STDVAR
 {
   struct chanset_t *chan;
-  struct userrec *u;
+  memberlist *m;
 
   BADARGS(3, 3, " handle channel");
   chan = findchan_by_dname(argv[2]);
@@ -220,11 +217,12 @@
     Tcl_AppendResult(irp, "illegal channel: ", argv[2], NULL);
     return TCL_ERROR;
   }
-  if ((u = get_user_by_handle(userlist, argv[1])))
-    if (hand_on_chan(chan, u)) {
+  for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
+    if (m->user && !rfc_casecmp(m->user->handle, argv[1])) {
       Tcl_AppendResult(irp, "1", NULL);
       return TCL_OK;
     }
+  }
   Tcl_AppendResult(irp, "0", NULL);
   return TCL_OK;
 }
@@ -507,19 +505,6 @@
     mode = plus;
     plus = '+';
   }
-  if (!(((mode >= 'a') && (mode <= 'z')) || ((mode >= 'A') && (mode <= 'Z')))) {
-    Tcl_AppendResult(irp, "invalid mode: ", argv[2], NULL);
-    return TCL_ERROR;
-  }
-  if (argc < 4) {
-    if (strchr("bvoeIk", mode) != NULL) {
-      Tcl_AppendResult(irp, "modes b/v/o/e/I/k/l require an argument", NULL);
-      return TCL_ERROR;
-    } else if (plus == '+' && mode == 'l') {
-      Tcl_AppendResult(irp, "modes b/v/o/e/I/k/l require an argument", NULL);
-      return TCL_ERROR;
-    }
-  }
   if (argc == 4)
     add_mode(chan, plus, mode, argv[3]);
   else
@@ -600,10 +585,7 @@
 static int tcl_hand2nick STDVAR
 {
   memberlist *m;
-  char nuh[161];
   struct chanset_t *chan, *thechan = NULL;
-  struct userrec *u;
-  struct list_type *orig, *q;
 
   BADARGS(2, 3, " handle ?channel?");	/* drummer */
   if (argc > 2) {
@@ -616,23 +598,13 @@
   } else
     chan = chanset;
 
-  u = get_user_by_handle(userlist, argv[1]);
-
-  if (!u)
-    return TCL_OK;
-
-  orig = get_user(&USERENTRY_HOSTS, u);
-
   while (chan && (thechan == NULL || thechan == chan)) {
     for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
-      simple_sprintf(nuh, "%s!%s", m->nick, m->userhost);
-      for (q = orig; q; q = q->next) {
-	if (wild_match(q->extra, nuh)) {
+      if (m->user && !rfc_casecmp(m->user->handle, argv[1])) {
 	  Tcl_AppendResult(irp, m->nick, NULL);
 	  return TCL_OK;
 	}
       }
-    }
     chan = chan->next;
   }
   return TCL_OK;
@@ -641,10 +613,7 @@
 static int tcl_nick2hand STDVAR
 {
   memberlist *m;
-  char s[161];
-  struct chanset_t *chan;
-  struct chanset_t *thechan = NULL;
-  struct userrec *u;
+  struct chanset_t *chan, *thechan = NULL;
 
   BADARGS(2, 3, " nick ?channel?");	/* drummer */
   if (argc > 2) {
@@ -654,20 +623,19 @@
       Tcl_AppendResult(irp, "invalid channel: ", argv[2], NULL);
       return TCL_ERROR;
     }
-  } else {
+  } else
     chan = chanset;
-  }
-  while ((chan != NULL) && ((thechan == NULL) || (thechan == chan))) {
+
+  while (chan && (thechan == NULL || thechan == chan)) {
     m = ismember(chan, argv[1]);
     if (m) {
-      simple_sprintf(s, "%s!%s", m->nick, m->userhost);
-      u = get_user_by_host(s);
-      Tcl_AppendResult(irp, u ? u->handle : "*", NULL);
+      Tcl_AppendResult(irp, m->user ? m->user->handle : "*", NULL);
       return TCL_OK;
     }
     chan = chan->next;
   }
-  return TCL_OK;		/* blank */
+  Tcl_AppendResult(irp, "*", NULL);
+  return TCL_OK;
 }
 
 /* Sends an optimal number of kicks per command (as defined by kick_method)
Index: eggdrop1.7/src/patch.h
diff -u eggdrop1.7/src/patch.h:1.560 eggdrop1.7/src/patch.h:1.561
--- eggdrop1.7/src/patch.h:1.560	Wed Dec 19 00:28:03 2001
+++ eggdrop1.7/src/patch.h	Wed Dec 19 00:31:46 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.560 2001/12/19 06:28:03 guppy Exp $
+ * $Id: patch.h,v 1.561 2001/12/19 06:31:46 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,17 +41,17 @@
  *
  *
  */
-patch("1008743180");		/* current unixtime */
+patch("1008743317");		/* current unixtime */
 /*
  *
  *
  */
-patch("small-fixes");
+patch("morespeedyness");
 /*
  *
  *
  */
-patch("small-fixes");
+patch("morespeedyness");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list