summaryrefslogtreecommitdiff
path: root/src/modules/m_operjoin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_operjoin.cpp')
-rw-r--r--src/modules/m_operjoin.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp
index 2f5dda0ff..864515e0c 100644
--- a/src/modules/m_operjoin.cpp
+++ b/src/modules/m_operjoin.cpp
@@ -78,23 +78,24 @@ class ModuleOperjoin : public Module
virtual void OnPostOper(User* user, const std::string &opertype, const std::string &opername)
{
- if (!IS_LOCAL(user))
+ LocalUser* localuser = IS_LOCAL(user);
+ if (!localuser)
return;
- for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++)
- if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax))
- Channel::JoinUser(user, it->c_str(), override, "", false, ServerInstance->Time());
+ for (std::vector<std::string>::const_iterator i = operChans.begin(); i != operChans.end(); ++i)
+ if (ServerInstance->IsChannel(*i, ServerInstance->Config->Limits.ChanMax))
+ Channel::JoinUser(localuser, *i, override);
- std::string chanList = user->oper->getConfig("autojoin");
+ std::string chanList = localuser->oper->getConfig("autojoin");
if (!chanList.empty())
{
std::vector<std::string> typechans;
tokenize(chanList, typechans);
for (std::vector<std::string>::const_iterator it = typechans.begin(); it != typechans.end(); ++it)
{
- if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax))
+ if (ServerInstance->IsChannel(*it, ServerInstance->Config->Limits.ChanMax))
{
- Channel::JoinUser(user, it->c_str(), override, "", false, ServerInstance->Time());
+ Channel::JoinUser(localuser, *it, override);
}
}
}