- if ((chptr = FindChannel(parv[1]))) {
- if (client_can_send_to_channel(sptr, chptr)) {
- /*
- * Send to local clients:
- */
- sendto_lchanops_butone(cptr, sptr, chptr,
- ":%s " MSG_NOTICE " @%s :%s", sptr->name, parv[1], parv[parc - 1]);
- /*
- * And to other servers:
- */
- sendto_chanopsserv_butone(cptr, sptr, chptr,
- "%s%s " TOK_WALLCHOPS " %s :%s", NumNick(sptr), parv[1], parv[parc - 1]);
- }
- else
- sendto_one(sptr, err_str(ERR_CANNOTSENDTOCHAN), me.name, sptr->name, parv[1]);
- }
- return 0;
-}
-
-#if 0
-/*
- * m_wallchops
- *
- * parv[0] = sender prefix
- * parv[1] = target channel
- * parv[parc - 1] = wallchops text
- */
-int m_wallchops(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
- struct Channel *chptr;
-
- sptr->flags &= ~FLAGS_TS8;
-
- if (parc < 2 || *parv[1] == '\0')
- {
- sendto_one(sptr, err_str(ERR_NORECIPIENT), me.name, parv[0], "WALLCHOPS");
- return -1;
- }
-
- if (parc < 3 || *parv[parc - 1] == '\0')
- {
- sendto_one(sptr, err_str(ERR_NOTEXTTOSEND), me.name, parv[0]);
- return -1;
+ if (!IsLocalChannel(parv[1]) && (chptr = FindChannel(parv[1]))) {
+ if (client_can_send_to_channel(sptr, chptr, 1)) {
+ sendcmdto_channel_butone(sptr, CMD_WALLCHOPS, chptr, cptr,
+ SKIP_DEAF | SKIP_BURST | SKIP_NONOPS,
+ "%H :%s", chptr, parv[parc - 1]);
+ } else
+ send_reply(sptr, ERR_CANNOTSENDTOCHAN, parv[1]);