]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Prepend nick to user->MakeHostIP().
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 15 Jan 2007 08:11:34 +0000 (08:11 +0000)
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 15 Jan 2007 08:11:34 +0000 (08:11 +0000)
Maybe we should have a GetFullIPHost() or something to match GetFullHost() and GetFullRealHost?

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6346 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_banredirect.cpp

index dac9b9d43bad5e0bd96bdbb4072f92c7196d8ab5..269c22db4508f14d2756ebaa3c35de0074bacbe6 100644 (file)
@@ -97,7 +97,7 @@ class BanRedirect : public ModeWatcher
                                }
                        }
                                
-                       param.assign(mask[NICK]).append("!").append(mask[IDENT]).append("@").append(mask[HOST]);
+                       param.assign(mask[NICK]).append(1, '!').append(mask[IDENT]).append(1, '@').append(mask[HOST]);
                        
                        Srv->Log(DEBUG, "mask[NICK] = '%s', mask[IDENT] = '%s', mask[HOST] = '%s', mask[CHAN] = '%s'", mask[NICK].c_str(), mask[IDENT].c_str(), mask[HOST].c_str(), mask[CHAN].c_str());
        
@@ -222,7 +222,12 @@ class ModuleBanRedirect : public Module
                        {
                                /* We actually had some ban redirects to check */
                                
-                               std::string ipmask(user->MakeHostIP());
+                               /* This was replaced with user->MakeHostIP() when I had a snprintf(), but MakeHostIP() doesn't seem to add the nick.
+                                * Maybe we should have a GetFullIPHost() or something to match GetFullHost() and GetFullRealHost?
+                                */
+                               std::string ipmask(user->nick);
+                               ipmask.append(1, '!').append(user->MakeHostIP());
+                               Srv->Log(DEBUG, "Matching against %s, %s and %s", user->GetFullRealHost(), user->GetFullHost(), ipmask.c_str());
                                
                                for(BanRedirectList::iterator redir = redirects->begin(); redir != redirects->end(); redir++)
                                {