[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Sep 27 13:34:00 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-09-27 18:33:31 UTC
Commited by: Teemu Hjelt <sup at techmonkeys.org>

Modified files:
     src/mod/irc.mod/irc.c src/mod/irc.mod/msgcmds.c

Log message:

Removed the GO command again and readded need-cycle

---------------------- diff included ----------------------
Index: eggdrop1.7/src/mod/irc.mod/irc.c
diff -u eggdrop1.7/src/mod/irc.mod/irc.c:1.60 eggdrop1.7/src/mod/irc.mod/irc.c:1.61
--- eggdrop1.7/src/mod/irc.mod/irc.c:1.60	Mon Aug 27 18:31:17 2001
+++ eggdrop1.7/src/mod/irc.mod/irc.c	Thu Sep 27 13:33:21 2001
@@ -2,7 +2,7 @@
  * irc.c -- part of irc.mod
  *   support for channels within the bot
  *
- * $Id: irc.c,v 1.60 2001/08/27 23:31:17 poptix Exp $
+ * $Id: irc.c,v 1.61 2001/09/27 18:33:21 sup Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -508,15 +508,13 @@
 }
 
 /* If i'm the only person on the channel, and i'm not op'd,
- * might as well leave and rejoin. If i'm NOT the only person
- * on the channel, but i'm still not op'd, demand ops.
+ * might as well leave and rejoin.
  */
 static void check_lonely_channel(struct chanset_t *chan)
 {
   memberlist *m;
   char s[UHOSTLEN];
   int i = 0;
-  static int whined = 0;
 
   if (channel_pending(chan) || !channel_active(chan) || me_op(chan) ||
       channel_inactive(chan) || (chan->channel.mode & CHANANON))
@@ -525,51 +523,14 @@
   for (m = chan->channel.member; m && m->nick[0]; m = m->next)
     if (!chan_issplit(m))
       i++;
-  if (i == 1 && channel_cycle(chan) && !channel_stop_cycle(chan)) {
-    if (chan->name[0] != '+') {	/* Its pointless to cycle + chans for ops */
-      putlog(LOG_MISC, "*", "Trying to cycle %s to regain ops.", chan->dname);
-      dprintf(DP_MODE, "PART %s\n", chan->name);
-      /* If it's a !chan, we need to recreate the channel with !!chan <cybah> */
-      dprintf(DP_MODE, "JOIN %s%s %s\n", (chan->dname[0] == '!') ? "!" : "",
-	      chan->dname, chan->key_prot);
-      whined = 0;
-    }
-  } else if (any_ops(chan)) {
-    whined = 0;
-    check_tcl_need(chan->dname, "op");
-  } else {
-    /* Other people here, but none are ops. If there are other bots make
-     * them LEAVE!
-     */
-    int ok = 1;
-    struct userrec *u;
-
-    if (!whined) {
-      /* + is opless. Complaining about no ops when without special
-       * help(services), we cant get them - Raist
-       */
-      if (chan->name[0] != '+')
-	putlog(LOG_MISC, "*", "%s is active but has no ops :(", chan->dname);
-      whined = 1;
-    }
-    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
-      sprintf(s, "%s!%s", m->nick, m->userhost);
-      u = get_user_by_host(s);
-      if (!match_my_nick(m->nick) && (!u || !(u->flags & USER_BOT))) {
-	ok = 0;
-	break;
-      }
-    }
-    if (ok) {
-      /* ALL bots!  make them LEAVE!!! */
-      for (m = chan->channel.member; m && m->nick[0]; m = m->next)
-	if (!match_my_nick(m->nick))
-	  dprintf(DP_SERVER, "PRIVMSG %s :go %s\n", m->nick, chan->dname);
-    } else {
-      /* Some humans on channel, but still op-less */
-      check_tcl_need(chan->dname, "op");
-    }
-  }
+  if (i == 1 && channel_cycle(chan) && !channel_stop_cycle(chan) && (chan->name[0] != '+')) {
+    putlog(LOG_MISC, "*", "Trying to cycle %s to regain ops.", chan->dname);
+    dprintf(DP_MODE, "PART %s\n", chan->name);
+    /* If it's a !chan, we need to recreate the channel with !!chan <cybah> */
+    dprintf(DP_MODE, "JOIN %s%s %s\n", (chan->dname[0] == '!') ? "!" : "",
+	    chan->dname, chan->key_prot);
+  } else 
+    check_tcl_need(chan->dname, "cycle");
 }
 
 static void check_expired_chanstuff()
