]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/opertype.cpp
Fix Windows build and a few more problems
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / opertype.cpp
index 021100870e7dcfe12b9d4b1f834aaea81f3ef998..48f55356f7646ed82a69f1796311bdb2aef76c96 100644 (file)
 /** 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);
-       u->modes[UM_OPERATOR] = 1;
-       OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + opertype);
-       if (iter != ServerInstance->Config->oper_blocks.end())
+
+       ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
+       u->SetMode(opermh, true);
+
+       OperIndex::iterator iter = ServerInstance->Config->OperTypes.find(opertype);
+       if (iter != ServerInstance->Config->OperTypes.end())
                u->oper = iter->second;
        else
        {