X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ojoin.cpp;h=1444f93ad691a3ab37174b02e10f51e0dfdcf755;hb=7cb79020b7a9d7431d3038953c8e05ec0f2158c7;hp=3710757aafa76d78cd8331937806ef01e78deca4;hpb=8fc268558586584479c622a3852f647eaf3a9b0e;p=user%2Fhenk%2Fcode%2Finspircd.git 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 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; }