Permalink
Browse files

- [internal] cleaned up snomask removal after deoper, now remove_oper…

…_snomasks() is

  called which might look a bit ugly, but is better than before (scattered on 3 places).
- Added snomasks 'N' which allows you to see nick changes of clients on other servers,
  requested by several people (#0001323).
  • Loading branch information...
syzop committed Feb 5, 2004
1 parent 1d12b2b commit e52cf2119a6964a7a81df5ab179832cac45eb4f3
Showing with 38 additions and 22 deletions.
  1. +4 −0 Changes
  2. +11 −1 doc/example.conf
  3. +2 −0 include/h.h
  4. +1 −2 src/modules/m_svsnoop.c
  5. +1 −1 src/modules/m_svso.c
  6. +2 −18 src/s_user.c
  7. +17 −0 src/umodes.c
@@ -2811,3 +2811,7 @@ seen. gmtime warning still there
On '/rehash' we reload everything already so the '-all' option was useless anyway.
Reported by fez (#0001516).
- Made blocked dcc notices (sent to umode +v) global, suggested by neothematrix (#1513).
- [internal] cleaned up snomask removal after deoper, now remove_oper_snomasks() is
called which might look a bit ugly, but is better than before (scattered on 3 places).
- Added snomasks 'N' which allows you to see nick changes of clients on other servers,
requested by several people (#0001323).
@@ -248,7 +248,17 @@ oper bobsmith {
* standard
*/
listen *:6601
/* NOTE ON SSL PORTS: SSL ports are pretty non-standardized,
* besides numerous high-SSL ports, some people say you should run
* it at 994 because that's the official SSL port.. but that
* requires root! Besides, port 194 is the official irc port and
* have you ever seen an ircd running on that?
* So, our suggestion is to use port 6697 for SSL, this is used by
* quite some networks and is recognized by for example StunTour.
* You are free to open up as many SSL ports as you want, but
* by (also) using 6697 you help the world standardize a bit ;).
*/
listen *:6697
{
options
{
@@ -448,6 +448,7 @@ extern long SNO_VHOST;
extern long SNO_EYES;
extern long SNO_TKL;
extern long SNO_NICKCHANGE;
extern long SNO_FNICKCHANGE;
extern long SNO_QLINE;
extern long SNO_SNOTICE;
@@ -653,3 +654,4 @@ extern Spamfilter *unreal_buildspamfilter(char *s);
extern int dospamfilter(aClient *sptr, char *str, int type);
extern char *our_strcasestr(char *haystack, char *needle);
extern int spamfilter_getconftargets(char *s);
extern void remove_oper_snomasks(aClient *sptr);
@@ -118,8 +118,7 @@ int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[])
acptr->umodes &=
~(UMODE_KIX | UMODE_DEAF | UMODE_HIDEOPER);
acptr->oflag = 0;
acptr->user->snomask &= ~(SNO_CLIENT|SNO_FLOOD|SNO_FCLIENT|
SNO_JUNK|SNO_TKL|SNO_EYES|SNO_VHOST|SNO_NICKCHANGE|SNO_QLINE);
remove_oper_snomasks(acptr);
RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0);
}
}
@@ -178,7 +178,7 @@ int m_svso(aClient *cptr, aClient *sptr, int parc, char *parv[])
acptr->umodes &=
~(UMODE_KIX | UMODE_DEAF | UMODE_HIDEOPER);
acptr->oflag = 0;
acptr->user->snomask &= ~(SNO_CLIENT|SNO_FLOOD|SNO_FCLIENT|SNO_JUNK|SNO_EYES|SNO_VHOST|SNO_NICKCHANGE|SNO_QLINE|SNO_TKL);
remove_oper_snomasks(acptr);
RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0);
send_umode_out(acptr, acptr, fLag);
}
@@ -1712,6 +1712,7 @@ CMD_FUNC(m_nick)
RunHook2(HOOKTYPE_LOCAL_NICKCHANGE, sptr, nick);
} else {
sendto_snomask(SNO_FNICKCHANGE, "*** Notice -- %s (%s@%s) has changed his/her nickname to %s", sptr->name, sptr->user->username, sptr->user->realhost, nick);
RunHook3(HOOKTYPE_REMOTE_NICKCHANGE, cptr, sptr, nick);
}
/*
@@ -2594,24 +2595,7 @@ CMD_FUNC(m_umode)
delfrom_fdlist(sptr->slot, &oper_fdlist);
#endif
sptr->oflag = 0;
if (sptr->user->snomask & SNO_CLIENT)
sptr->user->snomask &= ~SNO_CLIENT;
if (sptr->user->snomask & SNO_FCLIENT)
sptr->user->snomask &= ~SNO_FCLIENT;
if (sptr->user->snomask & SNO_FLOOD)
sptr->user->snomask &= ~SNO_FLOOD;
if (sptr->user->snomask & SNO_JUNK)
sptr->user->snomask &= ~SNO_JUNK;
if (sptr->user->snomask & SNO_EYES)
sptr->user->snomask &= ~SNO_EYES;
if (sptr->user->snomask & SNO_VHOST)
sptr->user->snomask &= ~SNO_VHOST;
if (sptr->user->snomask & SNO_TKL)
sptr->user->snomask &= ~SNO_TKL;
if (sptr->user->snomask & SNO_NICKCHANGE)
sptr->user->snomask &= ~SNO_NICKCHANGE;
if (sptr->user->snomask & SNO_QLINE)
sptr->user->snomask &= ~SNO_QLINE;
remove_oper_snomasks(sptr);
RunHook2(HOOKTYPE_LOCAL_OPER, sptr, 0);
}
@@ -87,6 +87,7 @@ long SNO_VHOST = 0L;
long SNO_EYES = 0L;
long SNO_TKL = 0L;
long SNO_NICKCHANGE = 0L;
long SNO_FNICKCHANGE = 0L;
long SNO_QLINE = 0L;
long SNO_SNOTICE = 0L;
@@ -153,6 +154,7 @@ void umode_init(void)
SnomaskAdd(NULL, 'e', umode_allow_opers, &SNO_EYES);
SnomaskAdd(NULL, 'G', umode_allow_opers, &SNO_TKL);
SnomaskAdd(NULL, 'n', umode_allow_opers, &SNO_NICKCHANGE);
SnomaskAdd(NULL, 'N', umode_allow_opers, &SNO_FNICKCHANGE);
SnomaskAdd(NULL, 'q', umode_allow_opers, &SNO_QLINE);
SnomaskAdd(NULL, 's', umode_allow_all, &SNO_SNOTICE);
}
@@ -466,3 +468,18 @@ int umode_delete(char ch, long val)
}
return -1;
}
/* Simply non-perfect function to remove all oper-snomasks,
* it's at least better than manually doing a .. &= ~SNO_BLAH everywhere.
*/
void remove_oper_snomasks(aClient *sptr)
{
int i;
for (i = 0; i <= Snomask_highest; i++)
{
if (!Snomask_Table[i].flag)
continue;
if (Snomask_Table[i].allowed == umode_allow_opers)
sptr->user->snomask &= ~Snomask_Table[i].mode;
}
}

0 comments on commit e52cf21

Please sign in to comment.