]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/opertype.cpp
Warn about non-local plaintext server connections.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / opertype.cpp
index 4b1dce23c9794d76241f3a63de170c72749a37dd..0574bfad2eb819ef16c481fa306b8a9b09a80054 100644 (file)
@@ -1,7 +1,11 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2017-2018 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
  *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
 /** Because the core won't let users or even SERVERS set +o,
  * we use the OPERTYPE command to do this.
  */
-CmdResult CommandOpertype::HandleRemote(RemoteUser* u, std::vector<std::string>& params)
+CmdResult CommandOpertype::HandleRemote(RemoteUser* u, CommandBase::Params& params)
 {
        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);
+       if (opermh)
+               u->SetMode(opermh, true);
 
        ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->OperTypes.find(opertype);
        if (iter != ServerInstance->Config->OperTypes.end())
@@ -52,7 +57,7 @@ CmdResult CommandOpertype::HandleRemote(RemoteUser* u, std::vector<std::string>&
                        return CMD_SUCCESS;
        }
 
-       ServerInstance->SNO->WriteToSnoMask('O',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server->GetName().c_str(), u->nick.c_str(),u->ident.c_str(), u->GetRealHost().c_str(), opertype.c_str());
+       ServerInstance->SNO->WriteToSnoMask('O', "From %s: User %s (%s@%s) is now a server operator of type %s", u->server->GetName().c_str(), u->nick.c_str(),u->ident.c_str(), u->GetRealHost().c_str(), opertype.c_str());
        return CMD_SUCCESS;
 }