[cvslog] Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Thu Dec 20 11:38:00 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2001-12-20 17:37:30 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

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

Log message:

added my onchanfix patch

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.261 eggdrop1.6/doc/UPDATES1.6:1.262
--- eggdrop1.6/doc/UPDATES1.6:1.261	Thu Dec 20 01:51:26 2001
+++ eggdrop1.6/doc/UPDATES1.6	Thu Dec 20 11:37:19 2001
@@ -1,10 +1,12 @@
-$Id: UPDATES1.6,v 1.261 2001/12/20 07:51:26 guppy Exp $
+$Id: UPDATES1.6,v 1.262 2001/12/20 17:37:19 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
 various   stdarg/   added tcl_traffic (a modified copy of stdarg's original patch)
           guppy/
 Tothwolf  guppy     .servers doesn't trunicate server names anymore
Index: eggdrop1.6/doc/tcl-commands.doc
diff -u eggdrop1.6/doc/tcl-commands.doc:1.61 eggdrop1.6/doc/tcl-commands.doc:1.62
--- eggdrop1.6/doc/tcl-commands.doc:1.61	Thu Dec 20 01:51:26 2001
+++ eggdrop1.6/doc/tcl-commands.doc	Thu Dec 20 11:37:19 2001
@@ -498,9 +498,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.6/src/mod/irc.mod/tclirc.c
diff -u eggdrop1.6/src/mod/irc.mod/tclirc.c:1.26 eggdrop1.6/src/mod/irc.mod/tclirc.c:1.27
--- eggdrop1.6/src/mod/irc.mod/tclirc.c:1.26	Wed Dec 19 00:29:21 2001
+++ eggdrop1.6/src/mod/irc.mod/tclirc.c	Thu Dec 20 11:37:20 2001
@@ -1,7 +1,7 @@
 /*
  * tclirc.c -- part of irc.mod
  *
- * $Id: tclirc.c,v 1.26 2001/12/19 06:29:21 guppy Exp $
+ * $Id: tclirc.c,v 1.27 2001/12/20 17:37:20 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -191,19 +191,28 @@
 
 static int tcl_onchan STDVAR
 {
-  struct chanset_t *chan;
+  struct chanset_t *chan, *thechan = NULL;
 
-  BADARGS(3, 3, " nickname channel");
+  BADARGS(2, 3, " nickname ?channel?");
+  if (argc > 2) {
   chan = findchan_by_dname(argv[2]);
-  if (chan == NULL) {
+    thechan = chan;
+    if (!thechan) {
     Tcl_AppendResult(irp, "illegal channel: ", argv[2], NULL);
     return TCL_ERROR;
   }
-  if (!ismember(chan, argv[1]))
-    Tcl_AppendResult(irp, "0", NULL);
-  else
+  } 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;
+  }
+  Tcl_AppendResult(irp, "0", NULL);
+  return TCL_OK;
 }
 
 static int tcl_handonchan STDVAR
@@ -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 */
   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.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.638 eggdrop1.6/src/patch.h:1.639
--- eggdrop1.6/src/patch.h:1.638	Thu Dec 20 01:51:26 2001
+++ eggdrop1.6/src/patch.h	Thu Dec 20 11:37:19 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.638 2001/12/20 07:51:26 guppy Exp $
+ * $Id: patch.h,v 1.639 2001/12/20 17:37:19 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1008834494");		/* current unixtime */
+patch("1008869718");		/* current unixtime */
 /*
  *
  *
  */
-patch("tcl_traffic");
+patch("onchanfix");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list