]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Fix build of m_spanningtree and display of dependency regeneration
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index 836fb31858963cb7e4ee9f0d57d5d7d284b17b52..94f0841257dc7afccb93e4d7e05eade36100eea7 100644 (file)
 #include "commands/cmd_stats.h"
 #include "socket.h"
 #include "xline.h"
-#include "transport.h"
-
-#include "m_spanningtree/cachetimer.h"
-#include "m_spanningtree/resolvers.h"
-#include "m_spanningtree/main.h"
-#include "m_spanningtree/utils.h"
-#include "m_spanningtree/treeserver.h"
-#include "m_spanningtree/link.h"
-#include "m_spanningtree/treesocket.h"
-#include "m_spanningtree/rconnect.h"
-#include "m_spanningtree/rsquit.h"
-#include "m_spanningtree/protocolinterface.h"
+#include "../transport.h"
+
+#include "cachetimer.h"
+#include "resolvers.h"
+#include "main.h"
+#include "utils.h"
+#include "treeserver.h"
+#include "link.h"
+#include "treesocket.h"
+#include "rconnect.h"
+#include "rsquit.h"
+#include "protocolinterface.h"
 
 /* $ModDep: m_spanningtree/cachetimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h m_spanningtree/protocolinterface.h */
 
@@ -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);
@@ -677,22 +677,16 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick)
 
 void ModuleSpanningTree::OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
 {
-       if (loopCall)
-               return;
-       if ((source) && (IS_LOCAL(source)))
+       std::deque<std::string> params;
+       params.push_back(chan->name);
+       params.push_back(user->uuid);
+       params.push_back(":"+reason);
+       if (IS_LOCAL(source))
        {
-               std::deque<std::string> params;
-               params.push_back(chan->name);
-               params.push_back(user->uuid);
-               params.push_back(":"+reason);
                Utils->DoOneToMany(source->uuid,"KICK",params);
        }
-       else if (!source)
+       else if (IS_FAKE(source) && source != Utils->ServerUser)
        {
-               std::deque<std::string> params;
-               params.push_back(chan->name);
-               params.push_back(user->uuid);
-               params.push_back(":"+reason);
                Utils->DoOneToMany(ServerInstance->Config->GetSID(),"KICK",params);
        }
 }
@@ -712,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);
 }
@@ -946,7 +942,7 @@ Version ModuleSpanningTree::GetVersion()
  */
 void ModuleSpanningTree::Prioritize()
 {
-       ServerInstance->Modules->SetModulePriority(this, PRIORITY_LAST);
+       ServerInstance->Modules->SetPriority(this, PRIORITY_LAST);
 }
 
 MODULE_INIT(ModuleSpanningTree)