X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsnomasks.cpp;h=28533e4bd1ce7883f6a91783efb9df398e759127;hb=d494fa6e094e85cd29235e995fb2b447d6e1f168;hp=738d0970d480987c010783e8fd63053000efb7a5;hpb=bc730a5d1a6df1c3ff5000a96eda6e153134ae04;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/snomasks.cpp b/src/snomasks.cpp index 738d0970d..28533e4bd 100644 --- a/src/snomasks.cpp +++ b/src/snomasks.cpp @@ -1,10 +1,17 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2019 Matt Schatz + * Copyright (C) 2018 Sadie Powell + * Copyright (C) 2013-2014 Attila Molnar + * Copyright (C) 2013 Daniel Vassdal + * Copyright (C) 2013 Adam + * Copyright (C) 2012, 2019 Robby * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2008 Robin Burchell * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2006 Craig Edwards + * Copyright (C) 2006, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -21,7 +28,6 @@ #include "inspircd.h" -#include void SnomaskManager::FlushSnotices() { @@ -70,9 +76,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,18 +130,15 @@ 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 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 + // IsNoticeMaskSet() returns false for opers who aren't +s, no need to check for it separately if (IS_LOCAL(user) && user->IsNoticeMaskSet(letter)) user->WriteNotice(finalmsg); }