Skip to content

Commit

Permalink
- [internal] cleaned up snomask removal after deoper, now remove_oper…
Browse files Browse the repository at this point in the history
…_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 e52cf21
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 22 deletions.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -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).
12 changes: 11 additions & 1 deletion doc/example.conf
Expand Up @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions include/h.h
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
3 changes: 1 addition & 2 deletions src/modules/m_svsnoop.c
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/m_svso.c
Expand Up @@ -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);
}
Expand Down
20 changes: 2 additions & 18 deletions src/s_user.c
Expand Up @@ -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);
}
/*
Expand Down Expand Up @@ -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);
}

Expand Down
17 changes: 17 additions & 0 deletions src/umodes.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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.