if (!IsLocalChannel(chptr->chname) || MyConnect(acptr)) {
if (feature_bool(FEAT_ANNOUNCE_INVITES)) {
+ /* Announce to channel operators. */
sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str,
NULL, chptr, sptr, SKIP_NONOPS,
"%H %C %C :%C has been invited by %C",
chptr, acptr, sptr, acptr, sptr);
- sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, sptr, 0,
+ /* Announce to servers with channel operators, but skip acptr,
+ * since they will be notified below. */
+ sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS,
"%s :%H", cli_name(acptr), chptr);
- if (MyConnect(acptr))
- sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
}
- else
- sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
+ sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
}
return 0;
add_invite(acptr, chptr);
if (feature_bool(FEAT_ANNOUNCE_INVITES)) {
+ /* Announce to channel operators. */
sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str,
- NULL, chptr, sptr, SKIP_NONOPS,
+ NULL, chptr, sptr, SKIP_NONOPS,
"%H %C %C :%C has been invited by %C",
chptr, acptr, sptr, acptr, sptr);
- sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, sptr, 0,
+ /* Announce to servers with channel operators, but skip acptr,
+ * since they will be notified below. */
+ sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS,
"%s :%H", cli_name(acptr), chptr);
}
}
/** Send a (prefixed) command to all servers with users on \a to.
+ * Skip \a from and \a one plus those indicated in \a skip.
* @param[in] from Client originating the command.
* @param[in] cmd Long name of command (ignored).
* @param[in] tok Short name of command.
* @param[in] to Destination channel.
* @param[in] one Client direction to skip (or NULL).
- * @param[in] skip Ignored field.
+ * @param[in] skip Bitmask of SKIP_NONOPS and SKIP_NONVOICES indicating which clients to skip.
* @param[in] pattern Format string for command arguments.
*/
void sendcmdto_channel_servers_butone(struct Client *from, const char *cmd,
/* send the buffer to each server */
bump_sentalong(one);
- sentalong_marker++;
+ cli_sentalong(from) = sentalong_marker;
for (member = to->members; member; member = member->next_member) {
if (MyConnect(member->user)
|| IsZombie(member)
|| cli_fd(cli_from(member->user)) < 0
- || cli_sentalong(member->user) == sentalong_marker)
+ || cli_sentalong(member->user) == sentalong_marker
+ || (skip & SKIP_NONOPS && !IsChanOp(member))
+ || (skip & SKIP_NONVOICES && !IsChanOp(member) && !HasVoice(member)))
continue;
cli_sentalong(member->user) = sentalong_marker;
send_buffer(member->user, serv_mb, 0);