virtual void SendSNONotice(const std::string &snomask, const std::string &text) { }
virtual void PushToClient(User* target, const std::string &rawline) { }
+
+ virtual void SendChannelPrivmsg(Channel* target, char status, const std::string &text) { }
+
+ virtual void SendChannelNotice(Channel* target, char status, const std::string &text) { }
};
#endif
#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)
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);
+}
+
{
SpanningTreeUtilities* Utils;
ModuleSpanningTree* Module;
+ void SendChannel(Channel* target, char status, const std::string &text);
public:
SpanningTreeProtocolInterface(ModuleSpanningTree* mod, SpanningTreeUtilities* util, InspIRCd* Instance) : ProtocolInterface(Instance), Utils(util), Module(mod) { }
virtual ~SpanningTreeProtocolInterface() { }
virtual void SendModeNotice(const std::string &modes, const std::string &text);
virtual void SendSNONotice(const std::string &snomask, const std::string &text);
virtual void PushToClient(User* target, const std::string &rawline);
+ virtual void SendChannelPrivmsg(Channel* target, char status, const std::string &text);
+ virtual void SendChannelNotice(Channel* target, char status, const std::string &text);
};
#endif