]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
Set User::host before calling ChangeIP()
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index 21959e40069abcbc1e83af27d1bd6eb1d6a2fa89..3147d5476f40eda1f19775a88654b27b777a1831 100644 (file)
@@ -30,10 +30,10 @@ class Shun : public XLine
 public:
        std::string matchtext;
 
-       Shun(time_t s_time, long d, std::string src, std::string re, std::string shunmask)
+       Shun(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& shunmask)
                : XLine(s_time, d, src, re, "SHUN")
+               , matchtext(shunmask)
        {
-               this->matchtext = shunmask;
        }
 
        ~Shun()
@@ -114,13 +114,17 @@ class CommandShun : public Command
 
                if (parameters.size() == 1)
                {
-                       if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", user))
+                       if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "SHUN", user))
+                       {
+                               ServerInstance->SNO->WriteToSnoMask('x', "%s removed SHUN on %s", user->nick.c_str(), parameters[0].c_str());
+                       }
+                       else if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", user))
                        {
                                ServerInstance->SNO->WriteToSnoMask('x',"%s removed SHUN on %s",user->nick.c_str(),target.c_str());
                        }
                        else
                        {
-                               user->WriteServ("NOTICE %s :*** Shun %s not found in list, try /stats H.",user->nick.c_str(),target.c_str());
+                               user->WriteServ("NOTICE %s :*** Shun %s not found in list, try /stats H.", user->nick.c_str(), parameters[0].c_str());
                                return CMD_FAILURE;
                        }
                }