summaryrefslogtreecommitdiff
path: root/src/modules/m_ojoin.cpp
diff options
context:
space:
mode:
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;
}