From da28fe0b8c0bec9ab111044b1004f24cbf2d742e Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 4 Jul 2012 23:11:01 +0200 Subject: m_spanningtree Introduce new function to send channel messages Use it from the protocol interface and PRIVMSG/NOTICE handlers Unite OnUserNotice and OnUserMessage code into LocalMessage() --- src/modules/m_spanningtree/protocolinterface.cpp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src/modules/m_spanningtree/protocolinterface.cpp') diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index 0440823e6..aacf5ce8d 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -135,31 +135,16 @@ void SpanningTreeProtocolInterface::PushToClient(User* target, const std::string Utils->DoOneToOne(ServerInstance->Config->GetSID(), "PUSH", p, target->server); } -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); - for (TreeServerList::iterator i = list.begin(); i != list.end(); i++) - { - TreeSocket* Sock = (*i)->GetSocket(); - if (Sock) - Sock->WriteLine(text); - } -} - - void SpanningTreeProtocolInterface::SendChannelPrivmsg(Channel* target, char status, const std::string &text) { - SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" PRIVMSG "+target->name+" :"+text); + CUList exempt_list; + Utils->SendChannelMessage(ServerInstance->Config->GetSID(), target, text, status, exempt_list, "PRIVMSG"); } void SpanningTreeProtocolInterface::SendChannelNotice(Channel* target, char status, const std::string &text) { - SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" NOTICE "+target->name+" :"+text); + CUList exempt_list; + Utils->SendChannelMessage(ServerInstance->Config->GetSID(), target, text, status, exempt_list, "NOTICE"); } void SpanningTreeProtocolInterface::SendUserPrivmsg(User* target, const std::string &text) -- cgit v1.3.1-10-gc9f91