]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
m_filter, m_rline Remove rlines and filters when the regex engine changes or becomes...
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index ac5338332ced8956374041cecd7b8daad8c19c52..cb3f089c6c6c7376a957135021172f3b885be262 100644 (file)
@@ -37,7 +37,7 @@ class Channel_r : public ModeHandler
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
                // only a u-lined server may add or remove the +r mode.
-               if (!IS_LOCAL(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
+               if (!IS_LOCAL(source))
                {
                        // Only change the mode if it's not redundant
                        if ((adding != channel->IsModeSet('r')))
@@ -64,7 +64,7 @@ class User_r : public ModeHandler
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
-               if (!IS_LOCAL(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
+               if (!IS_LOCAL(source))
                {
                        if ((adding != dest->IsModeSet('r')))
                        {
@@ -120,16 +120,12 @@ class ModuleServicesAccount : public Module
 
        void init()
        {
-               ServerInstance->Modules->AddService(m1);
-               ServerInstance->Modules->AddService(m2);
-               ServerInstance->Modules->AddService(m3);
-               ServerInstance->Modules->AddService(m4);
-               ServerInstance->Modules->AddService(m5);
-               ServerInstance->Modules->AddService(accountname);
+               ServiceProvider* providerlist[] = { &m1, &m2, &m3, &m4, &m5, &accountname };
+               ServerInstance->Modules->AddServices(providerlist, sizeof(providerlist)/sizeof(ServiceProvider*));
                Implementation eventlist[] = { I_OnWhois, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreJoin, I_OnCheckBan,
                        I_OnDecodeMetaData, I_On005Numeric, I_OnUserPostNick, I_OnSetConnectClass };
 
-               ServerInstance->Modules->Attach(eventlist, this, 9);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        void On005Numeric(std::string &t)
@@ -175,12 +171,6 @@ class ModuleServicesAccount : public Module
                std::string *account = accountname.get(user);
                bool is_registered = account && !account->empty();
 
-               if ((ServerInstance->ULine(user->nick.c_str())) || (ServerInstance->ULine(user->server)))
-               {
-                       // user is ulined, can speak regardless
-                       return MOD_RES_PASSTHRU;
-               }
-
                if (target_type == TYPE_CHANNEL)
                {
                        Channel* c = (Channel*)dest;
@@ -189,7 +179,7 @@ class ModuleServicesAccount : public Module
                        if (c->IsModeSet('M') && !is_registered && res != MOD_RES_ALLOW)
                        {
                                // user messaging a +M channel and is not registered
-                               user->WriteNumeric(477, ""+std::string(user->nick)+" "+std::string(c->name)+" :You need to be identified to a registered account to message this channel");
+                               user->WriteNumeric(477, user->nick+" "+c->name+" :You need to be identified to a registered account to message this channel");
                                return MOD_RES_DENY;
                        }
                }
@@ -213,7 +203,7 @@ class ModuleServicesAccount : public Module
                if (checking)
                        return MOD_RES_PASSTHRU;
 
-               if (mask[1] == ':')
+               if ((mask.length() > 2) && (mask[1] == ':'))
                {
                        if (mask[0] == 'R')
                        {
@@ -259,12 +249,6 @@ class ModuleServicesAccount : public Module
 
                if (chan)
                {
-                       if ((ServerInstance->ULine(user->nick.c_str())) || (ServerInstance->ULine(user->server)))
-                       {
-                               // user is ulined, won't be stopped from joining
-                               return MOD_RES_PASSTHRU;
-                       }
-
                        if (chan->IsModeSet('R'))
                        {
                                if (!is_registered)