]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
m_spanningtree SVSNICK needs 3 parameters
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index 08986d53c400d17880ceddf3f1714450a246da0c..635dc284b754c79f3cb409b53c200ea3acc5368a 100644 (file)
@@ -189,7 +189,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;
                        }
                }
@@ -209,7 +209,11 @@ class ModuleServicesAccount : public Module
 
        ModResult OnCheckBan(User* user, Channel* chan, const std::string& mask)
        {
-               if (mask[1] == ':')
+               static bool checking = false;
+               if (checking)
+                       return MOD_RES_PASSTHRU;
+
+               if ((mask.length() > 2) && (mask[1] == ':'))
                {
                        if (mask[0] == 'R')
                        {
@@ -226,7 +230,11 @@ class ModuleServicesAccount : public Module
 
                                /* If we made it this far we know the user isn't registered
                                        so just deny if it matches */
-                               if (chan->GetExtBanStatus(user, 'U') == MOD_RES_DENY)
+                               checking = true;
+                               bool result = chan->CheckBan(user, mask.substr(2));
+                               checking = false;
+
+                               if (result)
                                        return MOD_RES_DENY;
                        }
                }