From adad79af7669a698d037160f1e6f2d69f59a5ed3 Mon Sep 17 00:00:00 2001 From: w00t Date: Sat, 25 Oct 2008 12:21:14 +0000 Subject: Move spanningtree to use OnChangeLocalUserHost instead of OnChangeHost, this makes more sense, and also means we can call OnChangeHost for remote clients too, making it actually match it's documentation for the first time ever! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10702 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 8 +++----- src/modules/m_spanningtree/main.h | 2 +- src/users.cpp | 3 ++- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 86d511a2a..e714c9c13 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -49,7 +49,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) { I_OnPreCommand, I_OnGetServerDescription, I_OnUserInvite, I_OnPostLocalTopicChange, I_OnWallops, I_OnUserNotice, I_OnUserMessage, I_OnBackgroundTimer, - I_OnUserJoin, I_OnChangeHost, I_OnChangeName, I_OnUserPart, + I_OnUserJoin, I_OnChangeLocalUserHost, I_OnChangeName, I_OnUserPart, I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, I_OnOper, I_OnAddLine, I_OnDelLine, I_ProtoSendMode, I_OnMode, I_OnStats, I_ProtoSendMetaData, I_OnEvent, I_OnSetAway, I_OnPostCommand @@ -617,14 +617,12 @@ void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, boo } } -void ModuleSpanningTree::OnChangeHost(User* user, const std::string &newhost) +int ModuleSpanningTree::OnChangeLocalUserHost(User* user, const std::string &newhost) { - // only occurs for local clients - if (user->registered != REG_ALL) - return; std::deque params; params.push_back(newhost); Utils->DoOneToMany(user->uuid,"FHOST",params); + return 0; } void ModuleSpanningTree::OnChangeName(User* user, const std::string &gecos) diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 8cfcaaa02..363dfdef2 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -162,7 +162,7 @@ class ModuleSpanningTree : public Module virtual void OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list); virtual void OnBackgroundTimer(time_t curtime); virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent); - virtual void OnChangeHost(User* user, const std::string &newhost); + virtual int OnChangeLocalUserHost(User* user, const std::string &newhost); virtual void OnChangeName(User* user, const std::string &gecos); virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent); virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message); diff --git a/src/users.cpp b/src/users.cpp index 784783086..bb427523a 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1672,9 +1672,10 @@ bool User::ChangeDisplayedHost(const char* shost) FOREACH_RESULT(I_OnChangeLocalUserHost,OnChangeLocalUserHost(this,shost)); if (MOD_RESULT) return false; - FOREACH_MOD(I_OnChangeHost,OnChangeHost(this,shost)); } + FOREACH_MOD(I_OnChangeHost, OnChangeHost(this,shost)); + int MOD_RESULT = 0; FOREACH_RESULT(I_OnHostCycle, OnHostCycle(this)); -- cgit v1.2.3