@@ -936,6 +897,8 @@
 	  p = _("trying");
 	else if (chan->status & CHAN_PEND)
 	  p = _("pending");
+        else if (!any_ops(chan))
+          p = _("opless");
 	else if (!me_op(chan))
 	  p = _("want ops!");
       }
Index: eggdrop1.7/src/mod/irc.mod/msgcmds.c
diff -u eggdrop1.7/src/mod/irc.mod/msgcmds.c:1.27 eggdrop1.7/src/mod/irc.mod/msgcmds.c:1.28
--- eggdrop1.7/src/mod/irc.mod/msgcmds.c:1.27	Mon Aug 27 18:31:17 2001
+++ eggdrop1.7/src/mod/irc.mod/msgcmds.c	Thu Sep 27 13:33:21 2001
@@ -2,7 +2,7 @@
  * msgcmds.c -- part of irc.mod
  *   all commands entered via /MSG
  *
- * $Id: msgcmds.c,v 1.27 2001/08/27 23:31:17 poptix Exp $
+ * $Id: msgcmds.c,v 1.28 2001/09/27 18:33:21 sup Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -804,6 +804,8 @@
       l += my_strcpy(s + l, " (trying)");
     else if (channel_pending(chan))
       l += my_strcpy(s + l, " (pending)");
+    else if (!any_ops(chan))
+      l += my_strcpy(s + l, " (opless)");
     else if (!me_op(chan))
       l += my_strcpy(s + l, " (want ops!)");
     s[l++] = ',';
@@ -961,65 +963,6 @@
   return 1;
 }
 
-static int msg_go(char *nick, char *host, struct userrec *u, char *par)
-{
-  struct chanset_t *chan;
-  int ok = 0, ok2 = 0;
-  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
-
-  if (match_my_nick(nick))
-    return 1;
-  if (!u)
-    return 0;
-  if (par[0]) {
-    chan = findchan_by_dname(par);
-    if (!chan)
-      return 0;
-    if (!(chan->status & CHAN_ACTIVE)) {
-      putlog(LOG_CMDS, "*", "(%s!%s) !%s! failed GO (i'm blind)", nick, host,
-	     u->handle);
-      return 1;
-    }
-    get_user_flagrec(u, &fr, par);
-    if (!chan_op(fr) && !(glob_op(fr) && !chan_deop(fr))) {
-      putlog(LOG_CMDS, "*", "(%s!%s) !%s! failed GO (not op)", nick, host,
-	     u->handle);
-      return 1;
-    }
-    if (!me_op(chan)) {
-      dprintf(DP_SERVER, "PART %s\n", chan->name);
-      putlog(LOG_CMDS, chan->dname, "(%s!%s) !%s! GO %s", nick, host,
-	     u->handle, par);
-      return 1;
-    }
-    putlog(LOG_CMDS, chan->dname, "(%s!%s) !%s! failed GO %s (i'm chop)",
-	   nick, host, u->handle, par);
-    return 1;
-  }
-  for (chan = chanset; chan; chan = chan->next) {
-    if (ismember(chan, nick)) {
-      get_user_flagrec(u, &fr, par);
-      if (chan_op(fr) || (glob_op(fr) && !chan_deop(fr))) {
-	ok2 = 1;
-	if (!me_op(chan)) {
-	  dprintf(DP_SERVER, "PART %s\n", chan->name);
-	  ok = 1;
-	}
-      }
-    }
-  }
-  if (ok) {
-    putlog(LOG_CMDS, "*", "(%s!%s) !%s! GO", nick, host, u->handle);
-  } else if (ok2) {
-    putlog(LOG_CMDS, "*", "(%s!%s) !%s! failed GO (i'm chop)", nick, host,
-	   u->handle);
-  } else {
-    putlog(LOG_CMDS, "*", "(%s!%s) !%s! failed GO (not op)", nick, host,
-	   u->handle);
-  }
-  return 1;
-}
-
 static int msg_jump(char *nick, char *host, struct userrec *u, char *par)
 {
   char *s;
@@ -1067,7 +1010,6 @@
 {
   {"addhost",		"",	(Function) msg_addhost,		NULL},
   {"die",		"n",	(Function) msg_die,		NULL},
-  {"go",		"",	(Function) msg_go,		NULL},
   {"hello",		"",	(Function) msg_hello,		NULL},
   {"help",		"",	(Function) msg_help,		NULL},
   {"ident",		"",	(Function) msg_ident,		NULL},
----------------------- End of diff -----------------------



More information about the Changes mailing list