]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_zline.cpp
m_dccallow Add config option to control max entries on a list
[user/henk/code/inspircd.git] / src / commands / cmd_zline.cpp
index cee7f616d5dfbd2f4467445a37bf813904f04696..91d9c6255962e1a10b6aecdbfda9e99370033e79 100644 (file)
@@ -53,9 +53,9 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
                        return CMD_FAILURE;
                }
 
-               User *u = ServerInstance->FindNick(target.c_str());
+               User *u = ServerInstance->FindNick(target);
 
-               if (u)
+               if ((u) && (u->registered == REG_ALL))
                {
                        target = u->GetIPString();
                }
@@ -84,8 +84,9 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
                        else
                        {
                                time_t c_requires_crap = duration + ServerInstance->Time();
+                               std::string timestr = ServerInstance->TimeString(c_requires_crap);
                                ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Z-line for %s, expires on %s: %s",user->nick.c_str(),ipaddr,
-                                               ServerInstance->TimeString(c_requires_crap).c_str(), parameters[2].c_str());
+                                               timestr.c_str(), parameters[2].c_str());
                        }
                        ServerInstance->XLines->ApplyLines();
                }