X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_privmsg.cpp;h=49845162cac0a85b619d43a5e9dc9cc6cce9b0f4;hb=8f27fefa75e2952e7ab8757eb9fe4af4586817f0;hp=5eac99dd552df533560a406d9583e143d26174ae;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index 5eac99dd5..49845162c 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -56,7 +56,9 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us Channel *chan; CUList except_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; @@ -99,7 +101,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us if (chan) { - if (IS_LOCAL(user) && chan->GetPrefixValue(user) < VOICE_VALUE) + if (localuser && chan->GetPrefixValue(user) < VOICE_VALUE) { if (chan->IsModeSet('n') && !chan->HasUser(user)) { @@ -169,7 +171,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us const char* destnick = parameters[0].c_str(); - if (IS_LOCAL(user)) + if (localuser) { const char* targetserver = strchr(destnick, '@'); @@ -192,7 +194,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us else dest = ServerInstance->FindNick(destnick); - if (dest) + if ((dest) && (dest->registered == REG_ALL)) { if (parameters[1].empty()) { @@ -200,7 +202,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us return CMD_FAILURE; } - if (IS_AWAY(dest)) + if (dest->IsAway()) { /* auto respond with aweh msg */ user->WriteNumeric(301, "%s %s :%s", user->nick.c_str(), dest->nick.c_str(), dest->awaymsg.c_str());