From b98acac5c91ecb08da28d70185818a19991eb1db Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Fri, 12 Apr 2013 16:00:17 +0200 Subject: 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 --- src/modules/m_operjoin.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/modules/m_operjoin.cpp') 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::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::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 typechans; tokenize(chanList, typechans); for (std::vector::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); } } } -- cgit v1.3.1-10-gc9f91