[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help for ircd



On Fri, 13 Jul 2001, Kurt Roeckx wrote:

> On Fri, Jul 13, 2001 at 03:35:40PM +0200, Olivier Beytrison wrote:
> > 
> > An irc operator cannot op him self.
> 
> Nobody can op himself, because it doesn't make sense.
> 

A simple user should be able to op himself in the first place,
alternatively you can try this little piece of artwork below, it should
work great and do the trick, don't forget to include a #define
ALLOW_AUTO_OPS in the config.h before compile time.

Need other neat features like this one? try the +cygnus1.patch available @:

ftp://irc.smbh.univ-paris13.fr/pub/ircd/irc2.10/patches/irc2.10.3p1+cygnus1.patch

If you're smart enough that should enlight you a bit, add a #define such
as ALLOW_AUTO_OPS_ONLY_IF_AN_OPER and hack channel.c a little bit more,
there you are. ;-)

-ice

<---CUT HERE--->
diff -ruN irc2.10.3p1/ircd/channel.c irc2.10.3p1+auto/ircd/channel.c
--- irc2.10.3p1/ircd/channel.c  Tue Jun  6 23:34:28 2000
+++ irc2.10.3p1+auto/ircd/channel.c     Mon Jun 25 22:18:46 2001
@@ -1385,9 +1385,13 @@
                                                   sptr->name), chptr->chname);
                                else if (((*ip == MODE_ANONYMOUS &&
                                           whatt == MODE_ADD &&
+#ifdef ALLOW_AUTO_OPS
+                       *chptr->chname == '#')) &&
+#else
                                           *chptr->chname == '#') ||
                                          (*ip == MODE_REOP &&
                                           *chptr->chname != '!')) &&
+#endif
                                         !IsServer(sptr))
                                        sendto_one(cptr, err_str(ERR_UNKNOWNMODE,
@@ -2203,6 +2207,14 @@
                                strcpy(chop, "\007o");
                        s = chop+1; /* tricky */
                    }
+#ifdef ALLOW_AUTO_OPS
+               else if (MyConnect(sptr) && (chptr->mode.mode & MODE_REOP) && chptr->users &&
+                               match_modeid(CHFL_INVITE, sptr, chptr))
+                       {
+                               strcpy(chop, "\007o");
+                               s = chop+1;
+                       }
+#endif
                /*
                **  Complete user entry to the new channel (if any)
                */
<---CUT HERE--->