#include "hash.h"
#include "ircd.h"
#include "ircd_chattr.h"
+#include "ircd_features.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "match.h"
assert(0 != text);
assert(0 != server);
- if (0 == (acptr = FindServer(server + 1))) {
+ if ((acptr = FindServer(server + 1)) == NULL || !IsChannelService(acptr))
+ {
send_reply(sptr, ERR_NOSUCHNICK, name);
return;
}
/*
* NICK[%host]@server addressed? See if <server> is me first
*/
- if (!IsMe(acptr)) {
+ if (!IsMe(acptr))
+ {
sendcmdto_one(sptr, CMD_PRIVATE, acptr, "%s :%s", name, text);
return;
}
if ((host = strchr(name, '%')))
*host++ = '\0';
+ /* As reported by Vampire-, it's possible to brute force finding users
+ * by sending a message to each server and see which one succeeded.
+ * This means we have to remove error reporting. Sigh. Better than
+ * removing the ability to send directed messages to client servers
+ * Thanks for the suggestion Vampire=. -- Isomer 2001-08-28
+ * Argh, /ping nick@server, disallow messages to non +k clients :/ I hate
+ * this. -- Isomer 2001-09-16
+ */
if (!(acptr = FindUser(name)) || !MyUser(acptr) ||
- (!EmptyString(host) && 0 != match(host, cli_user(acptr)->host))) {
+ (!EmptyString(host) && 0 != match(host, cli_user(acptr)->host)) ||
+ !IsChannelService(acptr))
+ {
+ /*
+ * By this stage we might as well not bother because they will
+ * know that this server is currently linked because of the
+ * increased lag.
+ */
send_reply(sptr, ERR_NOSUCHNICK, name);
return;
}
* nickname addressed?
*/
if (0 == (acptr = findNUser(name)) || !IsUser(acptr)) {
- send_reply(sptr, SND_EXPLICIT | ERR_NOSUCHNICK, "* :Target left UnderNet. "
- "Failed to deliver: [%.20s]", text);
+ send_reply(sptr, SND_EXPLICIT | ERR_NOSUCHNICK, "* :Target left %s. "
+ "Failed to deliver: [%.20s]", feature_str(FEAT_NETWORK),
+ text);
return;
}
if (is_silenced(sptr, acptr))