*
* $Id$
*/
+#include "config.h"
+
#include "ircd_relay.h"
#include "channel.h"
#include "client.h"
check_target_limit(sptr, chptr, chptr->chname, 0))
return;
- sendcmdto_channel_butone(sptr, CMD_PRIVATE, chptr, sptr->from,
+ sendcmdto_channel_butone(sptr, CMD_PRIVATE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
}
check_target_limit(sptr, chptr, chptr->chname, 0))
return;
- sendcmdto_channel_butone(sptr, CMD_NOTICE, chptr, sptr->from,
+ sendcmdto_channel_butone(sptr, CMD_NOTICE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
}
* Servers may have channel services, need to check for it here
*/
if (client_can_send_to_channel(sptr, chptr) || IsChannelService(sptr)) {
- sendcmdto_channel_butone(sptr, CMD_PRIVATE, chptr, sptr->from,
+ sendcmdto_channel_butone(sptr, CMD_PRIVATE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
}
else
* Servers may have channel services, need to check for it here
*/
if (client_can_send_to_channel(sptr, chptr) || IsChannelService(sptr)) {
- sendcmdto_channel_butone(sptr, CMD_NOTICE, chptr, sptr->from,
+ sendcmdto_channel_butone(sptr, CMD_NOTICE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
}
}
*host++ = '\0';
if (!(acptr = FindUser(name)) || !MyUser(acptr) ||
- (!EmptyString(host) && 0 != match(host, acptr->user->host))) {
+ (!EmptyString(host) && 0 != match(host, cli_user(acptr)->host))) {
send_reply(sptr, ERR_NOSUCHNICK, name);
return;
}
*host++ = '\0';
if (!(acptr = FindUser(name)) || !MyUser(acptr) ||
- (!EmptyString(host) && 0 != match(host, acptr->user->host)))
+ (!EmptyString(host) && 0 != match(host, cli_user(acptr)->host)))
return;
*server = '@';
send_reply(sptr, ERR_NOSUCHNICK, name);
return;
}
- if (check_target_limit(sptr, acptr, acptr->name, 0) ||
+ if ((!IsChannelService(acptr) &&
+ check_target_limit(sptr, acptr, cli_name(acptr), 0)) ||
is_silenced(sptr, acptr))
return;
/*
* send away message if user away
*/
- if (acptr->user && acptr->user->away)
- send_reply(sptr, RPL_AWAY, acptr->name, acptr->user->away);
+ if (cli_user(acptr) && cli_user(acptr)->away)
+ send_reply(sptr, RPL_AWAY, cli_name(acptr), cli_user(acptr)->away);
/*
* deliver the message
*/
if (0 == (acptr = FindUser(name)))
return;
- if (check_target_limit(sptr, acptr, acptr->name, 0) ||
+ if ((!IsChannelService(acptr) &&
+ check_target_limit(sptr, acptr, cli_name(acptr), 0)) ||
is_silenced(sptr, acptr))
return;
/*
* nickname addressed?
*/
if (0 == (acptr = findNUser(name)) || !IsUser(acptr)) {
- send_reply(sptr, RPL_EXPLICIT | ERR_NOSUCHNICK, "* :Target left UnderNet. "
+ send_reply(sptr, SND_EXPLICIT | ERR_NOSUCHNICK, "* :Target left UnderNet. "
"Failed to deliver: [%.20s]", text);
return;
}
}
sendcmdto_match_butone(sptr, CMD_PRIVATE, s,
- IsServer(sptr->from) ? sptr->from : 0,
+ IsServer(cli_from(sptr)) ? cli_from(sptr) : 0,
host_mask ? MATCH_HOST : MATCH_SERVER,
"%s :%s", mask, text);
}
}
sendcmdto_match_butone(sptr, CMD_NOTICE, s,
- IsServer(sptr->from) ? sptr->from : 0,
+ IsServer(cli_from(sptr)) ? cli_from(sptr) : 0,
host_mask ? MATCH_HOST : MATCH_SERVER,
"%s :%s", mask, text);
}
++s;
}
sendcmdto_match_butone(sptr, CMD_PRIVATE, s,
- IsServer(sptr->from) ? sptr->from : 0,
+ IsServer(cli_from(sptr)) ? cli_from(sptr) : 0,
host_mask ? MATCH_HOST : MATCH_SERVER,
"%s :%s", mask, text);
}
++s;
}
sendcmdto_match_butone(sptr, CMD_NOTICE, s,
- IsServer(sptr->from) ? sptr->from : 0,
+ IsServer(cli_from(sptr)) ? cli_from(sptr) : 0,
host_mask ? MATCH_HOST : MATCH_SERVER,
"%s :%s", mask, text);
}