]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
As we have an enum for type, why not ..use it?
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 25 Oct 2008 13:14:22 +0000 (13:14 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 25 Oct 2008 13:14:22 +0000 (13:14 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10710 e03df62e-2008-0410-955e-edbf42e46eb7

include/protocol.h
src/modules/m_spanningtree/protocolinterface.cpp
src/modules/m_spanningtree/protocolinterface.h

index 3d8f86cca879635169d060e366b9bf804984c0b8..9634ee4ec77cfda3eb9d0b9a72ab73ece38d25e6 100644 (file)
@@ -56,7 +56,7 @@ class ProtocolInterface : public Extensible
         * @param key The 'key' of the data, e.g. "swhois" for swhois desc on a user
         * @param data The string representation of the data
         */
-       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) { }
 
        /** Send a topic change for a channel
         * @param channel The channel to change the topic for.
index 386f2bc318e3322cc5d8a9051d218504e356b3b4..9f32963a02c55adb1e645b8e9b32e675a882eff9 100644 (file)
@@ -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);
index 38b15a1edfca2e00d61beee4041ee22aa424680f..50db7bf053c156e2e1634cca9c085d1b8b771fca 100644 (file)
@@ -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);