-/* XXX sentalong_marker used XXX
- *
- * We can drop sentalong_marker from this function by adding a field to
- * channels and to connections; what we do is make a user's connection
- * a "member" of the channel by adding it to the new list, and we use
- * the struct Membership status as a reference count. Then, to implement
- * this function, we just walk the list of connections. Unfortunately,
- * this doesn't account for sending only to channel ops, or for not
- * sending to +d users; we could account for that by splitting those
- * counts out, but that would imply adding two more fields (at least) to
- * the struct Membership... -Kev
+void sendcmdto_channel_servers_butone(struct Client *from, const char *cmd,
+ const char *tok, struct Channel *to,
+ struct Client *one, unsigned int skip,
+ const char *pattern, ...)
+{
+ struct VarData vd;
+ struct MsgBuf *serv_mb;
+ struct Membership *member;
+
+ /* build the buffer */
+ vd.vd_format = pattern;
+ va_start(vd.vd_args, pattern);
+ serv_mb = msgq_make(&me, "%:#C %s %v", from, tok, &vd);
+ va_end(vd.vd_args);
+
+ /* send the buffer to each server */
+ bump_sentalong(one);
+ 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
+ || (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);
+ }
+ msgq_clean(serv_mb);
+}
+
+
+/** Send a (prefixed) command to all users on this channel, except for
+ * \a one and those matching \a skip.
+ * @warning \a pattern must not contain %v.
+ * @param[in] from Client originating the command.
+ * @param[in] cmd Long name of command.
+ * @param[in] tok Short name of command.
+ * @param[in] to Destination channel.
+ * @param[in] one Client direction to skip (or NULL).
+ * @param[in] skip Bitmask of SKIP_NONOPS, SKIP_NONVOICES, SKIP_DEAF, SKIP_BURST.
+ * @param[in] pattern Format string for command arguments.