aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_ojoin.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2014-09-03 15:32:02 +0200
committerGravatar Attila Molnar2014-09-03 15:32:02 +0200
commit4634151efc02ff016e19c5f123d75824d0d6c811 (patch)
tree5fc364f465a5b68dd3bcb3098738de55734ca971 /src/modules/m_ojoin.cpp
parentAdd a ModeParser::Process() overload that can process an entire Modes::Change... (diff)
downloadinspircd++-4634151efc02ff016e19c5f123d75824d0d6c811.tar.gz
inspircd++-4634151efc02ff016e19c5f123d75824d0d6c811.tar.bz2
inspircd++-4634151efc02ff016e19c5f123d75824d0d6c811.zip
Replace irc::modestacker usage with the new ModeParser::Process()
Diffstat (limited to 'src/modules/m_ojoin.cpp')
-rw-r--r--src/modules/m_ojoin.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index 3710757aa..1444f93ad 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -65,18 +65,17 @@ class CommandOjoin : public SplitCommand
}
else
{
+ channel = ServerInstance->FindChan(parameters[0]);
+ if (!channel)
+ return CMD_FAILURE;
+
ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used OJOIN in "+parameters[0]);
// they're already in the channel
- std::vector<std::string> modes;
- modes.push_back(parameters[0]);
- modes.push_back(std::string("+") + npmh->GetModeChar());
+ Modes::ChangeList changelist;
+ changelist.push_add(npmh, user->nick);
if (op)
- {
- modes[1].push_back('o');
- modes.push_back(user->nick);
- }
- modes.push_back(user->nick);
- ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
+ changelist.push_add(ServerInstance->Modes->FindMode('o', MODETYPE_CHANNEL), user->nick);
+ ServerInstance->Modes->Process(ServerInstance->FakeClient, channel, NULL, changelist);
}
return CMD_SUCCESS;
}