summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-24 02:53:45 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-24 02:53:45 +0000
commit0da6b3a13def40e8fd002b9fc60f955467f6372d (patch)
treed4aa39ece30255afe7447fb46f39c45c39d679a3 /src/modules/m_spanningtree
parent5f309503fa985faa5b255246fc0415455c1c65ee (diff)
OnRehash changes: split to multiple hooks to clarify use and prevent explosion of rehashes on a /REHASH *
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11388 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp10
-rw-r--r--src/modules/m_spanningtree/main.h3
2 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 37ed06c3a..45aea56ec 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -50,11 +50,11 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
I_OnPreCommand, I_OnGetServerDescription, I_OnUserInvite, I_OnPostLocalTopicChange,
I_OnWallops, I_OnUserNotice, I_OnUserMessage, I_OnBackgroundTimer,
I_OnUserJoin, I_OnChangeLocalUserHost, I_OnChangeName, I_OnUserPart, I_OnUnloadModule,
- I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash,
+ I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, I_OnPreRehash,
I_OnOper, I_OnAddLine, I_OnDelLine, I_ProtoSendMode, I_OnMode, I_OnLoadModule,
I_OnStats, I_ProtoSendMetaData, I_OnEvent, I_OnSetAway, I_OnPostCommand
};
- ServerInstance->Modules->Attach(eventlist, this, 29);
+ ServerInstance->Modules->Attach(eventlist, this, 30);
delete ServerInstance->PI;
ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
@@ -706,19 +706,21 @@ void ModuleSpanningTree::OnRemoteKill(User* source, User* dest, const std::strin
Utils->DoOneToMany(source->uuid,"KILL",params);
}
-void ModuleSpanningTree::OnRehash(User* user, const std::string &parameter)
+void ModuleSpanningTree::OnPreRehash(User* user, const std::string &parameter)
{
ServerInstance->Logs->Log("remoterehash", DEBUG, "called with param %s", parameter.c_str());
// Send out to other servers
if (!parameter.empty() && parameter[0] != '-')
{
- ServerInstance->Logs->Log("remoterehash", DEBUG, "sending out lol");
std::deque<std::string> params;
params.push_back(parameter);
Utils->DoOneToAllButSender(user ? user->uuid : ServerInstance->Config->GetSID(), "REHASH", params, user ? user->server : ServerInstance->Config->ServerName);
}
+}
+void ModuleSpanningTree::OnRehash(User* user)
+{
// Re-read config stuff
Utils->ReadConfiguration(true);
}
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 5333b64d4..3935c3dd6 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -173,7 +173,8 @@ class ModuleSpanningTree : public Module
virtual void OnUserPostNick(User* user, const std::string &oldnick);
virtual void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent);
virtual void OnRemoteKill(User* source, User* dest, const std::string &reason, const std::string &operreason);
- virtual void OnRehash(User* user, const std::string &parameter);
+ virtual void OnPreRehash(User* user, const std::string &parameter);
+ virtual void OnRehash(User* user);
virtual void OnOper(User* user, const std::string &opertype);
void OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason);
virtual void OnAddLine(User *u, XLine *x);