1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
17 #include "m_spanningtree/treesocket.h"
18 #include "m_spanningtree/treeserver.h"
19 #include "m_spanningtree/utils.h"
21 /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
24 /** Because the core won't let users or even SERVERS set +o,
25 * we use the OPERTYPE command to do this.
27 bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> ¶ms)
29 if (params.size() != 1)
31 std::string opertype = params[0];
32 User* u = this->Instance->FindNick(prefix);
35 if (!u->IsModeSet('o'))
36 this->Instance->Users->all_opers.push_back(u);
37 u->modes[UM_OPERATOR] = 1;
38 strlcpy(u->oper,opertype.c_str(),NICKMAX-1);
39 Utils->DoOneToAllButSender(u->uuid,"OPERTYPE",params,u->server);
41 TreeServer* remoteserver = Utils->FindServer(u->server);
44 if (this->Utils->quiet_bursts)
47 * If quiet bursts are enabled, and server is bursting or silent uline (i.e. services),
48 * then do nothing. -- w00t
51 remoteserver->bursting ||
52 this->Instance->SilentULine(this->Instance->FindServerNamePtr(u->server))
60 this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick,u->ident,u->host,irc::Spacify(opertype.c_str()));