diff options
Diffstat (limited to 'src/plugins/relay')
-rw-r--r-- | src/plugins/relay/irc/relay-irc.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 53d40103f..5534a6e5e 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -519,21 +519,34 @@ int relay_irc_hsignal_irc_redir_cb (void *data, const char *signal, struct t_hashtable *hashtable) { + struct t_relay_client *client; int rc, client_id, num_messages, i; char pattern[128], **messages; const char *output; - struct t_relay_client *ptr_client; - /* make C compiler happy */ - (void) data; + client = (struct t_relay_client *)data; + + if (weechat_relay_plugin->debug >= 2) + { + weechat_printf (NULL, "%s: %s: client: %s%s%s", + RELAY_PLUGIN_NAME, + signal, + RELAY_COLOR_CHAT_CLIENT, + client->desc, + RELAY_COLOR_CHAT); + } rc = sscanf (signal, "irc_redirection_relay_%d_%s", &client_id, pattern); if (rc != 2) return WEECHAT_RC_OK; - ptr_client = relay_client_search_by_id (client_id); - if (!ptr_client) + /* check that client id found in signal exists */ + if (!relay_client_search_by_id (client_id)) + return WEECHAT_RC_OK; + + /* ignore redirection if it is for another relay client */ + if (client->id != client_id) return WEECHAT_RC_OK; output = weechat_hashtable_get (hashtable, "output"); @@ -545,7 +558,7 @@ relay_irc_hsignal_irc_redir_cb (void *data, const char *signal, { for (i = 0; i < num_messages; i++) { - relay_irc_sendf (ptr_client, messages[i]); + relay_irc_sendf (client, messages[i]); } weechat_string_free_split (messages); } @@ -1176,7 +1189,7 @@ relay_irc_hook_signals (struct t_relay_client *client) RELAY_IRC_DATA(client, hook_hsignal_irc_redir) = weechat_hook_hsignal ("irc_redirection_relay_*", &relay_irc_hsignal_irc_redir_cb, - NULL); + client); } /* |