diff options
| author | 2012-07-04 23:11:01 +0200 | |
|---|---|---|
| committer | 2013-04-12 21:03:05 +0200 | |
| commit | da28fe0b8c0bec9ab111044b1004f24cbf2d742e (patch) | |
| tree | aa2b3e206af49087e9ecafba600ce7802f4b82fb /src/modules/m_spanningtree/protocolinterface.cpp | |
| parent | m_spanningtree Change TreeServerList to be a set, get rid of a function dedic... (diff) | |
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()
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
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) |
