summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/protocolinterface.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 14:37:23 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 14:37:23 +0000
commit001861f5d2aca21531b0a20a46e44654a45a5522 (patch)
treec65b5bde81dd2af13d873ca2d7a993348ec997b5 /src/modules/m_spanningtree/protocolinterface.cpp
parent463979eb86f2f626a0a6c7b0b9742a86b35c7faa (diff)
Add protocol api functions: PI->WriteChannelPrivmsg() and PI->WriteChannelNotice() - sends with SID origin over network
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9308 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp
index 48d0f78eb..d10f7f981 100644
--- a/src/modules/m_spanningtree/protocolinterface.cpp
+++ b/src/modules/m_spanningtree/protocolinterface.cpp
@@ -1,6 +1,8 @@
#include "inspircd.h"
#include "m_spanningtree/main.h"
#include "m_spanningtree/utils.h"
+#include "m_spanningtree/treeserver.h"
+#include "m_spanningtree/treesocket.h"
#include "m_spanningtree/protocolinterface.h"
void SpanningTreeProtocolInterface::SendEncapsulatedData(parameterlist &encap)
@@ -103,3 +105,30 @@ 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);
+}
+
+void SpanningTreeProtocolInterface::SendChannelNotice(Channel* target, char status, const std::string &text)
+{
+ SendChannel(target, status, ServerInstance->Config->GetSID()+" NOTICE "+target->name+" :"+text);
+}
+