]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Use TargetTypeFlags instead of int in a few places.
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 25 Oct 2008 13:14:23 +0000 (13:14 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 25 Oct 2008 13:14:23 +0000 (13:14 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10711 e03df62e-2008-0410-955e-edbf42e46eb7

include/modules.h
src/modules.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/main.h
src/modules/m_taxonomy.cpp

index a625a082c9cf96d54a8c3263be00767053adb72d..bb0eeec324894db347132e0a0ed1b1d14b23c893 100644 (file)
@@ -861,7 +861,7 @@ class CoreExport Module : public Extensible
         * @param target The Channel* or User* that modes should be sent for
         * @param modeline The modes and parameters to be sent
         */
-       virtual void ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline);
+       virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::string &modeline);
 
        /** Implemented by modules which provide the ability to link servers.
         * These modules will implement this method, which allows metadata (extra data added to
@@ -877,7 +877,7 @@ class CoreExport Module : public Extensible
         * @param extname The extension name to send metadata for
         * @param extdata Encoded data for this extension name, which will be encoded at the oppsite end by an identical module using OnDecodeMetaData
         */
-       virtual void ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata);
+       virtual void ProtoSendMetaData(void* opaque, TargetTypeFlags target_type, void* target, const std::string &extname, const std::string &extdata);
        
        /** Called after every WALLOPS command.
         * @param user The user sending the WALLOPS
index 6d04a8b17ec63bf6e34c8ee24fad58ed3e667e9a..4eca9492e0c95517f3f574bb09c9ebbb466daee2 100644 (file)
@@ -170,12 +170,12 @@ void              Module::OnPostLocalTopicChange(User*, Channel*, const std::string&) { }
 void           Module::OnGetServerDescription(const std::string&, std::string&) { }
 void           Module::OnSyncUser(User*, Module*, void*) { }
 void           Module::OnSyncChannel(Channel*, Module*, void*) { }
-void           Module::ProtoSendMode(void*, int, void*, const std::string&) { }
+void           Module::ProtoSendMode(void*, TargetTypeFlags, void*, const std::string&) { }
 void           Module::OnSyncChannelMetaData(Channel*, Module*, void*, const std::string&, bool) { }
 void           Module::OnSyncUserMetaData(User*, Module*, void*, const std::string&, bool) { }
 void           Module::OnSyncOtherMetaData(Module*, void*, bool) { }
 void           Module::OnDecodeMetaData(int, void*, const std::string&, const std::string&) { }
-void           Module::ProtoSendMetaData(void*, int, void*, const std::string&, const std::string&) { }
+void           Module::ProtoSendMetaData(void*, TargetTypeFlags, void*, const std::string&, const std::string&) { }
 void           Module::OnWallops(User*, const std::string&) { }
 void           Module::OnChangeHost(User*, const std::string&) { }
 void           Module::OnChangeName(User*, const std::string&) { }
index e714c9c13187da2bb003c9b350f46008198cee88..42547fbdc8c57bb27c947ebdb991a5c0592eb67a 100644 (file)
@@ -847,7 +847,7 @@ int ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg)
        return 0;
 }
 
-void ModuleSpanningTree::ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline)
+void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::string &modeline)
 {
        TreeSocket* s = (TreeSocket*)opaque;
        std::string output_text;
@@ -861,7 +861,7 @@ void ModuleSpanningTree::ProtoSendMode(void* opaque, int target_type, void* targ
                        User* u = (User*)target;
                        s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" FMODE "+u->uuid+" "+ConvToStr(u->age)+" "+output_text);
                }
-               else
+               else if (target_type == TYPE_CHANNEL)
                {
                        Channel* c = (Channel*)target;
                        s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" FMODE "+c->name+" "+ConvToStr(c->age)+" "+output_text);
@@ -869,7 +869,7 @@ void ModuleSpanningTree::ProtoSendMode(void* opaque, int target_type, void* targ
        }
 }
 
-void ModuleSpanningTree::ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata)
+void ModuleSpanningTree::ProtoSendMetaData(void* opaque, TargetTypeFlags target_type, void* target, const std::string &extname, const std::string &extdata)
 {
        TreeSocket* s = (TreeSocket*)opaque;
        if (target)
index 363dfdef270faf19c189b2281e58a518286a0096..16b2c7574baab7d2a38679d43c7bff7b3ea05b38 100644 (file)
@@ -177,8 +177,8 @@ class ModuleSpanningTree : public Module
        virtual void OnMode(User* user, void* dest, int target_type, const std::string &text);
        virtual int OnStats(char statschar, User* user, string_list &results);
        virtual int OnSetAway(User* user, const std::string &awaymsg);
-       virtual void ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline);
-       virtual void ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata);
+       virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::string &modeline);
+       virtual void ProtoSendMetaData(void* opaque, TargetTypeFlags target_type, void* target, const std::string &extname, const std::string &extdata);
        virtual void OnEvent(Event* event);
        virtual ~ModuleSpanningTree();
        virtual Version GetVersion();
index e9df6221d175628914358c02eda3b043068494d9..fc7b0bf1112cc476f2d04d4b7d0c03f76396abf7 100644 (file)
@@ -69,7 +69,7 @@ class ModuleTaxonomy : public Module
        }
 
 
-       void ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata)
+       void ProtoSendMetaData(void* opaque, TargetTypeFlags target_type, void* target, const std::string &extname, const std::string &extdata)
        {
                if (target_type == TYPE_USER)
                {