diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-27 13:19:01 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-27 13:19:01 +0000 |
commit | 52593ef71ba2ccd57a4d49f9000dfcafb43caaf7 (patch) | |
tree | 63f0b09f75d67073384d5b574cfd50fde27ee2f8 /src | |
parent | 9e48e683e749e345a1ddfb8014f37c9ee7b237da (diff) |
Cleaned up some of the code in my last commit and made it a bit more consistant.. probably should have done this before but owell
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2592 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/channels.c b/src/channels.c index 655928d4d..dbc39e409 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1710,21 +1710,24 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes) else add_modes &= ~CUS_PROTECT; - if (op && (add_modes & CUS_OP) && !(status & CUS_OP)) { + if (op && (add_modes & CUS_OP) && !(status & CUS_OP)) + { modebuf += op->ModeChar; userbuf += " " + std::string(user->nick); } else add_modes &= ~CUS_OP; - if (halfop && (add_modes & CUS_HALFOP) && !(status & CUS_HALFOP)) { + if (halfop && (add_modes & CUS_HALFOP) && !(status & CUS_HALFOP)) + { modebuf += halfop->ModeChar; userbuf += " " + std::string(user->nick); } else add_modes &= ~CUS_HALFOP; - if ((add_modes & CUS_VOICE) && !(status & CUS_VOICE)) { + if (voice && (add_modes & CUS_VOICE) && !(status & CUS_VOICE)) + { modebuf += voice->ModeChar; userbuf += " " + std::string(user->nick); } @@ -1741,19 +1744,19 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes) userbuf += " " + std::string(user->nick); } - if (rem_modes & CUS_PROTECT) + if (admin && rem_modes & CUS_PROTECT) { modebuf += admin->ModeChar; userbuf += " " + std::string(user->nick); } - if (rem_modes & CUS_OP) + if (op && rem_modes & CUS_OP) { modebuf += op->ModeChar; userbuf += " " + std::string(user->nick); } - if (rem_modes & CUS_HALFOP) + if (halfop && rem_modes & CUS_HALFOP) { modebuf += halfop->ModeChar; userbuf += " " + std::string(user->nick); |