X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_notice.cpp;h=ae1f6d83b0bae89bbcb2d92729b3b3c31935170b;hb=9aa6c07d92fb9c1132f06b8c5781d77ee7086edb;hp=ced17072fd0b6021cbececd78127419972d30274;hpb=3841c4b04a96389a4661535d12d5215a621d8736;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index ced17072f..ae1f6d83b 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -30,6 +30,15 @@ class CommandNotice : public Command * @return A value from CmdResult to indicate command success or failure. */ CmdResult Handle(const std::vector& parameters, User *user); + + RouteDescriptor GetRouting(User* user, const std::vector& parameters) + { + if (IS_LOCAL(user)) + // This is handled by the OnUserNotice hook to split the LoopCall pieces + return ROUTE_LOCALONLY; + else + return ROUTE_MESSAGE(parameters[0]); + } }; @@ -51,7 +60,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(ServerInstance, OnUserPreNotice, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, exempt_list)); + FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, exempt_list)); if (MOD_RESULT == MOD_RES_DENY) return CMD_FAILURE; const char* text = temp.c_str(); @@ -97,7 +106,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(ServerInstance, OnUserPreNotice, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status, exempt_list)); + FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status, exempt_list)); if (MOD_RESULT == MOD_RES_DENY) return CMD_FAILURE; @@ -150,7 +159,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use nickonly.assign(destnick, 0, targetserver - destnick); dest = ServerInstance->FindNickOnly(nickonly); - if (dest && strcasecmp(dest->server, targetserver + 1)) + if (dest && strcasecmp(dest->server.c_str(), targetserver + 1)) { /* Incorrect server for user */ user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str()); @@ -173,7 +182,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(ServerInstance, OnUserPreNotice, MOD_RESULT, (user,dest,TYPE_USER,temp,0,exempt_list)); + FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user,dest,TYPE_USER,temp,0,exempt_list)); if (MOD_RESULT == MOD_RES_DENY) { return CMD_FAILURE; }