]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules.cpp
Heres the beef so far
[user/henk/code/inspircd.git] / src / modules.cpp
index 0f7992a38cf193104f74466a0d7221a69f666ad6..29d4b555512b18c1c508a28aeac2055f3273893d 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -25,6 +25,7 @@
        #include <dirent.h>
 #endif
 
+
 // version is a simple class for holding a modules version number
 Version::Version(const std::string &sversion, int flags, int api_ver)
 : version(sversion), Flags(flags), API(api_ver)
@@ -115,7 +116,7 @@ void                Module::OnPostJoin(User*, Channel*) { }
 void           Module::OnUserPart(User*, Channel*, std::string&, bool&) { }
 void           Module::OnRehash(User*, const std::string&) { }
 int            Module::OnUserPreJoin(User*, Channel*, const char*, std::string&, const std::string&) { return 0; }
-void           Module::OnMode(User*, void*, int, const std::string&) { }
+void           Module::OnMode(User*, void*, int, const std::deque<std::string>&, const std::deque<TranslateType>&) { }
 Version                Module::GetVersion() { return Version("Misconfigured", VF_VENDOR, -1); }
 void           Module::OnOper(User*, const std::string&) { }
 void           Module::OnPostOper(User*, const std::string&, const std::string &) { }
@@ -169,7 +170,7 @@ 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*, TargetTypeFlags, void*, const std::string&) { }
+void           Module::ProtoSendMode(void*, TargetTypeFlags, void*, const std::deque<std::string>&, const std::deque<TranslateType>&) { }
 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) { }
@@ -237,7 +238,7 @@ void ModuleManager::DetachAll(Module* mod)
                Detach((Implementation)n, mod);
 }
 
-bool ModuleManager::SetPriority(Module* mod, PriorityState s)
+bool ModuleManager::SetModulePriority(Module* mod, Priority s)
 {
        for (size_t n = I_BEGIN + 1; n != I_END; ++n)
                SetPriority(mod, (Implementation)n, s);
@@ -245,7 +246,7 @@ bool ModuleManager::SetPriority(Module* mod, PriorityState s)
        return true;
 }
 
-bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s, Module** modules, size_t sz)
+bool ModuleManager::SetPriority(Module* mod, Implementation i, Priority s, Module** modules, size_t sz)
 {
        /** To change the priority of a module, we first find its position in the vector,
         * then we find the position of the other modules in the vector that this module
@@ -280,22 +281,22 @@ bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s,
        switch (s)
        {
                /* Dummy value */
-               case PRIO_DONTCARE:
+               case PRIORITY_DONTCARE:
                        swap = false;
                break;
                /* Module wants to be first, sod everything else */
-               case PRIO_FIRST:
+               case PRIORITY_FIRST:
                        swap_pos = 0;
                break;
                /* Module is submissive and wants to be last... awww. */
-               case PRIO_LAST:
+               case PRIORITY_LAST:
                        if (EventHandlers[i].empty())
                                swap_pos = 0;
                        else
                                swap_pos = EventHandlers[i].size() - 1;
                break;
                /* Place this module after a set of other modules */
-               case PRIO_AFTER:
+               case PRIORITY_AFTER:
                {
                        /* Find the latest possible position */
                        swap_pos = 0;
@@ -314,7 +315,7 @@ bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s,
                }
                break;
                /* Place this module before a set of other modules */
-               case PRIO_BEFORE:
+               case PRIORITY_BEFORE:
                {
                        swap_pos = EventHandlers[i].size() - 1;
                        swap = false;
@@ -387,7 +388,7 @@ bool ModuleManager::Load(const char* filename)
                 * to load (but wont abort when it encounters a bad one) and when 1 or
                 * more modules were actually loaded.
                 */
-               return (n_match > 0);
+               return (n_match > 0 ? false : true);
        }
 
        char modfile[MAXBUF];