1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 #include "treeserver.h"
19 /** Because the core won't let users or even SERVERS set +o,
20 * we use the OPERTYPE command to do this.
22 CmdResult CommandOpertype::Handle(const std::vector<std::string>& params, User *u)
24 SpanningTreeUtilities* Utils = ((ModuleSpanningTree*)(Module*)creator)->Utils;
25 std::string opertype = params[0];
27 ServerInstance->Users->all_opers.push_back(u);
28 u->modes[UM_OPERATOR] = 1;
29 OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + opertype);
30 if (iter != ServerInstance->Config->oper_blocks.end())
31 u->oper = iter->second;
34 u->oper = new OperInfo;
35 u->oper->name = opertype;
38 TreeServer* remoteserver = Utils->FindServer(u->server);
41 if (Utils->quiet_bursts)
44 * If quiet bursts are enabled, and server is bursting or silent uline (i.e. services),
45 * then do nothing. -- w00t
47 if (remoteserver->bursting || ServerInstance->SilentULine(u->server))
54 ServerInstance->SNO->WriteToSnoMask('O',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server.c_str(), u->nick.c_str(),u->ident.c_str(), u->host.c_str(), irc::Spacify(opertype.c_str()));