[eggheads-patches] delay_op.patch

Axel Franke eule at berlin.snafu.de
Mon Oct 11 13:28:44 CST 1999


Here delayed autoop and missing 
(chan_op(fr) || (glob_op(fr) && !chan_deop(fr))) &&
in gotjoin and for enforcebans in gotjoin missing
&& !glob_friend(fr) && !chan_friend(fr)

Greeting Eule

-------------- next part --------------
diff -bur eggdrop1.3/doc/UPDATES1.3 eggneu/doc/UPDATES1.3
--- eggdrop1.3/doc/UPDATES1.3	Mon Oct 11 15:13:48 1999
+++ eggneu/doc/UPDATES1.3	Mon Oct 11 15:23:22 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+dw        Eule      delayed autoop + flagchecks
 	  CyberTech Fixed pver length into init_tcl().
 	  drummer   Adds ismodeline macros.
 ranjha	  Fabian    .help * is now converted to .help all
diff -bur eggdrop1.3/src/chan.h eggneu/src/chan.h
--- eggdrop1.3/src/chan.h	Mon Oct 11 15:13:51 1999
+++ eggneu/src/chan.h	Mon Oct 11 15:18:17 1999
@@ -17,6 +17,7 @@
   unsigned short flags;
   time_t split;			/* in case they were just netsplit */
   time_t last;			/* for measuring idle time */
+  time_t delay;			/* for delayed autoop */
   struct userrec *user;
   struct memstruct *next;
 } memberlist;
diff -bur eggdrop1.3/src/mod/irc.mod/chan.c eggneu/src/mod/irc.mod/chan.c
--- eggdrop1.3/src/mod/irc.mod/chan.c	Mon Oct 11 15:13:50 1999
+++ eggneu/src/mod/irc.mod/chan.c	Mon Oct 11 16:31:08 1999
@@ -37,6 +37,7 @@
   x->next->nick[0] = 0;
   x->next->split = 0L;
   x->next->last = 0L;
+  x->next->delay = 0L;
   chan->channel.members++;
   return x;
 }
@@ -780,7 +781,7 @@
   m = ismember(chan, nick);	/* In my channel list copy? */
   if (!m) {			/* Nope, so update */
     m = newmember(chan);	/* Get a new channel entry */
-    m->joined = m->split = 0L;	/* Don't know when he joined */
+    m->joined = m->split = m->delay = 0L;	/* Don't know when he joined */
     m->flags = 0;		/* No flags for now */
     m->last = now;		/* Last time I saw him */
   }
@@ -1378,17 +1379,20 @@
 	check_tcl_rejn(nick, uhost, u, chan->name);
 	m->split = 0;
 	m->last = now;
+	m->delay = 0L;
 	m->flags = (chan_hasop(m) ? WASOP : 0);
 	m->user = u;
 	set_handle_laston(chname, u, now);
 	/* had ops before split, Im an op */
 	if (chan_wasop(m) && me_op(chan) &&
+	/* and the user is a valid op... */
+	    (chan_op(fr) || (glob_op(fr) && !chan_deop(fr))) &&
 	/* channel is +autoop... */
-	    ((chan->status & CHAN_OPONJOIN)
+	    (channel_autoop(chan)
 	/* OR user is maked autoop */
 	     || glob_autoop(fr) || chan_autoop(fr))) {
 	  /* give them a special surprise */
-	  add_mode(chan, '+', 'o', nick);
+	  m->delay = now;
 	  /* also prevent +stopnethack automatically de-opping them */
 	  m->flags |= WASOP;
 	}
@@ -1408,6 +1412,7 @@
 	m->split = 0L;
 	m->flags = 0;
 	m->last = now;
+	m->delay = 0L;
 	strcpy(m->nick, nick);
 	strcpy(m->userhost, uhost);
 	m->user = u;
@@ -1462,7 +1467,7 @@
 		/* is it op-on-join or is the use marked auto-op */
 		(channel_autoop(chan) || glob_autoop(fr) || chan_autoop(fr))) {
 	      /* yes! do the honors */
-	      add_mode(chan, '+', 'o', nick);
+	      m->delay = now;
 	      m->flags |= WASOP;	/* nethack sanity */
 	      /* if it matches a ban, dispose of them */
 	    } else {
@@ -1518,7 +1523,7 @@
 	}
       }
       if (channel_enforcebans(chan) && me_op(chan) &&
-          !chan_op(fr) && !glob_op(fr)) {
+          !chan_op(fr) && !glob_op(fr) && !glob_friend(fr) && !chan_friend(fr)) {
         for (b = chan->channel.ban; b->mask[0]; b = b->next) { 
           if (wild_match(b->mask, from)) {
    	    if (use_exempts)
diff -bur eggdrop1.3/src/mod/irc.mod/irc.c eggneu/src/mod/irc.mod/irc.c
--- eggdrop1.3/src/mod/irc.mod/irc.c	Mon Oct 11 15:13:50 1999
+++ eggneu/src/mod/irc.mod/irc.c	Mon Oct 11 15:15:58 1999
@@ -892,9 +892,18 @@
 static void flush_modes()
 {
   struct chanset_t *chan;
+  memberlist *m;
 
   chan = chanset;
   while (chan != NULL) {
+    m = chan->channel.member;
+    while (m->nick[0]) {
+	  if ((m->delay) && (now - m->delay) > 4) {
+	    add_mode(chan, '+', 'o', m->nick);
+	    m->delay = 0L;
+	    }
+    m = m->next;
+	}
     flush_mode(chan, NORMAL);
     chan = chan->next;
   }


More information about the Patches mailing list