]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Convert WriteNumeric() calls to pass the parameters of the numeric as method parameters
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index 98cf3188fe677cfc8908a21948cb0af7a3ae4635..ade8359ba4a85463ad714e1e7c40243544f553bc 100644 (file)
@@ -37,7 +37,7 @@
 
 ModuleSpanningTree::ModuleSpanningTree()
        : rconnect(this), rsquit(this), map(this)
-       , commands(NULL)
+       , commands(this)
        , currmembid(0)
        , eventprov(this, "event/spanningtree")
        , DNS(this, "DNS")
@@ -89,7 +89,6 @@ void ModuleSpanningTree::init()
 
        Utils = new SpanningTreeUtilities(this);
        Utils->TreeRoot = new TreeServer;
-       commands = new SpanningTreeCommands(this);
 
        ServerInstance->PI = &protocolinterface;
 
@@ -128,16 +127,15 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
        else if ((Current->Hidden) && (!user->IsOper()))
                return;
 
-       user->WriteNumeric(RPL_LINKS, "%s %s :%d %s",   Current->GetName().c_str(),
-                       (Utils->FlatLinks && (!user->IsOper())) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(),
-                       (Utils->FlatLinks && (!user->IsOper())) ? 0 : hops,
-                       Current->GetDesc().c_str());
+       user->WriteNumeric(RPL_LINKS, Current->GetName(),
+                       (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->ServerName : Parent),
+                       InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str()));
 }
 
 void ModuleSpanningTree::HandleLinks(const std::vector<std::string>& parameters, User* user)
 {
        ShowLinks(Utils->TreeRoot,user,0);
-       user->WriteNumeric(RPL_ENDOFLINKS, "* :End of /LINKS list.");
+       user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list.");
 }
 
 std::string ModuleSpanningTree::TimeToStr(time_t secs)
@@ -305,11 +303,11 @@ ModResult ModuleSpanningTree::HandleVersion(const std::vector<std::string>& para
                // or the server is a 2.0 server and does not send a full version.
                bool showfull = ((user->IsOper()) && (!found->GetFullVersion().empty()));
                const std::string& Version = (showfull ? found->GetFullVersion() : found->GetVersion());
-               user->WriteNumeric(RPL_VERSION, ":%s", Version.c_str());
+               user->WriteNumeric(RPL_VERSION, Version);
        }
        else
        {
-               user->WriteNumeric(ERR_NOSUCHSERVER, "%s :No such server", parameters[0].c_str());
+               user->WriteNumeric(ERR_NOSUCHSERVER, parameters[0], "No such server");
        }
        return MOD_RES_DENY;
 }
@@ -358,7 +356,7 @@ ModResult ModuleSpanningTree::HandleConnect(const std::vector<std::string>& para
        return MOD_RES_DENY;
 }
 
-void ModuleSpanningTree::OnUserInvite(User* source,User* dest,Channel* channel, time_t expiry)
+void ModuleSpanningTree::OnUserInvite(User* source, User* dest, Channel* channel, time_t expiry, unsigned int notifyrank, CUList& notifyexcepts)
 {
        if (IS_LOCAL(source))
        {
@@ -736,7 +734,6 @@ ModuleSpanningTree::~ModuleSpanningTree()
        SetLocalUsersServer(newsrv);
 
        delete Utils;
-       delete commands;
 }
 
 Version ModuleSpanningTree::GetVersion()