diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 8328d5323..c5f29afd1 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -29,6 +29,7 @@ Bug fixes:: * core: fix memory leak in calculation of expression on FreeBSD (issue #1469) * core: fix resize of a bar when its size is 0 (automatic) (issue #1470) * python: fix crash when invalid UTF-8 string is in a WeeChat hashtable converted to a Python dict (issue #1463) + * relay: actually use the client status "waiting_auth" in irc and weechat protocols (issue #1358) Documentation:: diff --git a/po/cs.po b/po/cs.po index b57e13891..0fd18d865 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-03-08 14:22+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -10743,17 +10743,21 @@ msgstr "" "ssl_cert_key)" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s%s: nedostatek paměti pro poslouchání na portu" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s%s: nedostatek paměti pro poslouchání na portu" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s: nedostatek paměti pro nového klienta" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, fuzzy, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s: schopnost klienta, server podporuje: %s" diff --git a/po/de.po b/po/de.po index c960e78c5..15fa78765 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-04-03 20:03+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -12645,18 +12645,22 @@ msgstr "" "%s%s: Warnung: kein SSL Zertifikat/Schlüssel gefunden (Einstellung relay." "network.ssl_cert_key)" -#, c-format -msgid "%s: new client on path %s: %s%s%s" +#, fuzzy, c-format +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s: neuer Client auf Pfad %s: %s%s%s" -#, c-format -msgid "%s: new client on port %s: %s%s%s" +#, fuzzy, c-format +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s: neuer Client an Port %s: %s%s%s" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s: Nicht genug Speicher für neuen Client" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s: Authentifizierung mit Client %s%s%s fehlgeschlagen" diff --git a/po/es.po b/po/es.po index ffc5234d4..6b3235514 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-03-08 14:22+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -11072,17 +11072,21 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s: nuevo cliente en puerto %d: %s%s%s" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s: nuevo cliente en puerto %d: %s%s%s" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s: no hay memoria suficiente para el nuevo cliente" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s: la autenticación falló con el cliente %s%s%s" diff --git a/po/fr.po b/po/fr.po index db0f3b1c9..d350cf7e1 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" -"PO-Revision-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" +"PO-Revision-Date: 2020-04-12 17:28+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -12375,17 +12375,21 @@ msgstr "" "ssl_cert_key)" #, c-format -msgid "%s: new client on path %s: %s%s%s" -msgstr "%s : nouveau client sur le chemin %s : %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" +msgstr "%s : nouveau client sur le chemin %s : %s%s%s (%s)" #, c-format -msgid "%s: new client on port %s: %s%s%s" -msgstr "%s : nouveau client sur le port %s : %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" +msgstr "%s : nouveau client sur le port %s : %s%s%s (%s)" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s : pas assez de mémoire pour un nouveau client" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "%s : client %s%s%s authentifié" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s : l'authentification a échoué avec le client %s%s%s" diff --git a/po/hu.po b/po/hu.po index b2ec4530d..bedeca8c1 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-03-08 14:22+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -10106,17 +10106,21 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s nem sikerült a csatornát létrehozni\n" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s nem sikerült a csatornát létrehozni\n" #, fuzzy, c-format msgid "%s%s: not enough memory for new client" msgstr "%s nincs elegendő memória új DCC számára\n" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, fuzzy, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" diff --git a/po/it.po b/po/it.po index 2f923945d..c38624223 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-03-08 14:22+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -11267,17 +11267,21 @@ msgstr "" "network.ssl_cert_key)" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s: nuovo client sulla porta %d: %s%s%s" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s: nuovo client sulla porta %d: %s%s%s" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s: memoria insufficiente per il nuovo client" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s: autenticazione con il client %s%s%s fallita" diff --git a/po/ja.po b/po/ja.po index a28d6027c..e67c31968 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-03-08 14:22+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -12098,18 +12098,22 @@ msgstr "" "%s%s: ostrzeżenie: nie znaleziono certyfikatu/klucza SSL (opcja relay." "network.ssl_cert_key)" -#, c-format -msgid "%s: new client on path %s: %s%s%s" +#, fuzzy, c-format +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s: nowy klient na ścieżce %s: %s%s%s" -#, c-format -msgid "%s: new client on port %s: %s%s%s" +#, fuzzy, c-format +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s: nowy klient na porcie %s: %s%s%s" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s: za mało pamięci dla nowego klienta" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s: uwierzytelnianie nie powiodło się z klientem %s%s%s" diff --git a/po/pt.po b/po/pt.po index 316bd3aca..f5adabf11 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-03-08 14:22+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -11700,17 +11700,21 @@ msgstr "" "network.ssl_cert_key)" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s: novo cliente na porta %d: %s%s%s" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s: novo cliente na porta %d: %s%s%s" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s: memória insuficiente para o novo cliente" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s: falha de autenticação com o cliente %s%s%s" diff --git a/po/pt_BR.po b/po/pt_BR.po index e80d7322b..143012ea4 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2019-11-03 08:38+0100\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -10555,17 +10555,21 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s%s: não foi possível aceitar o cliente na porta %d (%s.%s)" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s%s: não foi possível aceitar o cliente na porta %d (%s.%s)" #, c-format msgid "%s%s: not enough memory for new client" msgstr "%s%s: memória insuficiente para novo cliente" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, fuzzy, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "%s%s: falha na autenticação com cliente %s%s%s (%s.%s)" diff --git a/po/ru.po b/po/ru.po index 59e6c12a7..ed1c60fd3 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2020-03-08 14:22+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -10142,17 +10142,21 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s невозможно создать сокет\n" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s невозможно создать сокет\n" #, fuzzy, c-format msgid "%s%s: not enough memory for new client" msgstr "%s недостаточно памяти для нового DCC\n" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, fuzzy, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "Не могу записать лог-файл \"%s\"\n" diff --git a/po/tr.po b/po/tr.po index 94d643716..8b2148344 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2019-11-03 08:38+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -9213,17 +9213,21 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "%s Artık %s%s%s olarak biliniyorsunuz" #, fuzzy, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "%s hata: %s%s%s%s" #, c-format msgid "%s%s: not enough memory for new client" msgstr "" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 4bec51c0d..b49a191ea 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-12 08:46+0200\n" +"POT-Creation-Date: 2020-04-12 17:27+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -9074,17 +9074,21 @@ msgid "" msgstr "" #, c-format -msgid "%s: new client on path %s: %s%s%s" +msgid "%s: new client on path %s: %s%s%s (%s)" msgstr "" #, c-format -msgid "%s: new client on port %s: %s%s%s" +msgid "%s: new client on port %s: %s%s%s (%s)" msgstr "" #, c-format msgid "%s%s: not enough memory for new client" msgstr "" +#, c-format +msgid "%s: client %s%s%s authenticated" +msgstr "" + #, c-format msgid "%s%s: authentication failed with client %s%s%s" msgstr "" diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index fea36430c..81f493c78 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -1430,6 +1430,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data) weechat_hook_signal_send ("relay_client_auth_ok", WEECHAT_HOOK_SIGNAL_POINTER, client); + relay_client_set_status (client, RELAY_STATUS_CONNECTED); } free (password); } @@ -1903,6 +1904,18 @@ relay_irc_alloc_with_infolist (struct t_relay_client *client, } } +/* + * Returns the client initial status: it can be "waiting_auth" or "connected", + * depending if a password is expected or not. + */ + +enum t_relay_status +relay_irc_get_initial_status (struct t_relay_client *client) +{ + return (RELAY_IRC_DATA(client, password_ok)) ? + RELAY_STATUS_CONNECTED : RELAY_STATUS_WAITING_AUTH; +} + /* * Frees relay data specific to IRC protocol. */ diff --git a/src/plugins/relay/irc/relay-irc.h b/src/plugins/relay/irc/relay-irc.h index b0de0e786..095fc6691 100644 --- a/src/plugins/relay/irc/relay-irc.h +++ b/src/plugins/relay/irc/relay-irc.h @@ -21,6 +21,7 @@ #define WEECHAT_PLUGIN_RELAY_IRC_H struct t_relay_client; +enum t_relay_status; #define RELAY_IRC_DATA(client, var) \ (((struct t_relay_irc_data *)client->protocol_data)->var) @@ -69,6 +70,7 @@ extern void relay_irc_close_connection (struct t_relay_client *client); extern void relay_irc_alloc (struct t_relay_client *client); extern void relay_irc_alloc_with_infolist (struct t_relay_client *client, struct t_infolist *infolist); +extern enum t_relay_status relay_irc_get_initial_status (struct t_relay_client *client); extern void relay_irc_free (struct t_relay_client *client); extern int relay_irc_add_to_infolist (struct t_infolist_item *item, struct t_relay_client *client); diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c index bc339254d..28c336220 100644 --- a/src/plugins/relay/relay-client.c +++ b/src/plugins/relay/relay-client.c @@ -253,7 +253,21 @@ relay_client_handshake_timer_cb (const void *pointer, void *data, weechat_unhook (client->hook_timer_handshake); client->hook_timer_handshake = NULL; client->gnutls_handshake_ok = 1; - relay_client_set_status (client, RELAY_STATUS_CONNECTED); + switch (client->protocol) + { + case RELAY_PROTOCOL_WEECHAT: + relay_client_set_status ( + client, + relay_weechat_get_initial_status (client)); + break; + case RELAY_PROTOCOL_IRC: + relay_client_set_status ( + client, + relay_irc_get_initial_status (client)); + break; + case RELAY_NUM_PROTOCOLS: + break; + } return WEECHAT_RC_OK; } @@ -577,8 +591,15 @@ relay_client_recv_cb (const void *pointer, void *data, int fd) client = (struct t_relay_client *)pointer; - if (client->status != RELAY_STATUS_CONNECTED) + /* + * data can be received only during authentication + * or if connected (authentication was OK) + */ + if ((client->status != RELAY_STATUS_WAITING_AUTH) + && (client->status != RELAY_STATUS_CONNECTED)) + { return WEECHAT_RC_OK; + } #ifdef HAVE_GNUTLS if (client->ssl) @@ -1248,7 +1269,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server) new_client->address = strdup ((address && address[0]) ? address : "local"); new_client->real_ip = NULL; - new_client->status = RELAY_STATUS_CONNECTED; + new_client->status = RELAY_STATUS_CONNECTING; new_client->protocol = server->protocol; new_client->protocol_string = (server->protocol_string) ? strdup (server->protocol_string) : NULL; new_client->protocol_args = (server->protocol_args) ? strdup (server->protocol_args) : NULL; @@ -1336,9 +1357,19 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server) { case RELAY_PROTOCOL_WEECHAT: relay_weechat_alloc (new_client); + if (!new_client->ssl) + { + new_client->status = + relay_weechat_get_initial_status (new_client); + } break; case RELAY_PROTOCOL_IRC: relay_irc_alloc (new_client); + if (!new_client->ssl) + { + new_client->status = + relay_irc_get_initial_status (new_client); + } break; case RELAY_NUM_PROTOCOLS: break; @@ -1357,23 +1388,27 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server) if (server->unix_socket) { - weechat_printf_date_tags (NULL, 0, "relay_client", - _("%s: new client on path %s: %s%s%s"), - RELAY_PLUGIN_NAME, - server->path, - RELAY_COLOR_CHAT_CLIENT, - new_client->desc, - RELAY_COLOR_CHAT); + weechat_printf_date_tags ( + NULL, 0, "relay_client", + _("%s: new client on path %s: %s%s%s (%s)"), + RELAY_PLUGIN_NAME, + server->path, + RELAY_COLOR_CHAT_CLIENT, + new_client->desc, + RELAY_COLOR_CHAT, + _(relay_client_status_string[new_client->status])); } else { - weechat_printf_date_tags (NULL, 0, "relay_client", - _("%s: new client on port %s: %s%s%s"), - RELAY_PLUGIN_NAME, - server->path, - RELAY_COLOR_CHAT_CLIENT, - new_client->desc, - RELAY_COLOR_CHAT); + weechat_printf_date_tags ( + NULL, 0, "relay_client", + _("%s: new client on port %s: %s%s%s (%s)"), + RELAY_PLUGIN_NAME, + server->path, + RELAY_COLOR_CHAT_CLIENT, + new_client->desc, + RELAY_COLOR_CHAT, + _(relay_client_status_string[new_client->status])); } new_client->hook_fd = weechat_hook_fd (new_client->sock, @@ -1511,7 +1546,17 @@ relay_client_set_status (struct t_relay_client *client, client->status = status; - if (RELAY_CLIENT_HAS_ENDED(client)) + if (client->status == RELAY_STATUS_CONNECTED) + { + weechat_printf_date_tags ( + NULL, 0, "relay_client", + _("%s: client %s%s%s authenticated"), + RELAY_PLUGIN_NAME, + RELAY_COLOR_CHAT_CLIENT, + client->desc, + RELAY_COLOR_CHAT); + } + else if (RELAY_CLIENT_HAS_ENDED(client)) { client->end_time = time (NULL); diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c index 0c897a6d3..205029f66 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.c +++ b/src/plugins/relay/weechat/relay-weechat-protocol.c @@ -418,6 +418,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(init) weechat_hook_signal_send ("relay_client_auth_ok", WEECHAT_HOOK_SIGNAL_POINTER, client); + relay_client_set_status (client, RELAY_STATUS_CONNECTED); } else { diff --git a/src/plugins/relay/weechat/relay-weechat.c b/src/plugins/relay/weechat/relay-weechat.c index 5373bcb61..8f05c4872 100644 --- a/src/plugins/relay/weechat/relay-weechat.c +++ b/src/plugins/relay/weechat/relay-weechat.c @@ -266,6 +266,21 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client, } } +/* + * Returns the client initial status: it is always "waiting_auth" for weechat + * protocol because we always expect the "init" command, even without any + * password. + */ + +enum t_relay_status +relay_weechat_get_initial_status (struct t_relay_client *client) +{ + /* make C compiler happy */ + (void) client; + + return RELAY_STATUS_WAITING_AUTH; +} + /* * Frees relay data specific to WeeChat protocol. */ diff --git a/src/plugins/relay/weechat/relay-weechat.h b/src/plugins/relay/weechat/relay-weechat.h index 11f4762f2..62f2fc40a 100644 --- a/src/plugins/relay/weechat/relay-weechat.h +++ b/src/plugins/relay/weechat/relay-weechat.h @@ -21,6 +21,7 @@ #define WEECHAT_PLUGIN_RELAY_WEECHAT_H struct t_relay_client; +enum t_relay_status; #define RELAY_WEECHAT_DATA(client, var) \ (((struct t_relay_weechat_data *)client->protocol_data)->var) @@ -62,6 +63,7 @@ extern void relay_weechat_close_connection (struct t_relay_client *client); extern void relay_weechat_alloc (struct t_relay_client *client); extern void relay_weechat_alloc_with_infolist (struct t_relay_client *client, struct t_infolist *infolist); +extern enum t_relay_status relay_weechat_get_initial_status (struct t_relay_client *client); extern void relay_weechat_free (struct t_relay_client *client); extern int relay_weechat_add_to_infolist (struct t_infolist_item *item, struct t_relay_client *client);