]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Fix this so it works, passes test case. Provide a method to query for a bit and to...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index c09b714f17f708d3f0260436c0e7588757df4185..4475c169a9f33eafdc7619caa8c17199c0fb42a3 100644 (file)
@@ -506,3 +506,25 @@ void InspIRCd::LoadAllModules()
        this->Log(DEFAULT,"Total loaded modules: %d", this->ModCount+1);
 }
 
+void InspIRCd::SendWhoisLine(userrec* user, userrec* dest, int numeric, const std::string &text)
+{
+       std::string copy_text = text;
+
+       int MOD_RESULT = 0;
+       FOREACH_RESULT_I(this, I_OnWhoisLine, OnWhoisLine(user, dest, numeric, copy_text));
+
+       if (!MOD_RESULT)
+               user->WriteServ("%d %s", numeric, copy_text.c_str());
+}
+
+void InspIRCd::SendWhoisLine(userrec* user, userrec* dest, 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, dest, numeric, std::string(textbuffer));
+}
+