]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services.cpp
The module hook is kinda required.
[user/henk/code/inspircd.git] / src / modules / m_services.cpp
index bc6c68864533e698244258df253a03f7f1718011..92be81f9d22711609ae545509708794399f1f491 100644 (file)
@@ -30,8 +30,14 @@ class Channel_r : public ModeHandler
                // only a u-lined server may add or remove the +r mode.
                if ((ServerInstance->ULine(source->nick.c_str())) || (ServerInstance->ULine(source->server)) || (!*source->server || (source->nick.find('.') != std::string::npos)))
                {
-                       channel->SetMode('r',adding);
-                       return MODEACTION_ALLOW;
+                       // Only change the mode if it's not redundant
+                       if ((adding && !channel->IsModeSet('r')) || (!adding && channel->IsModeSet('r')))
+                       {
+                               channel->SetMode('r',adding);
+                               return MODEACTION_ALLOW;
+                       }
+
+                       return MODEACTION_DENY;
                }
                else
                {
@@ -116,7 +122,7 @@ class ModuleServices : public Module
                if (!ServerInstance->Modes->AddMode(m1) || !ServerInstance->Modes->AddMode(m2) || !ServerInstance->Modes->AddMode(m3)
                        || !ServerInstance->Modes->AddMode(m4) || !ServerInstance->Modes->AddMode(m5))
                {
-                       throw ModuleException("Could not add user and channel modes!");
+                       throw ModuleException("You cannot load m_services.so and m_services_account.so at the same time (or some other module has claimed our modes)!");
                }
 
                kludgeme = false;
@@ -231,7 +237,7 @@ class ModuleServices : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
+               return Version("$Id$",VF_COMMON|VF_VENDOR,API_VERSION);
        }
 };