X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fprotocolinterface.cpp;h=ca4147fea254807ad7006001bf98a3e357c76bb9;hb=9375c633371ee8d25adc5cf756590077e5100bb5;hp=efc00334d96faf5f4ec791b665a6160e1696600c;hpb=fcacc8e0306382bc3f938073092c3729d77e2b41;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index efc00334d..ca4147fea 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -48,7 +48,7 @@ void SpanningTreeProtocolInterface::GetServerList(ProtoServerList &sl) bool SpanningTreeProtocolInterface::SendEncapsulatedData(const parameterlist &encap) { - if (encap[0].find('*') != std::string::npos) + if (encap[0].find_first_of("*?") != std::string::npos) { Utils->DoOneToMany(ServerInstance->Config->GetSID(), "ENCAP", encap); return true; @@ -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); }