From 52593ef71ba2ccd57a4d49f9000dfcafb43caaf7 Mon Sep 17 00:00:00 2001 From: Adam- Date: Tue, 27 Oct 2009 13:19:01 +0000 Subject: [PATCH] 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 --- src/channels.c | 15 +++++++++------ 1 file 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);