]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
Register a few extensions that weren't registered
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index cc941d905ab3e88480ebaba29032fc511d5e08d1..50e2c76a6fbcd756c98d50a8dc9f7c7e6d03cc1c 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) || ServerInstance->ULine(source->server))
                {
                        // 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) || ServerInstance->ULine(source->server))
                {
                        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)
@@ -189,7 +185,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;
                        }
                }