summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/snomasks.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/snomasks.cpp b/src/snomasks.cpp
index 2e682675d..e12f95d6b 100644
--- a/src/snomasks.cpp
+++ b/src/snomasks.cpp
@@ -73,6 +73,13 @@ void SnomaskManager::WriteToSnoMask(char letter, const std::string &text)
}
}
+void SnomaskManager::WriteGlobalSno(char letter, const std::string& text)
+{
+ WriteToSnoMask(letter, text);
+ letter = toupper(letter);
+ ServerInstance->PI->SendSNONotice(std::string(1, letter), text);
+}
+
void SnomaskManager::WriteToSnoMask(char letter, const char* text, ...)
{
char textbuffer[MAXBUF];
@@ -85,6 +92,18 @@ void SnomaskManager::WriteToSnoMask(char letter, const char* text, ...)
this->WriteToSnoMask(letter, std::string(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));
+}
+
bool SnomaskManager::IsEnabled(char letter)
{
return (SnoMasks.find(letter) != SnoMasks.end());