]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/protocolinterface.cpp
Fix SpanningTreeProtocolInterface::SendChannelPrivmsg() and SendChannelNotice() sendi...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / protocolinterface.cpp
index 9c489fcb48f01339ed488466594f53bd5d03b9e0..ca4147fea254807ad7006001bf98a3e357c76bb9 100644 (file)
@@ -137,9 +137,6 @@ void SpanningTreeProtocolInterface::PushToClient(User* target, const std::string
 
 void SpanningTreeProtocolInterface::SendChannel(Channel* target, char status, const std::string &text)
 {
-       std::string cname = target->name;
-       if (status)
-               cname = status + cname;
        TreeServerList list;
        CUList exempt_list;
        Utils->GetListOfServersForChannel(target,list,status,exempt_list);
@@ -154,36 +151,34 @@ void SpanningTreeProtocolInterface::SendChannel(Channel* target, char status, co
 
 void SpanningTreeProtocolInterface::SendChannelPrivmsg(Channel* target, char status, const std::string &text)
 {
-       SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" PRIVMSG "+target->name+" :"+text);
+       std::string cname = target->name;
+       if (status)
+               cname.insert(0, 1, status);
+
+       SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" PRIVMSG "+cname+" :"+text);
 }
 
 void SpanningTreeProtocolInterface::SendChannelNotice(Channel* target, char status, const std::string &text)
 {
-       SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" NOTICE "+target->name+" :"+text);
+       std::string cname = target->name;
+       if (status)
+               cname.insert(0, 1, status);
+
+       SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" NOTICE "+cname+" :"+text);
 }
 
 void SpanningTreeProtocolInterface::SendUserPrivmsg(User* target, const std::string &text)
 {
-       TreeServer* serv = Utils->FindServer(target->server);
-       if (serv)
-       {
-               TreeSocket* sock = serv->GetSocket();
-               if (sock)
-               {
-                       sock->WriteLine(":" + ServerInstance->Config->GetSID() + " PRIVMSG " + target->nick + " :"+text);
-               }
-       }
+       parameterlist p;
+       p.push_back(target->uuid);
+       p.push_back(":" + text);
+       Utils->DoOneToOne(ServerInstance->Config->GetSID(), "PRIVMSG", p, target->server);
 }
 
 void SpanningTreeProtocolInterface::SendUserNotice(User* target, const std::string &text)
 {
-       TreeServer* serv = Utils->FindServer(target->server);
-       if (serv)
-       {
-               TreeSocket* sock = serv->GetSocket();
-               if (sock)
-               {
-                       sock->WriteLine(":" + ServerInstance->Config->GetSID() + " NOTICE " + target->nick + " :"+text);
-               }
-       }
+       parameterlist p;
+       p.push_back(target->uuid);
+       p.push_back(":" + text);
+       Utils->DoOneToOne(ServerInstance->Config->GetSID(), "NOTICE", p, target->server);
 }