]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
Add IP address conversion utility functions, irc::sockets::aptosa and irc::sockets...
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index ab7e30c58d5c2de83db1b0e0862ac8a1c2ec2b30..f65b89ccf407326341d6f55a0271afc8e1cb7e86 100644 (file)
@@ -32,7 +32,7 @@ public:
 
        bool Matches(User *u)
        {
-               if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext))
+               if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext) || InspIRCd::Match(u->nick+"!"+u->ident+"@"+u->GetIPString(), matchtext))
                        return true;
 
                return false;
@@ -93,6 +93,10 @@ class CommandShun : public Command
                /* 'time' is a human-readable timestring, like 2d3h2s. */
 
                std::string target = parameters[0];
+               
+               User *find = ServerInstance->FindNick(target.c_str());
+               if (find)
+                       target = std::string("*!*@") + find->GetIPString();
 
                if (parameters.size() == 1)
                {
@@ -110,10 +114,6 @@ class CommandShun : public Command
                }
                else if (parameters.size() >= 2)
                {
-                       User* find = ServerInstance->FindNick(target.c_str());
-                       if (find)
-                               target = std::string("*!*@") + find->GetIPString();
-
                        // Adding - XXX todo make this respect <insane> tag perhaps..
                        long duration;
                        std::string expr;