From 085a8bc6605d3d07bfe5137423c4a7a02978cd88 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 5 Oct 2009 23:27:46 +0000 Subject: Add OnBuildNeighborList hook, replaces all uses of OnHostCycle git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11802 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 28 +++++++++++----------------- include/users.h | 7 +------ 2 files changed, 12 insertions(+), 23 deletions(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index c9927133f..ca345dbc1 100644 --- a/include/modules.h +++ b/include/modules.h @@ -389,9 +389,9 @@ enum Implementation I_OnPostTopicChange, I_OnEvent, I_OnRequest, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan, I_OnChangeLocalUserGECOS, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete, I_OnPostOper, I_OnSyncNetwork, I_OnSetAway, I_OnUserList, I_OnPostCommand, I_OnPostJoin, - I_OnWhoisLine, I_OnBuildExemptList, I_OnGarbageCollect, + I_OnWhoisLine, I_OnBuildNeighborList, I_OnGarbageCollect, I_OnText, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookIO, - I_OnHostCycle, I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent, + I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent, I_END }; @@ -681,16 +681,16 @@ class CoreExport Module : public Extensible */ virtual ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list); - /** Called whenever the server wants to build the exemption list for a channel, but is not directly doing a PRIVMSG or NOTICE. - * For example, the spanningtree protocol will call this event when passing a privmsg on (but not processing it directly). - * @param message_type The message type, either MSG_PRIVMSG or MSG_NOTICE - * @param chan The channel to build the exempt list of - * @param sender The original sender of the PRIVMSG or NOTICE - * @param status The status char to be used for the channel list - * @param exempt_list The exempt list to be populated - * @param text The original message text causing the exempt list to be built + /** Called when sending a message to all "neighbors" of a given user - + * that is, all users that share a common channel. This is used in + * commands such as NICK, QUIT, etc. + * @param source The source of the message + * @param include_c Channels to scan for users to include + * @param exceptions Map of user->bool that overrides the inclusion decision + * + * Set exceptions[user] = true to include, exceptions[user] = false to exclude */ - virtual void OnBuildExemptList(MessageType message_type, Channel* chan, User* sender, char status, CUList &exempt_list, const std::string &text); + virtual void OnBuildNeighborList(User* source, UserChanList &include_c, std::map &exceptions); /** Called before any nickchange, local or remote. This can be used to implement Q-lines etc. * Please note that although you can see remote nickchanges through this function, you should @@ -1327,12 +1327,6 @@ class CoreExport Module : public Extensible virtual ModResult OnNumeric(User* user, unsigned int numeric, const std::string &text); - /** Called for every time the user's host or ident changes, to indicate wether or not the 'Changing host' - * message should be sent, if enabled. Certain modules such as auditorium may opt to hide this message - * even if it is enabled. - */ - virtual ModResult OnHostCycle(User* user); - /** Called whenever a result from /WHO is about to be returned * @param source The user running the /WHO query * @param user The user that this line of the query is about diff --git a/include/users.h b/include/users.h index 6f656a51b..ac3b2b459 100644 --- a/include/users.h +++ b/include/users.h @@ -715,7 +715,7 @@ class CoreExport User : public StreamSocket /** Write to all users that can see this user (including this user in the list), appending CR/LF * @param text A std::string to send to the users */ - void WriteCommon(const std::string &text); + void WriteCommonRaw(const std::string &line, bool include_self = true); /** Write to all users that can see this user (including this user in the list), appending CR/LF * @param text The format string for text to send to the users @@ -729,11 +729,6 @@ class CoreExport User : public StreamSocket */ void WriteCommonExcept(const char* text, ...) CUSTOM_PRINTF(2, 3); - /** Write to all users that can see this user (not including this user in the list), appending CR/LF - * @param text A std::string to send to the users - */ - void WriteCommonExcept(const std::string &text); - /** Write a quit message to all common users, as in User::WriteCommonExcept but with a specific * quit message for opers only. * @param normal_text Normal user quit message -- cgit v1.2.3