/** Because the core won't let users or even SERVERS set +o,
* we use the OPERTYPE command to do this.
*/
-CmdResult CommandOpertype::Handle(const std::vector<std::string>& params, User *u)
+CmdResult CommandOpertype::HandleRemote(RemoteUser* u, std::vector<std::string>& params)
{
- SpanningTreeUtilities* Utils = ((ModuleSpanningTree*)(Module*)creator)->Utils;
const std::string& opertype = params[0];
if (!u->IsOper())
ServerInstance->Users->all_opers.push_back(u);
ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
u->SetMode(opermh, true);
- OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + opertype);
- if (iter != ServerInstance->Config->oper_blocks.end())
+ OperIndex::iterator iter = ServerInstance->Config->OperTypes.find(opertype);
+ if (iter != ServerInstance->Config->OperTypes.end())
u->oper = iter->second;
else
{
return CMD_SUCCESS;
}
+CommandOpertype::Builder::Builder(User* user)
+ : CmdBuilder(user, "OPERTYPE")
+{
+ push_last(user->oper->name);
+}