X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_services.cpp;h=92be81f9d22711609ae545509708794399f1f491;hb=697098bb47651b40ed9c768361d1a3b1ca452856;hp=bc6c68864533e698244258df253a03f7f1718011;hpb=d185decae97752368d5cf62311cbc0d1a52aa22c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index bc6c68864..92be81f9d 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -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); } };