]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hostchange.cpp
When a server sends a SERVER command with <5 params, dont just close the connection...
[user/henk/code/inspircd.git] / src / modules / m_hostchange.cpp
index b2db6d00427f05d83d27db087bd32e2cec92406c..cf85a3900f3037969c61ac147ba570de1599ac79 100644 (file)
@@ -12,9 +12,7 @@
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
+#include "wildcard.h"
 
 /* $ModDesc: Provides masking of user hostnames in a different way to m_cloaking */
 
@@ -100,13 +98,13 @@ class ModuleHostChange : public Module
        {
                for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++)
                {
-                       if (ServerInstance->MatchText(std::string(user->ident)+"@"+std::string(user->host),i->first))
+                       if (((match(user->MakeHost(),i->first.c_str(),true)) || (match(user->MakeHostIP(),i->first.c_str()))))
                        {
-                               Host* h = (Host*)i->second;
+                               Host* h = i->second;
 
-                               if (!i->second->ports.empty())
+                               if (!h->ports.empty())
                                {
-                                       irc::portparser portrange(i->second->ports, false);
+                                       irc::portparser portrange(h->ports, false);
                                        long portno = -1;
                                        bool foundany = false;