# $Id: ircd-hybrid-6.4+jcs.diff,v 1.1 2006/10/26 21:52:27 jcs Exp $ # # makes opers in hybrid 6.4 act like chanops by default # # by joshua stein # --- include/config.h.orig Thu Oct 26 16:46:14 2006 +++ include/config.h Thu Oct 26 16:46:30 2006 @@ -595,7 +595,7 @@ * the net. for a leaf, 5 is fine. If the number of servers seen * on the net gets less than 5, a split is deemed to have happened. */ -#define SPLIT_SMALLNET_SIZE 5 +#define SPLIT_SMALLNET_SIZE 0 /* * SPLIT_SMALLNET_USER_SIZE defines how many global users on the @@ -605,7 +605,7 @@ * number of users seen on net > SPLIT_SMALLNET_USER_SIZE start * counting down the SERVER_SPLIT_RECOVERY_TIME */ -#define SPLIT_SMALLNET_USER_SIZE 15000 +#define SPLIT_SMALLNET_USER_SIZE 20 /* * SPLIT_PONG will send a PING to a server after the connect burst. Exit 1 --- src/channel.c.orig Thu Oct 26 16:46:52 2006 +++ src/channel.c Thu Oct 26 16:50:56 2006 @@ -333,6 +333,10 @@ if (!IsPerson(cptr)) return (0); + /* opers are never banned -jcs */ + if (IsAnOper(cptr)) + return (0); + strcpy(s, make_nick_user_host(cptr->name, cptr->username, cptr->host)); s2 = make_nick_user_host(cptr->name, cptr->username, inetntoa((char*) &cptr->ip)); @@ -478,9 +482,14 @@ { Link *lp; - if (chptr) + if (chptr) { + /* opers are always opped -jcs */ + if (IsAnOper(cptr)) + return CHFL_CHANOP; + if ((lp = find_user_link(chptr->members, cptr))) return (lp->flags & CHFL_CHANOP); + } return 0; } @@ -489,9 +498,14 @@ { Link *lp; - if (chptr) + if (chptr) { + /* opers are never deopped -jcs */ + if (IsAnOper(cptr)) + return 0; + if ((lp = find_user_link(chptr->members, cptr))) return (lp->flags & CHFL_DEOPPED); + } return 0; } @@ -930,12 +944,16 @@ user_mode_chan = user_channel_mode(sptr, chptr); chan_op = (user_mode_chan & CHFL_CHANOP); - /* has ops or is a server */ - ischop = IsServer(sptr) || chan_op; + /* has ops or is a server (opers are always opped -jcs) */ + ischop = IsServer(sptr) || chan_op || IsAnOper(sptr); /* is client marked as deopped */ isdeop = !ischop && !IsServer(sptr) && (user_mode_chan & CHFL_DEOPPED); + /* opers will never be deopped -jcs */ + if (IsAnOper(sptr)) + isdeop = 0; + /* is an op or server or remote user on a TS channel */ isok = ischop || (!isdeop && IsServer(cptr) && chptr->channelts); @@ -1050,7 +1068,7 @@ if ((who == sptr) && (c == 'o')) { - if(whatt == MODE_ADD) + if((whatt == MODE_ADD) && (!IsAnOper(sptr))) break; } @@ -1942,6 +1960,10 @@ { Link *lp; int ban_or_exception; + + /* opers can join all channels -jcs */ + if (IsAnOper(sptr)) + return 0; #ifdef JUPE_CHANNEL #ifdef OPER_JUPE_BYPASS