[cvslog] (2008-06-30 18:45:52 UTC) Module eggdrop1.6: Change committed!

cvslog cvs at tsss.org
Mon Jun 30 12:45:52 CST 2008


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2008-06-30 18:45:52 UTC
Commited by: Tothwolf <tothwolf at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 src/mod/irc.mod/irc.c src/mod/irc.mod/mode.c

Log message:

Refactored reset_chan_info() to make it a little easier on maintainers.

Removed a useless '\r' from the dprintf() TOPIC check in reset_chan_info(). This was from the "Request topic on channel reset" patch in 1.6.18, which re-added the TOPIC check that someone needlessly removed in 1.6.7.

got_halfop() was improperly checking !me_op() to see if it should call recheck_channel(). Now it checks !me_halfop() in addition to !me_op()

Removed duplicate code in got_deop() for hidden +v / +h checking. No need to duplicate the entire test, just add 'CHANHALFOP'.

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.657 eggdrop1.6/doc/UPDATES1.6:1.658
--- eggdrop1.6/doc/UPDATES1.6:1.657	Mon Jun 30 11:41:47 2008
+++ eggdrop1.6/doc/UPDATES1.6	Mon Jun 30 13:45:42 2008
@@ -1,4 +1,4 @@
-$Id: UPDATES1.6,v 1.657 2008-06-30 16:41:47 tothwolf Exp $
+$Id: UPDATES1.6,v 1.658 2008-06-30 18:45:42 tothwolf Exp $
 
 Eggdrop Changes (since v1.6.0)
     _____________________________________________________________________
@@ -12,6 +12,17 @@
 
 
   1.6.20:
+    - Refactored reset_chan_info() to make it a little easier on maintainers.
+    - Removed a useless '\r' from the dprintf() TOPIC check in
+      reset_chan_info(). This was from the "Request topic on channel reset"
+      patch in 1.6.18, which re-added the TOPIC check that someone
+      needlessly removed in 1.6.7.
+    - got_halfop() was improperly checking !me_op() to see if it should call
+      recheck_channel(). Now it checks !me_halfop() in addition to !me_op()
+    - Removed duplicate code in got_deop() for hidden +v / +h checking.
+      No need to duplicate the entire test, just add 'CHANHALFOP'.
+    * Patch by: Tothwolf
+
     - set CHAN_PEND when calling refresh_who_chan() to avoid possibly sending
       extra WHO requests to the server if a WHO was already sent.
     * Found by: Tothwolf - Patch by: thommey
Index: eggdrop1.6/src/mod/irc.mod/irc.c
diff -u eggdrop1.6/src/mod/irc.mod/irc.c:1.108 eggdrop1.6/src/mod/irc.mod/irc.c:1.109
--- eggdrop1.6/src/mod/irc.mod/irc.c:1.108	Sun Jun 29 11:39:42 2008
+++ eggdrop1.6/src/mod/irc.mod/irc.c	Mon Jun 30 13:45:42 2008
@@ -2,7 +2,7 @@
  * irc.c -- part of irc.mod
  *   support for channels within the bot
  *
