summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-30 14:26:01 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-30 14:26:01 +0000
commite2f4bf3a135e6b23fea21b2628c2c830de29cdec (patch)
treef65396b2731efe96f631a6104912480139e1a797 /include
parentd65f2c382531e2fd747f21f14b6b4d6c9659ca64 (diff)
Merge OnCancelAway and OnSetAway, add param awaymsg to OnSetAway (blank when cancelling), and change return type to int so modules can block away messages by returning nonzero.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9223 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/modules.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/include/modules.h b/include/modules.h
index 48d063455..ce6e3fa21 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -399,7 +399,7 @@ enum Implementation
I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange,
I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan,
I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
- I_OnChannelPreDelete, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList,
+ I_OnChannelPreDelete, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnUserList,
I_OnPostCommand, I_OnPostJoin, I_OnWhoisLine, I_OnBuildExemptList, I_OnRawSocketConnect, I_OnGarbageCollect, I_OnBufferFlushed,
I_OnText, I_OnReadConfig, I_OnDownloadFile, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookUserIO,
I_END
@@ -1299,17 +1299,15 @@ class CoreExport Module : public Extensible
*/
virtual int OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult);
- /** Called whenever a user sets away.
- * This method has no parameter for the away message, as it is available in the
- * user record as User::awaymsg.
+ /** Called whenever a user sets away or returns from being away.
+ * The away message is available as a parameter, but should not be modified.
+ * At this stage, it has already been copied into the user record.
+ * If awaymsg is empty, the user is returning from away.
* @param user The user setting away
+ * @param awaymsg The away message of the user, or empty if returning from away
+ * @return nonzero if the away message should be blocked - should ONLY be nonzero for LOCAL users (IS_LOCAL) (no output is returned by core)
*/
- virtual void OnSetAway(User* user);
-
- /** Called when a user cancels their away state.
- * @param user The user returning from away
- */
- virtual void OnCancelAway(User* user);
+ virtual int OnSetAway(User* user, const std::string &awaymsg);
/** Called whenever a NAMES list is requested.
* You can produce the nameslist yourself, overriding the current list,