summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-24 17:08:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-24 17:08:47 +0000
commitf93714e66a3dc6869e97adc84f399ef84e4b189a (patch)
tree0b7a901f9deaafc5ecbcf36a0ce5e257d8a3d539 /src
parentda185282a4606a84cd39ef0d47cd2b9f6e28f94d (diff)
Added trick to allow local server to unset -r only in one specific condition (the nickchange)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2881 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_services.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index a35731370..4eea615cb 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -29,6 +29,8 @@ using namespace std;
class ModuleServices : public Module
{
Server *Srv;
+ bool kludgeme;
+
public:
ModuleServices(Server* Me)
: Module::Module(Me)
@@ -40,6 +42,8 @@ class ModuleServices : public Module
Srv->AddExtendedMode('R',MT_CHANNEL,false,0,0);
Srv->AddExtendedMode('R',MT_CLIENT,false,0,0);
Srv->AddExtendedMode('M',MT_CHANNEL,false,0,0);
+
+ kludgeme = false;
}
virtual void On005Numeric(std::string &output)
@@ -74,7 +78,9 @@ class ModuleServices : public Module
char* modechange[2];
modechange[0] = user->nick;
modechange[1] = "-r";
+ kludgeme = true;
Srv->SendMode(modechange,2,user);
+ kludgeme = false;
}
}
@@ -86,7 +92,7 @@ class ModuleServices : public Module
if (type == MT_CHANNEL)
{
// only a u-lined server may add or remove the +r mode.
- if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,"") || (strchr(user->nick,'.'))))
+ if ((kludgeme) || (Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,"") || (strchr(user->nick,'.'))))
{
log(DEBUG,"Allowing umode +r, server and nick are: '%s','%s'",user->nick,user->server);
return 1;