From 0b2d842d55d1a2227d9be2f5cabba84eeeb6d0bc Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Tue, 4 Feb 2003 18:02:44 +0000 Subject: [PATCH] Code cleanup in m_umode. --- Changes | 1 + src/s_user.c | 41 ++++++++--------------------------------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/Changes b/Changes index 13143d715..5d15ac317 100644 --- a/Changes +++ b/Changes @@ -1874,3 +1874,4 @@ seen. gmtime warning still there with an often changing host (like dyndns.org). - Documentation updates for nodnscache. - Fixed minor memleak with zip links. +- Code cleanup in m_umode diff --git a/src/s_user.c b/src/s_user.c index 1e2344870..6dfde6e1c 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -2386,39 +2386,14 @@ CMD_FUNC(m_umode) */ if (!IsAnOper(sptr) && !IsServer(cptr)) { - if (IsWhois(sptr)) - sptr->umodes &= ~UMODE_WHOIS; - if (IsAdmin(sptr)) - ClearAdmin(sptr); - if (IsSAdmin(sptr)) - ClearSAdmin(sptr); - if (IsNetAdmin(sptr)) - ClearNetAdmin(sptr); - if (IsHideOper(sptr)) - ClearHideOper(sptr); - if (IsCoAdmin(sptr)) - ClearCoAdmin(sptr); - if (IsHelpOp(sptr)) - ClearHelpOp(sptr); - 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; - + sptr->umodes &= ~UMODE_WHOIS; + ClearAdmin(sptr); + ClearSAdmin(sptr); + ClearNetAdmin(sptr); + ClearHideOper(sptr); + ClearCoAdmin(sptr); + ClearHelpOp(sptr); + sptr->user->snomask &= (SNO_NONOPERS); } /*