summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-25 13:14:22 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-25 13:14:22 +0000
commitffc039651676e0f679726b15fac4bf133e7e5bc2 (patch)
tree25e360a8d334771229acb5311db233d4cf5bd131 /src/modules/m_spanningtree
parent2b39234be281afda6d23299886b2b2b8f03df2ea (diff)
As we have an enum for type, why not ..use it?
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10710 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp11
-rw-r--r--src/modules/m_spanningtree/protocolinterface.h2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp
index 386f2bc31..9f32963a0 100644
--- a/src/modules/m_spanningtree/protocolinterface.cpp
+++ b/src/modules/m_spanningtree/protocolinterface.cpp
@@ -31,7 +31,7 @@ void SpanningTreeProtocolInterface::SendEncapsulatedData(parameterlist &encap)
Utils->DoOneToMany(ServerInstance->Config->GetSID(), "ENCAP", encap);
}
-void SpanningTreeProtocolInterface::SendMetaData(void* target, int type, const std::string &key, const std::string &data)
+void SpanningTreeProtocolInterface::SendMetaData(void* target, TargetTypeFlags type, const std::string &key, const std::string &data)
{
parameterlist params;
@@ -39,13 +39,16 @@ void SpanningTreeProtocolInterface::SendMetaData(void* target, int type, const s
{
case TYPE_USER:
params.push_back(((User*)target)->uuid);
- break;
+ break;
case TYPE_CHANNEL:
params.push_back(((Channel*)target)->name);
- break;
+ break;
case TYPE_SERVER:
params.push_back("*");
- break;
+ break;
+ default:
+ throw CoreException("I don't know how to handle TYPE_OTHER.");
+ break;
}
params.push_back(key);
params.push_back(":" + data);
diff --git a/src/modules/m_spanningtree/protocolinterface.h b/src/modules/m_spanningtree/protocolinterface.h
index 38b15a1ed..50db7bf05 100644
--- a/src/modules/m_spanningtree/protocolinterface.h
+++ b/src/modules/m_spanningtree/protocolinterface.h
@@ -14,7 +14,7 @@ class SpanningTreeProtocolInterface : public ProtocolInterface
virtual ~SpanningTreeProtocolInterface() { }
virtual void SendEncapsulatedData(parameterlist &encap);
- virtual void SendMetaData(void* target, int type, const std::string &key, const std::string &data);
+ virtual void SendMetaData(void* target, TargetTypeFlags type, const std::string &key, const std::string &data);
virtual void SendTopic(Channel* channel, std::string &topic);
virtual void SendMode(const std::string &target, parameterlist &modedata);
virtual void SendModeNotice(const std::string &modes, const std::string &text);