- * $Id: irc.c,v 1.108 2008-06-29 16:39:42 guppy Exp $
+ * $Id: irc.c,v 1.109 2008-06-30 18:45:42 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -414,36 +414,39 @@
  */
 static void reset_chan_info(struct chanset_t *chan)
 {
-  /* Don't reset the channel if we're already resetting it */
+  /* Leave the channel if we aren't supposed to be there */
   if (channel_inactive(chan)) {
     dprintf(DP_MODE, "PART %s\n", chan->name);
     return;
   }
-  if (!channel_pending(chan)) {
-    nfree(chan->channel.key);
-    chan->channel.key = (char *) channel_malloc(1);
-    chan->channel.key[0] = 0;
-    clear_channel(chan, 1);
-    chan->status |= CHAN_PEND;
-    chan->status &= ~(CHAN_ACTIVE | CHAN_ASKEDMODES);
-    if (!(chan->status & CHAN_ASKEDBANS)) {
-      chan->status |= CHAN_ASKEDBANS;
-      dprintf(DP_MODE, "MODE %s +b\n", chan->name);
-    }
-    if (!(chan->ircnet_status & CHAN_ASKED_EXEMPTS) && use_exempts == 1) {
-      chan->ircnet_status |= CHAN_ASKED_EXEMPTS;
-      dprintf(DP_MODE, "MODE %s +e\n", chan->name);
-    }
-    if (!(chan->ircnet_status & CHAN_ASKED_INVITED) && use_invites == 1) {
-      chan->ircnet_status |= CHAN_ASKED_INVITED;
-      dprintf(DP_MODE, "MODE %s +I\n", chan->name);
-    }
-    /* These 2 need to get out asap, so into the mode queue */
-    dprintf(DP_MODE, "MODE %s\n", chan->name);
-    refresh_who_chan(chan->name);
-    /* clear_channel nuked the data...so */
-    dprintf(DP_MODE, "TOPIC %s\r\n", chan->name);
-  }
+
+  /* Don't reset the channel if we're already resetting it */
+  if (channel_pending(chan))
+    return;
+
+  nfree(chan->channel.key);
+  chan->channel.key = (char *) channel_malloc(1);
+  chan->channel.key[0] = 0;
+  clear_channel(chan, 1);
+  chan->status |= CHAN_PEND;
+  chan->status &= ~(CHAN_ACTIVE | CHAN_ASKEDMODES);
+  if (!(chan->status & CHAN_ASKEDBANS)) {
+    chan->status |= CHAN_ASKEDBANS;
+    dprintf(DP_MODE, "MODE %s +b\n", chan->name);
+  }
+  if (!(chan->ircnet_status & CHAN_ASKED_EXEMPTS) && use_exempts == 1) {
+    chan->ircnet_status |= CHAN_ASKED_EXEMPTS;
+    dprintf(DP_MODE, "MODE %s +e\n", chan->name);
+  }
+  if (!(chan->ircnet_status & CHAN_ASKED_INVITED) && use_invites == 1) {
+    chan->ircnet_status |= CHAN_ASKED_INVITED;
+    dprintf(DP_MODE, "MODE %s +I\n", chan->name);
+  }
+  /* These 2 need to get out asap, so into the mode queue */
+  dprintf(DP_MODE, "MODE %s\n", chan->name);
+  refresh_who_chan(chan->name);
+  /* clear_channel nuked the data...so */
+  dprintf(DP_MODE, "TOPIC %s\n", chan->name);
 }
 
 /* Leave the specified channel and notify registered Tcl procs. This
Index: eggdrop1.6/src/mod/irc.mod/mode.c
diff -u eggdrop1.6/src/mod/irc.mod/mode.c:1.85 eggdrop1.6/src/mod/irc.mod/mode.c:1.86
--- eggdrop1.6/src/mod/irc.mod/mode.c:1.85	Mon Jun 30 11:41:47 2008
+++ eggdrop1.6/src/mod/irc.mod/mode.c	Mon Jun 30 13:45:42 2008
@@ -4,7 +4,7 @@
  *   channel mode changes and the bot's reaction to them
  *   setting and getting the current wanted channel modes
  *
- * $Id: mode.c,v 1.85 2008-06-30 16:41:47 tothwolf Exp $
+ * $Id: mode.c,v 1.86 2008-06-30 18:45:42 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -392,6 +392,7 @@
     refresh_who_chan(chan->name);
     return;
   }
+
   /* Did *I* just get opped? */
   if (!me_op(chan) && match_my_nick(who))
     check_chan = 1;
@@ -484,7 +485,9 @@
     refresh_who_chan(chan->name);
     return;
   }
-  if (!me_op(chan) && match_my_nick(who))
+
+  /* Did *I* just get halfopped? */
+  if (!me_op(chan) && !me_halfop(chan) && match_my_nick(who))
     check_chan = 1;
 
   if (!m->user) {
@@ -610,22 +613,20 @@
   if (!nick[0])
     putlog(LOG_MODES, chan->dname, "TS resync (%s): %s deopped by %s",
            chan->dname, who, from);
+
   /* Check for mass deop */
   if (nick[0])
     detect_chan_flood(nick, from, s1, chan, FLOOD_DEOP, who);
-  /* Having op hides your +v and +h  status -- so now that someone's lost ops,
+
+  /* Having op hides your +v and +h status -- so now that someone's lost ops,
    * check to see if they have +v or +h
    */
-  if (!(m->flags & (CHANVOICE | STOPWHO))) {
-    chan->status |= CHAN_PEND;
-    refresh_who_chan(chan->name);
-    m->flags |= STOPWHO;
-  }
-  if (!(m->flags & (CHANHALFOP | STOPWHO))) {
+  if (!(m->flags & (CHANVOICE | CHANHALFOP | STOPWHO))) {
     chan->status |= CHAN_PEND;
     refresh_who_chan(chan->name);
     m->flags |= STOPWHO;
   }
+
   /* Was the bot deopped? */
   if (match_my_nick(who)) {
     /* Cancel any pending kicks and modes */
----------------------- End of diff -----------------------



More information about the Changes mailing list