summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index c09b714f1..7eb4544fb 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -506,3 +506,25 @@ void InspIRCd::LoadAllModules()
this->Log(DEFAULT,"Total loaded modules: %d", this->ModCount+1);
}
+void InspIRCd::SendWhoisLine(userrec* user, int numeric, const std::string &text)
+{
+ std::string copy_text = text;
+
+ int MOD_RESULT = 0;
+ FOREACH_RESULT_I(this, I_OnWhoisLine, OnWhoisLine(user, numeric, copy_text));
+
+ if (!MOD_RESULT)
+ user->WriteServ("%d %s", numeric, copy_text.c_str());
+}
+
+void InspIRCd::SendWhoisLine(userrec* user, int numeric, const char* format, ...)
+{
+ char textbuffer[MAXBUF];
+ va_list argsPtr;
+ va_start (argsPtr, format);
+ vsnprintf(textbuffer, MAXBUF, format, argsPtr);
+ va_end(argsPtr);
+
+ this->SendWhoisLine(user, numeric, std::string(textbuffer));
+}
+