]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
m_spanningtree Replace manual string building of outgoing commands with CmdBuilder...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index 21eaaa00dce6cb455a9c7c60d1c7bef68436b044..e10781198dca3f080887f9898dd542ccb910c16b 100644 (file)
@@ -50,7 +50,7 @@ SpanningTreeCommands::SpanningTreeCommands(ModuleSpanningTree* module)
        fmode(module), ftopic(module), fhost(module), fident(module), fname(module),
        away(module), addline(module), delline(module), encap(module), idle(module),
        nick(module), ping(module), pong(module), push(module), save(module),
-       server(module), squit(module), snonotice(module), version(module),
+       server(module), squit(module), snonotice(module),
        burst(module), endburst(module), sinfo(module)
 {
 }
@@ -189,7 +189,7 @@ restart:
                        {
                                // They did, send a ping to them
                                s->SetNextPingTime(curtime + Utils->PingFreq);
-                               s->GetSocket()->WriteLine(":" + ServerInstance->Config->GetSID() + " PING " + s->GetID());
+                               s->GetSocket()->WriteLine(CmdBuilder("PING").push(s->GetID()));
                                s->LastPingMsec = ts;
                        }
                        else
@@ -649,6 +649,16 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string &parameter)
 
 void ModuleSpanningTree::ReadConfig(ConfigStatus& status)
 {
+       // Did this rehash change the description of this server?
+       const std::string& newdesc = ServerInstance->Config->ServerDesc;
+       if (newdesc != Utils->TreeRoot->GetDesc())
+       {
+               // Broadcast a SINFO desc message to let the network know about the new description. This is the description
+               // string that is sent in the SERVER message initially and shown for example in WHOIS.
+               // We don't need to update the field itself in the Server object - the core does that.
+               CommandSInfo::Builder(Utils->TreeRoot, "desc", newdesc).Broadcast();
+       }
+
        // Re-read config stuff
        try
        {