diff options
| author | 2012-05-19 12:36:40 +0200 | |
|---|---|---|
| committer | 2012-05-19 12:36:40 +0200 | |
| commit | 9be03b56bab1a1acd92bf9b128f2bfeb7a5c2642 (patch) | |
| tree | 37db71ef72102f93d2bdafbce7412ff9bce96b74 /src/modules/m_spanningtree/protocolinterface.cpp | |
| parent | m_spanningtree Remove low level stuff from SpanningTreeProtocolInterface::Sen... (diff) | |
| download | inspircd++-9be03b56bab1a1acd92bf9b128f2bfeb7a5c2642.tar.gz inspircd++-9be03b56bab1a1acd92bf9b128f2bfeb7a5c2642.tar.bz2 inspircd++-9be03b56bab1a1acd92bf9b128f2bfeb7a5c2642.zip | |
m_spanningtree Kill duplicated code in OnUserMessage/Notice, put code shared with the protocol interface into the utility class
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 0e8e09916..243711453 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -149,31 +149,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->second->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) |
