summaryrefslogtreecommitdiff
path: root/src/snomasks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/snomasks.cpp')
-rw-r--r--src/snomasks.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/snomasks.cpp b/src/snomasks.cpp
index 4b9c9d86b..820f65e4b 100644
--- a/src/snomasks.cpp
+++ b/src/snomasks.cpp
@@ -52,26 +52,16 @@ void SnomaskManager::WriteGlobalSno(char letter, const std::string& text)
void SnomaskManager::WriteToSnoMask(char letter, const char* text, ...)
{
- char textbuffer[MAXBUF];
- va_list argsPtr;
-
- va_start(argsPtr, text);
- vsnprintf(textbuffer, MAXBUF, text, argsPtr);
- va_end(argsPtr);
-
- this->WriteToSnoMask(letter, std::string(textbuffer));
+ std::string textbuffer;
+ VAFORMAT(textbuffer, text, text);
+ this->WriteToSnoMask(letter, textbuffer);
}
void SnomaskManager::WriteGlobalSno(char letter, const char* text, ...)
{
- char textbuffer[MAXBUF];
- va_list argsPtr;
-
- va_start(argsPtr, text);
- vsnprintf(textbuffer, MAXBUF, text, argsPtr);
- va_end(argsPtr);
-
- this->WriteGlobalSno(letter, std::string(textbuffer));
+ std::string textbuffer;
+ VAFORMAT(textbuffer, text, text);
+ this->WriteGlobalSno(letter, textbuffer);
}
SnomaskManager::SnomaskManager()
@@ -104,7 +94,7 @@ void Snomask::SendMessage(const std::string &message, char mysnomask)
if (isupper(mysnomask))
desc = "REMOTE" + desc;
ModResult MOD_RESULT;
- ServerInstance->Logs->Log("snomask", DEFAULT, "%s: %s", desc.c_str(), message.c_str());
+ ServerInstance->Logs->Log("snomask", LOG_DEFAULT, "%s: %s", desc.c_str(), message.c_str());
FIRST_MOD_RESULT(OnSendSnotice, MOD_RESULT, (mysnomask, desc, message));
@@ -120,7 +110,7 @@ void Snomask::SendMessage(const std::string &message, char mysnomask)
User* a = *i;
if (IS_LOCAL(a) && a->IsModeSet('s') && a->IsNoticeMaskSet(mysnomask) && !a->quitting)
{
- a->WriteServ("NOTICE %s :*** %s: %s", a->nick.c_str(), desc.c_str(), message.c_str());
+ a->WriteNotice("*** " + desc + ": " + message);
}
i++;
@@ -141,7 +131,7 @@ void Snomask::Flush()
desc = "REMOTE" + desc;
std::string mesg = "(last message repeated "+ConvToStr(Count)+" times)";
- ServerInstance->Logs->Log("snomask", DEFAULT, "%s: %s", desc.c_str(), mesg.c_str());
+ ServerInstance->Logs->Log("snomask", LOG_DEFAULT, "%s: %s", desc.c_str(), mesg.c_str());
FOREACH_MOD(I_OnSendSnotice, OnSendSnotice(LastLetter, desc, mesg));
@@ -155,7 +145,7 @@ void Snomask::Flush()
User* a = *i;
if (IS_LOCAL(a) && a->IsModeSet('s') && a->IsNoticeMaskSet(LastLetter) && !a->quitting)
{
- a->WriteServ("NOTICE %s :*** %s: %s", a->nick.c_str(), desc.c_str(), mesg.c_str());
+ a->WriteNotice("*** " + desc + ": " + mesg);
}
i++;