diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-28 18:12:45 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-28 18:12:45 +0000 |
commit | 034f74a23b3d6aff177682c916e18382621f495a (patch) | |
tree | 99840e8e12ee0da70c8e2acbb205a31d6e4cf3d9 /include | |
parent | 73d36e20ed9f7ccdb6ce4e745a5eeed065f73bef (diff) |
Add support for OnWhoisLine, which allows modules to change or drop any line of whois before its sent to a user
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5570 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/inspircd.h | 4 | ||||
-rw-r--r-- | include/modules.h | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index 16b42e50b..1aead5d5e 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -998,6 +998,10 @@ class InspIRCd : public classbase */ void Log(int level, const std::string &text); + void SendWhoisLine(userrec* user, int numeric, const std::string &text); + + void SendWhoisLine(userrec* user, int numeric, const char* format, ...); + /** Begin execution of the server. * NOTE: this function NEVER returns. Internally, * after performing some initialisation routines, diff --git a/include/modules.h b/include/modules.h index 18269e144..2d7e9f4ab 100644 --- a/include/modules.h +++ b/include/modules.h @@ -356,7 +356,8 @@ enum Implementation { I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange, I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan, I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister, - I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList, I_OnPostCommand, I_OnPostJoin }; + I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList, + I_OnPostCommand, I_OnPostJoin, I_OnWhoisLine }; /** Base class for all InspIRCd modules * This class is the base class for InspIRCd modules. All modules must inherit from this class, @@ -1286,6 +1287,18 @@ class Module : public Extensible * return 0. */ virtual int OnUserList(userrec* user, chanrec* Ptr); + + /** Called whenever a line of WHOIS output is sent to a user. + * You may change the numeric and the text of the output by changing + * the values numeric and text, but you cannot change the user the + * numeric is sent to. You may however change the user's userrec values. + * @param user The user the numeric is being sent to + * @param numeric The numeric of the line being sent + * @param text The text of the numeric, including any parameters + * @return nonzero to drop the line completely so that the user does not + * receive it, or zero to allow the line to be sent. + */ + virtual int OnWhoisLine(userrec* user, int &numeric, std::string &text); }; |