]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/snomasks.cpp
Split irc::tokenparser::GetToken into GetMiddle and GetTrailing.
[user/henk/code/inspircd.git] / src / snomasks.cpp
index d7cb64f26d45c5f46817049a0070ecc0b8cfa9df..0b266ff7e44c6420b9a437b047c4d58a9d94f939 100644 (file)
@@ -21,7 +21,6 @@
 
 
 #include "inspircd.h"
-#include <stdarg.h>
 
 void SnomaskManager::FlushSnotices()
 {
@@ -47,7 +46,7 @@ void SnomaskManager::WriteGlobalSno(char letter, const std::string& text)
 {
        WriteToSnoMask(letter, text);
        letter = toupper(letter);
-       ServerInstance->PI->SendSNONotice(std::string(1, letter), text);
+       ServerInstance->PI->SendSNONotice(letter, text);
 }
 
 void SnomaskManager::WriteToSnoMask(char letter, const char* text, ...)
@@ -71,7 +70,6 @@ SnomaskManager::SnomaskManager()
        EnableSnomask('k',"KILL");                      /* Kill notices */
        EnableSnomask('o',"OPER");                      /* Oper up/down notices */
        EnableSnomask('a',"ANNOUNCEMENT");      /* formerly WriteOpers() - generic notices to all opers */
-       EnableSnomask('d',"DEBUG");                     /* Debug notices */
        EnableSnomask('x',"XLINE");                     /* Xline notice (g/z/q/k/e) */
        EnableSnomask('t',"STATS");                     /* Local or remote stats request */
 }
@@ -125,15 +123,12 @@ void Snomask::Flush()
 
 void Snomask::Send(char letter, const std::string& desc, const std::string& msg)
 {
-       std::string log = desc;
-       log.append(": ").append(msg);
-       ServerInstance->Logs->Log("snomask", LOG_DEFAULT, log);
+       ServerInstance->Logs->Log(desc, LOG_DEFAULT, msg);
+       const std::string finalmsg = InspIRCd::Format("*** %s: %s", desc.c_str(), msg.c_str());
 
-       std::string finalmsg = "*** ";
-       finalmsg.append(log);
        /* Only opers can receive snotices, so we iterate the oper list */
-       const std::list<User*>& opers = ServerInstance->Users->all_opers;
-       for (std::list<User*>::const_iterator i = opers.begin(); i != opers.end(); ++i)
+       const UserManager::OperList& opers = ServerInstance->Users->all_opers;
+       for (UserManager::OperList::const_iterator i = opers.begin(); i != opers.end(); ++i)
        {
                User* user = *i;
                // IsNoticeMaskSet() returns false for opers who aren't +s, no need to check for it seperately