summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-09-07 23:44:15 -0400
committerAdam <Adam@anope.org>2012-09-07 23:44:15 -0400
commit7e3b5bed50b87d599fec25a018771ebce47f969f (patch)
tree4e74b53755ec94bc070a68017fa48e5317cb2327 /src/channels.cpp
parentc9c477ff9d7e6f833fafac2ef058f82b89229f60 (diff)
Add chanserv/set/autoop, like nickserv/set/autoop but for channels
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 385376ea2..e89b6010d 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -94,7 +94,7 @@ void Channel::Reset()
this->CheckModes();
for (CUserList::const_iterator it = this->users.begin(), it_end = this->users.end(); it != it_end; ++it)
- chan_set_correct_modes((*it)->user, this, 1);
+ chan_set_correct_modes((*it)->user, this, 1, false);
if (this->ci)
this->ci->RestoreTopic();
@@ -371,7 +371,7 @@ void Channel::SetModeInternal(User *setter, ChannelMode *cm, const Anope::string
/* Enforce secureops, etc */
if (EnforceMLock)
- chan_set_correct_modes(u, this, 0);
+ chan_set_correct_modes(u, this, 0, false);
return;
}
@@ -454,7 +454,7 @@ void Channel::RemoveModeInternal(User *setter, ChannelMode *cm, const Anope::str
this->SetMode(bi, cm, bi->nick);
}
- chan_set_correct_modes(u, this, 0);
+ chan_set_correct_modes(u, this, 0, false);
}
return;
}
@@ -1042,7 +1042,7 @@ void do_join(const Anope::string &source, const Anope::string &channels, const A
/* Join the user to the channel */
chan->JoinUser(user);
/* Set the propre modes on the user */
- chan_set_correct_modes(user, chan, 1);
+ chan_set_correct_modes(user, chan, 1, true);
/* Modules may want to allow this user in the channel, check.
* If not, CheckKick will kick/ban them, don't call OnJoinChannel after this as the user will have
@@ -1153,7 +1153,7 @@ void do_cmode(const Anope::string &source, const Anope::string &channel, const A
* @param give_modes Set to 1 to give modes, 0 to not give modes
* @return void
**/
-void chan_set_correct_modes(const User *user, Channel *c, int give_modes)
+void chan_set_correct_modes(const User *user, Channel *c, int give_modes, bool check_noop)
{
ChannelMode *owner = ModeManager::FindChannelModeByName(CMODE_OWNER),
*admin = ModeManager::FindChannelModeByName(CMODE_PROTECT),
@@ -1173,7 +1173,7 @@ void chan_set_correct_modes(const User *user, Channel *c, int give_modes)
AccessGroup u_access = ci->AccessFor(user);
- if (give_modes && (!user->Account() || user->Account()->HasFlag(NI_AUTOOP)))
+ if (give_modes && (!user->Account() || user->Account()->HasFlag(NI_AUTOOP)) && (!check_noop || !ci->HasFlag(CI_NOAUTOOP)))
{
if (owner && u_access.HasPriv("AUTOOWNER"))
c->SetMode(NULL, CMODE_OWNER, user->nick);