From 980aab93bd2bcceb7e869ff95db5706867de98c3 Mon Sep 17 00:00:00 2001 From: stskeeps Date: Sat, 14 Apr 2001 07:35:30 +0000 Subject: [PATCH] +- When IRCOps are breaking into chans with invite only (+i) or + key-protection (+k) a eyes-notice is sent like it is on banwalk. -NiQuiL + --- Changes | 3 +++ src/channel.c | 34 +++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index 419b085e7..d533092d1 100644 --- a/Changes +++ b/Changes @@ -411,3 +411,6 @@ - Added a new Win32 GUI does it work, no one knows - Rewrote the ircd_log function a bit to fix the FD bug better, not sure wtf I was smoking when I wrote the last one :P +- When IRCOps are breaking into chans with invite only (+i) or + key-protection (+k) a eyes-notice is sent like it is on banwalk. -NiQuiL + diff --git a/src/channel.c b/src/channel.c index fadef0c69..50c2a108f 100644 --- a/src/channel.c +++ b/src/channel.c @@ -71,6 +71,7 @@ extern char *StripColors(char *); extern int lifesux; #endif +void over_notice PROTO((aClient *, aClient *, aChannel *, char *)); static void add_invite PROTO((aClient *, aChannel *)); static int add_banid PROTO((aClient *, aChannel *, char *)); static int can_join PROTO((aClient *, aClient *, aChannel *, char *, char *, @@ -2371,6 +2372,31 @@ static int can_join(aClient *cptr, aClient *sptr, aChannel *chptr, char *key, ch return 0; } +/* Sends notices to +e's about opers possibly abusing priv's + * By NiQuiL (niquil@programmer.net) + * suggestion by -ins4ne- + */ + +void over_notice(aClient *cptr, aClient *sptr, aChannel *chptr, char *key) +{ + Link *lp; + + for (lp = sptr->user->invited; lp; lp = lp->next) + if (lp->value.chptr == chptr) + break; + + if (is_banned(cptr, sptr, chptr) && IsOper(sptr)) + { + sendto_umode(UMODE_EYES, "*** Banwalk, [IRCop: %s] [Channel: %s]",sptr->name,chptr->chname); + } else if (*chptr->mode.key && (BadPtr(key) || mycmp(chptr->mode.key, key))) { + sendto_umode(UMODE_EYES, "*** Keywalk [IRCop: %s] [Channel: %s]",sptr->name,chptr->chname); + } else if ((chptr->mode.mode & MODE_INVITEONLY) && !lp) { + sendto_umode(UMODE_EYES, "*** Invitewalk [IRCop: %s] [Channel: %s]",sptr->name,chptr->chname); + } + +} + + /* ** Remove bells and commas from channel name @@ -2730,7 +2756,6 @@ int channel_link(aClient *cptr, aClient *sptr, int parc, char *parv[]) } continue; } - /* ** Complete user entry to the new channel (if any) */ @@ -2967,15 +2992,10 @@ int m_join(aClient *cptr, aClient *sptr, int parc, char *parv[]) continue; } - if (is_banned(cptr, sptr, chptr) && IsOper(sptr)) - { - sendto_umode(UMODE_EYES, - "*** Banwalk [IRCop: %s] [Channel: %s]", - sptr->name, chptr->chname); - } /* ** Complete user entry to the new channel (if any) */ + (void)over_notice(cptr, sptr, chptr, key); add_user_to_channel(chptr, sptr, flags); /* ** notify all other users on the new channel