From a311764d1263f41fb1d6895013d34d2fe0a6477d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 13 Apr 2014 08:27:27 +0200 Subject: [PATCH] relay: add signal "relay_client_auth_ok" for irc and weechat protocols --- doc/en/weechat_plugin_api.en.txt | 5 +++++ doc/fr/weechat_plugin_api.fr.txt | 5 +++++ doc/it/weechat_plugin_api.it.txt | 6 ++++++ doc/ja/weechat_plugin_api.ja.txt | 6 ++++++ src/plugins/relay/irc/relay-irc.c | 5 +++++ src/plugins/relay/weechat/relay-weechat-protocol.c | 5 +++++ 6 files changed, 32 insertions(+) diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index 42c6dfc5a..54652d04b 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -7901,6 +7901,11 @@ List of signals sent by WeeChat and plugins: Pointer: relay client | Waiting for authentication from a relay client +| relay | relay_client_auth_ok + + _(WeeChat ≥ 0.4.4)_ | + Pointer: relay client | + Successful authentication from a relay client + | relay | relay_client_connected + _(WeeChat ≥ 0.4.4)_ | Pointer: relay client | diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index 3c90b2dbc..15a8d2e87 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -8041,6 +8041,11 @@ Liste des signaux envoyés par WeeChat et les extensions : Pointeur : client relay | Attente de l'authentification d'un client relay +| relay | relay_client_auth_ok + + _(WeeChat ≥ 0.4.4)_ | + Pointeur : client relay | + Authentification réussie d'un client relay + | relay | relay_client_connected + _(WeeChat ≥ 0.4.4)_ | Pointeur : client relay | diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index 1d9a8ace9..1ef27dc88 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -8062,6 +8062,12 @@ List of signals sent by WeeChat and plugins: Pointer: relay client | Waiting for authentication from a relay client +// TRANSLATION MISSING +| relay | relay_client_auth_ok + + _(WeeChat ≥ 0.4.4)_ | + Pointer: relay client | + Successful authentication from a relay client + // TRANSLATION MISSING | relay | relay_client_connected + _(WeeChat ≥ 0.4.4)_ | diff --git a/doc/ja/weechat_plugin_api.ja.txt b/doc/ja/weechat_plugin_api.ja.txt index 924ac4f76..9ab4ba745 100644 --- a/doc/ja/weechat_plugin_api.ja.txt +++ b/doc/ja/weechat_plugin_api.ja.txt @@ -7901,6 +7901,12 @@ WeeChat とプラグインが送信するシグナルのリスト: Pointer: リレークライアント | リレークライアントからの認証待ち +// TRANSLATION MISSING +| relay | relay_client_auth_ok + + _(WeeChat バージョン 0.4.4 以上で利用可)_ | + Pointer: リレークライアント | + Successful authentication from a relay client + | relay | relay_client_connected + _(WeeChat バージョン 0.4.4 以上で利用可)_ | Pointer: リレークライアント | diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 3af898863..f210169d7 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -1385,7 +1385,12 @@ relay_irc_recv (struct t_relay_client *client, const char *data) if (password) { if (strcmp (password, pos_password) == 0) + { RELAY_IRC_DATA(client, password_ok) = 1; + weechat_hook_signal_send ("relay_client_auth_ok", + WEECHAT_HOOK_SIGNAL_POINTER, + client); + } free (password); } } diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c index 12226a6a6..b1fbb1b7f 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.c +++ b/src/plugins/relay/weechat/relay-weechat-protocol.c @@ -175,7 +175,12 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(init) if (password) { if (strcmp (password, pos) == 0) + { RELAY_WEECHAT_DATA(client, password_ok) = 1; + weechat_hook_signal_send ("relay_client_auth_ok", + WEECHAT_HOOK_SIGNAL_POINTER, + client); + } free (password); } }