X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsnomasks.cpp;h=0b266ff7e44c6420b9a437b047c4d58a9d94f939;hb=8b418f081f7ecbfdd51c84fae2298f927155fac0;hp=d7cb64f26d45c5f46817049a0070ecc0b8cfa9df;hpb=1031f333332cf1b09db4fd632f141143ee637c34;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/snomasks.cpp b/src/snomasks.cpp index d7cb64f26..0b266ff7e 100644 --- a/src/snomasks.cpp +++ b/src/snomasks.cpp @@ -21,7 +21,6 @@ #include "inspircd.h" -#include 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& opers = ServerInstance->Users->all_opers; - for (std::list::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