X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_notice.cpp;h=ec60127b752b21eebf274f20218b00c7c76afa31;hb=2ac7d154d9dadbc3d836434b786aa0e8c1660381;hp=b060a534fa2211f4dc99afd5ebd833ab2b740a66;hpb=35ce47718b6021115c9b12e7e63a7daf8bb4a900;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index b060a534f..ec60127b7 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -57,7 +57,9 @@ CmdResult CommandNotice::Handle (const std::vector& 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; @@ -68,7 +70,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, exempt_list)); + FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, exempt_list, MSG_NOTICE)); if (MOD_RESULT == MOD_RES_DENY) return CMD_FAILURE; const char* text = temp.c_str(); @@ -79,7 +81,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use { user->SendAll("NOTICE", "%s", text); } - FOREACH_MOD(I_OnUserNotice,OnUserNotice(user, (void*)parameters[0].c_str(), TYPE_SERVER, text, 0, exempt_list)); + FOREACH_MOD(I_OnUserMessage,OnUserMessage(user, (void*)parameters[0].c_str(), TYPE_SERVER, text, 0, exempt_list, MSG_NOTICE)); return CMD_SUCCESS; } char status = 0; @@ -98,7 +100,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use if (chan) { - if (IS_LOCAL(user)) + if (localuser) { if ((chan->IsModeSet('n')) && (!chan->HasUser(user))) { @@ -123,7 +125,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status, exempt_list)); + FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status, exempt_list, MSG_NOTICE)); if (MOD_RESULT == MOD_RES_DENY) return CMD_FAILURE; @@ -153,7 +155,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %s :%s", chan->name.c_str(), text); } - FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,text,status,exempt_list)); + FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,chan,TYPE_CHANNEL,text,status,exempt_list,MSG_NOTICE)); } else { @@ -166,7 +168,7 @@ CmdResult CommandNotice::Handle (const std::vector& 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& parameters, Use else dest = ServerInstance->FindNick(destnick); - if (dest) + if ((dest) && (dest->registered == REG_ALL)) { if (parameters[1].empty()) { @@ -199,7 +201,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user,dest,TYPE_USER,temp,0,exempt_list)); + FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user, dest, TYPE_USER, temp, 0, exempt_list, MSG_NOTICE)); if (MOD_RESULT == MOD_RES_DENY) { return CMD_FAILURE; } @@ -213,7 +215,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use user->WriteTo(dest, "NOTICE %s :%s", dest->nick.c_str(), text); } - FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,text,0,exempt_list)); + FOREACH_MOD(I_OnUserMessage, OnUserMessage(user, dest, TYPE_USER, text, 0, exempt_list, MSG_NOTICE)); } else {