]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/protocolinterface.cpp
Add basic stuff for protocol interface and implement a couple of the methods. It...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / protocolinterface.cpp
1 #include "inspircd.h"
2 #include "m_spanningtree/main.h"
3 #include "m_spanningtree/utils.h"
4 #include "m_spanningtree/protocolinterface.h"
5
6 void SpanningTreeProtocolInterface::SendEncapsulatedData(parameterlist &encap)
7 {
8         Utils->DoOneToMany(ServerInstance->Config->GetSID(), "ENCAP", encap);
9 }
10
11 void SpanningTreeProtocolInterface::SendMetaData(void* target, int type, const std::string &key, const std::string &data)
12 {
13         parameterlist params;
14
15         switch (type)
16         {
17                 case TYPE_USER:
18                         params.push_back(((User*)target)->uuid);
19                 break;
20                 case TYPE_CHANNEL:
21                         params.push_back(((Channel*)target)->name);
22                 break;
23                 case TYPE_SERVER:
24                         params.push_back(ServerInstance->Config->GetSID());
25                 break;
26         }
27         params.push_back(key);
28         params.push_back(":" + data);
29
30         Utils->DoOneToMany(ServerInstance->Config->GetSID(),"METADATA",params);
31 }
32
33 void SpanningTreeProtocolInterface::SendTopic(Channel* channel, std::string &topic)
34 {
35         parameterlist params;
36
37         params.push_back(channel->name);
38         params.push_back(ConvToStr(ServerInstance->Time()));
39         params.push_back(ServerInstance->Config->ServerName);
40         params.push_back(":" + topic);
41
42         Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FTOPIC", params);
43 }
44
45 void SpanningTreeProtocolInterface::SendMode(const std::string &origin, const std::string &target, parameterlist &modedata)
46 {
47 }
48
49 void SpanningTreeProtocolInterface::SendOperNotice(const std::string &text)
50 {
51 }
52
53 void SpanningTreeProtocolInterface::SendModeNotice(const std::string &modes, const std::string &text)
54 {
55 }
56
57 void SpanningTreeProtocolInterface::SendSNONotice(const std::string &snomask, const std::string &text)
58 {
59 }
60
61 void SpanningTreeProtocolInterface::PushToClient(User* target, const std::string &rawline)
62 {
63 }
64