summaryrefslogtreecommitdiff
path: root/src/modules/m_operjoin.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-12 16:00:17 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-13 16:05:54 +0200
commitb98acac5c91ecb08da28d70185818a19991eb1db (patch)
treea72446ebf241ced2b21939eb8adb7a0045274dfe /src/modules/m_operjoin.cpp
parent988d8218071b504521bd1da6c2275db877d857b9 (diff)
Channel::JoinUser() and Channel::ForceChan() changes
Convert static Channel::ForceChan() to non-static Channel::ForceJoin() that joins a user to a channel, no permission checks The (static) Channel::JoinUser() now has a LocalUser parameter, and no longer have TS and bursting parameters. If the channel doesn't exist, it is created using current time as TS
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);
}
}
}