]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/snomasks.cpp
Improve X-line text consistency.
[user/henk/code/inspircd.git] / src / snomasks.cpp
index e0305ea061330120fe1a575a5e0059b6eb93e1ea..e39fb84fb748f05a131ce75174280c24d86c04f4 100644 (file)
@@ -21,7 +21,6 @@
 
 
 #include "inspircd.h"
-#include <stdarg.h>
 
 void SnomaskManager::FlushSnotices()
 {
@@ -70,9 +69,8 @@ SnomaskManager::SnomaskManager()
        EnableSnomask('q',"QUIT");                      /* Local quit notices */
        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('a',"ANNOUNCEMENT");              /* formerly WriteOpers() - generic notices to all opers */
+       EnableSnomask('x',"XLINE");                     /* X-line notices (G/Z/Q/K/E/R/SHUN/CBan) */
        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