diff options
Diffstat (limited to 'src/kike.c')
-rw-r--r-- | src/kike.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1232,12 +1232,14 @@ irc_handle_version (const struct irc_message *msg, struct client *c) } static void -irc_channel_multicast (struct channel *chan, const char *message) +irc_channel_multicast (struct channel *chan, const char *message, + struct client *except) { for (struct channel_user *iter = chan->users; iter; iter = iter->next) { struct client *c = str_map_find (&chan->ctx->users, iter->nickname); - irc_send (c, "%s", message); + if (c != except) + irc_send (c, "%s", message); } } @@ -1349,7 +1351,7 @@ irc_handle_user_message (const struct irc_message *msg, struct client *c, char *message = xstrdup_printf (":%s!%s@%s %s %s :%s", c->nickname, c->username, c->hostname, command, target, text); - irc_channel_multicast (chan, message); + irc_channel_multicast (chan, message, c); free (message); return; } @@ -1714,7 +1716,7 @@ irc_handle_topic (const struct irc_message *msg, struct client *c) char *message = xstrdup_printf (":%s!%s@%s TOPIC %s :%s", c->nickname, c->username, c->hostname, target, chan->topic); - irc_channel_multicast (chan, message); + irc_channel_multicast (chan, message, NULL); free (message); } @@ -1735,7 +1737,7 @@ irc_try_part (struct client *c, const char *channel_name, const char *reason) char *message = xstrdup_printf (":%s!%s@%s PART %s :%s", c->nickname, c->username, c->hostname, channel_name, reason); if (!(chan->modes & IRC_CHAN_MODE_QUIET)) - irc_channel_multicast (chan, message); + irc_channel_multicast (chan, message, NULL); else irc_send (c, "%s", message); free (message); @@ -1797,7 +1799,7 @@ irc_try_kick (struct client *c, const char *channel_name, const char *nick, char *message = xstrdup_printf (":%s!%s@%s KICK %s %s :%s", c->nickname, c->username, c->hostname, channel_name, nick, reason); if (!(chan->modes & IRC_CHAN_MODE_QUIET)) - irc_channel_multicast (chan, message); + irc_channel_multicast (chan, message, NULL); else irc_send (c, "%s", message); free (message); @@ -1867,7 +1869,7 @@ irc_try_join (struct client *c, const char *channel_name, const char *key) char *message = xstrdup_printf (":%s!%s@%s JOIN %s", c->nickname, c->username, c->hostname, channel_name); if (!(chan->modes & IRC_CHAN_MODE_QUIET)) - irc_channel_multicast (chan, message); + irc_channel_multicast (chan, message, NULL); else irc_send (c, "%s", message); free (message); |