summaryrefslogtreecommitdiff
path: root/src/commands/cmd_notice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/cmd_notice.cpp')
-rw-r--r--src/commands/cmd_notice.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp
index 937feaf93..ca693d62b 100644
--- a/src/commands/cmd_notice.cpp
+++ b/src/commands/cmd_notice.cpp
@@ -120,10 +120,29 @@ CmdResult CommandNotice::Handle (const char** parameters, int pcnt, User *user)
return CMD_SUCCESS;
}
+ const char* destnick = parameters[0];
+
if (IS_LOCAL(user))
- dest = ServerInstance->FindNickOnly(parameters[0]);
+ {
+ const char* targetserver = strchr(destnick, '@');
+
+ if (targetserver)
+ {
+ char nickonly[NICKMAX+1];
+ strlcpy(nickonly, destnick, targetserver - destnick + 1);
+ dest = ServerInstance->FindNickOnly(nickonly);
+ if (dest && strcasecmp(dest->server, targetserver + 1))
+ {
+ /* Incorrect server for user */
+ user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]);
+ return CMD_FAILURE;
+ }
+ }
+ else
+ dest = ServerInstance->FindNickOnly(destnick);
+ }
else
- dest = ServerInstance->FindNick(parameters[0]);
+ dest = ServerInstance->FindNick(destnick);
if (dest)
{