opertype.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "inspircd.h"
00015 #include "xline.h"
00016
00017 #include "m_spanningtree/treesocket.h"
00018 #include "m_spanningtree/treeserver.h"
00019 #include "m_spanningtree/utils.h"
00020
00021
00022
00023
00027 bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> ¶ms)
00028 {
00029 if (params.size() != 1)
00030 return true;
00031 std::string opertype = params[0];
00032 User* u = this->Instance->FindNick(prefix);
00033 if (u)
00034 {
00035 if (!u->IsModeSet('o'))
00036 this->Instance->Users->all_opers.push_back(u);
00037 u->modes[UM_OPERATOR] = 1;
00038 u->oper.assign(opertype, 0, 512);
00039 Utils->DoOneToAllButSender(u->uuid, "OPERTYPE", params, u->server);
00040
00041 TreeServer* remoteserver = Utils->FindServer(u->server);
00042 bool dosend = true;
00043
00044 if (this->Utils->quiet_bursts)
00045 {
00046
00047
00048
00049
00050 if (
00051 remoteserver->bursting ||
00052 this->Instance->SilentULine(this->Instance->FindServerNamePtr(u->server))
00053 )
00054 {
00055 dosend = false;
00056 }
00057 }
00058
00059 if (dosend)
00060 this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick.c_str(),u->ident.c_str(), u->host.c_str(), irc::Spacify(opertype.c_str()));
00061 }
00062 return true;
00063 }
00064