]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_notice.cpp
Merge pull request #543 from SaberUK/master+sizeparam-removal
[user/henk/code/inspircd.git] / src / commands / cmd_notice.cpp
index b060a534fa2211f4dc99afd5ebd833ab2b740a66..d0845a0517a6f5a22b4150462aeb913b898a6d9d 100644 (file)
@@ -57,7 +57,9 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
 
        CUList exempt_list;
 
-       user->idle_lastmsg = ServerInstance->Time();
+       LocalUser* localuser = IS_LOCAL(user);
+       if (localuser)
+               localuser->idle_lastmsg = ServerInstance->Time();
 
        if (ServerInstance->Parser->LoopCall(user, this, parameters, 0))
                return CMD_SUCCESS;
@@ -98,7 +100,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
 
                if (chan)
                {
-                       if (IS_LOCAL(user))
+                       if (localuser)
                        {
                                if ((chan->IsModeSet('n')) && (!chan->HasUser(user)))
                                {
@@ -166,7 +168,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
 
        const char* destnick = parameters[0].c_str();
 
-       if (IS_LOCAL(user))
+       if (localuser)
        {
                const char* targetserver = strchr(destnick, '@');
 
@@ -189,7 +191,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
        else
                dest = ServerInstance->FindNick(destnick);
 
-       if (dest)
+       if ((dest) && (dest->registered == REG_ALL))
        {
                if (parameters[1].empty())
                {