[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Sat Dec 29 14:37:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-12-29 20:36:27 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

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

Log message:

added my onchanfix patch from 1.6

---------------------- diff included ----------------------
Index: eggdrop1.7/doc/UPDATES1.6
diff -u eggdrop1.7/doc/UPDATES1.6:1.179 eggdrop1.7/doc/UPDATES1.6:1.180
--- eggdrop1.7/doc/UPDATES1.6:1.179	Fri Dec 28 12:37:13 2001
+++ eggdrop1.7/doc/UPDATES1.6	Sat Dec 29 14:36:16 2001
@@ -1,10 +1,12 @@
-$Id: UPDATES1.6,v 1.179 2001/12/28 18:37:13 guppy Exp $
+$Id: UPDATES1.6,v 1.180 2001/12/29 20:36:16 guppy Exp $
 
 Changes in eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.8
 Found by  Fixed by  What...
+Abraham   guppy     tcl_onchan can now be used without a channel to check all the bot's 
+                    channels
 Tothwolf  guppy     .servers doesn't trunicate server names anymore
 Wcc       guppy     made cmd_modules work locally as well as remotely
           guppy     made show_banner reset the help_subst arguments like show_motd does
Index: eggdrop1.7/doc/tcl-commands.doc
diff -u eggdrop1.7/doc/tcl-commands.doc:1.62 eggdrop1.7/doc/tcl-commands.doc:1.63
--- eggdrop1.7/doc/tcl-commands.doc:1.62	Sat Dec  1 09:44:06 2001
+++ eggdrop1.7/doc/tcl-commands.doc	Sat Dec 29 14:36:16 2001
@@ -500,9 +500,9 @@
     returns: "1" if someone by that nickname is on the channel and has voice
       (+v); "0" otherwise
 
-  onchan <nickname> <channel>
-    returns: "1" if someone by that nickname is on the bot's channel; "0"
-      otherwise
+  onchan <nickname> [channel]
+    returns: "1" if someone by that nickname is on the bot's channel (or 
+      channels if none is specified); "0" otherwise
 
   nick2hand <nickname> [channel]
     returns: handle of <nickname> on <channel>
Index: eggdrop1.7/modules/irc/tclirc.c
diff -u eggdrop1.7/modules/irc/tclirc.c:1.6 eggdrop1.7/modules/irc/tclirc.c:1.7
--- eggdrop1.7/modules/irc/tclirc.c:1.6	Wed Dec 19 22:57:47 2001
+++ eggdrop1.7/modules/irc/tclirc.c	Sat Dec 29 14:36:17 2001
@@ -1,7 +1,7 @@
 /*
  * tclirc.c -- part of irc.mod
  *
- * $Id: tclirc.c,v 1.6 2001/12/20 04:57:47 guppy Exp $
+ * $Id: tclirc.c,v 1.7 2001/12/29 20:36:17 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -191,18 +191,27 @@
 
 static int tcl_onchan STDVAR
 {
-  struct chanset_t *chan;
+  struct chanset_t *chan, *thechan = NULL;
 
-  BADARGS(3, 3, " nickname channel");
-  chan = findchan_by_dname(argv[2]);
-  if (chan == NULL) {
-    Tcl_AppendResult(irp, "illegal channel: ", argv[2], NULL);
-    return TCL_ERROR;
+  BADARGS(2, 3, " nickname ?channel?");
+  if (argc > 2) {
+    chan = findchan_by_dname(argv[2]);
+    thechan = chan;
+    if (!chan) {
+      Tcl_AppendResult(irp, "illegal channel: ", argv[2], NULL);
+      return TCL_ERROR;
+    }
+ } else
+  chan = chanset;
+
+  while (chan && (thechan == NULL || thechan == chan)) {
+    if (ismember(chan, argv[1])) {
+      Tcl_AppendResult(irp, "1", NULL);
+      return TCL_OK;
+    }
+    chan = chan->next;
   }
-  if (!ismember(chan, argv[1]))
-    Tcl_AppendResult(irp, "0", NULL);
-  else
-    Tcl_AppendResult(irp, "1", NULL);
+  Tcl_AppendResult(irp, "0", NULL);
   return TCL_OK;
 }
 
@@ -280,24 +289,27 @@
 
 static int tcl_getchanhost STDVAR
 {
-  struct chanset_t *chan;
-  struct chanset_t *thechan = NULL;
+  struct chanset_t *chan, *thechan = NULL;
   memberlist *m;
 
-  BADARGS(2, 3, " nickname ?channel?");	/* drummer */
+  BADARGS(2, 3, " nickname ?channel?");
   if (argc > 2) {
-    thechan = findchan_by_dname(argv[2]);
+    chan = findchan_by_dname(argv[2]);
+    thechan = chan;
     if (!thechan) {
       Tcl_AppendResult(irp, "illegal channel: ", argv[2], NULL);
       return TCL_ERROR;
     }
-  }
-  for (chan = chanset; chan; chan = chan->next) {
+  } else 
+    chan = chanset;
+
+  while (chan && (thechan == NULL || thechan == chan)) {
     m = ismember(chan, argv[1]);
-    if (m && ((chan == thechan) || (thechan == NULL))) {
+    if (m) {
       Tcl_AppendResult(irp, m->userhost, NULL);
       return TCL_OK;
     }
+    chan = chan->next;
   }
   return TCL_OK;
 }
Index: eggdrop1.7/src/patch.h
diff -u eggdrop1.7/src/patch.h:1.564 eggdrop1.7/src/patch.h:1.565
--- eggdrop1.7/src/patch.h:1.564	Fri Dec 28 12:37:14 2001
+++ eggdrop1.7/src/patch.h	Sat Dec 29 14:36:17 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.564 2001/12/28 18:37:14 guppy Exp $
+ * $Id: patch.h,v 1.565 2001/12/29 20:36:17 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,17 +41,17 @@
  *
  *
  */
-patch("1009564114");		/* current unixtime */
+patch("1009657939");		/* current unixtime */
 /*
  *
  *
  */
-patch("cmd_servers");
+patch("onchanfix");
 /*
  *
  *
  */
-patch("cmd_servers");
+patch("onchanfix");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list