diff --git a/ChangeLog b/ChangeLog index 193c88476..092cb8b13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.3.8-dev, 2012-03-10 +v0.3.8-dev, 2012-03-12 Version 0.3.8 (under dev!) @@ -13,6 +13,8 @@ Version 0.3.8 (under dev!) (task #11316) * core: fix display of wide chars on last column of chat area (patch #7733) * api: add list "gui_buffer_last_displayed" in hdata "buffer" +* irc: check notify immediately when adding a nick to notify list, improve + first notify message for a nick (bug #35731) * irc: fix display of color in hostname (join/part/quit messages) * irc: compute hash to find nick color for nick in server message when nick is not in nicklist diff --git a/po/cs.po b/po/cs.po index 37e6cdeff..4ff1ccea3 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -6058,6 +6058,11 @@ msgstr "%s%s: nejste připojen k serveru" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: tenhle buffer není kanál!" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(neznámý)" + msgid "offline" msgstr "offline" @@ -6077,10 +6082,22 @@ msgstr "Seznam notifikací pro všechny servery:" msgid "Notify list is empty on all servers" msgstr "Seznam notifikací na všech serverech je prázdný" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%snotifikace: %s%s%s se připojil %s%s" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%snotifikace: %s%s%s se připojil %s%s" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%snotifikace: %s%s%s se připojil %s%s" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%snotifikace: %s%s%s odešel %s%s" diff --git a/po/de.po b/po/de.po index 74df3751b..ada9b3786 100644 --- a/po/de.po +++ b/po/de.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -6511,6 +6511,11 @@ msgstr "%s%s: Es besteht keine Verbindung zum Server" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: Dieser Buffer ist kein Channel!" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(unbekannt)" + msgid "offline" msgstr "Offline" @@ -6530,10 +6535,22 @@ msgstr "Benachrichtigungen für alle Server:" msgid "Notify list is empty on all servers" msgstr "Es existiert keine Benachrichtigung für Server" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%snotify: %s%s%s hat sich am Server %s%s angemeldet" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%snotify: %s%s%s hat sich am Server %s%s angemeldet" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%snotify: %s%s%s hat sich am Server %s%s angemeldet" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%snotify: %s%s%s hat sich vom Server %s%s abgemeldet" diff --git a/po/es.po b/po/es.po index a7a367b71..d6c085408 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -6297,6 +6297,11 @@ msgstr "%s%s: no estas conectado a ningún servidor" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: ¡este buffer no es un canal!" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(desconocido)" + msgid "offline" msgstr "fuera de línea" @@ -6316,10 +6321,22 @@ msgstr "Lista de notificaciones para todos los servidores:" msgid "Notify list is empty on all servers" msgstr "Lista de notificaciones vacía en todos los servidores" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%saviso: %s%s%s se ha unido a %s%s" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%saviso: %s%s%s se ha unido a %s%s" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%saviso: %s%s%s se ha unido a %s%s" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%saviso: %s%s%s ha salido de %s%s" diff --git a/po/fr.po b/po/fr.po index 66808503e..a55ea6893 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" -"PO-Revision-Date: 2012-03-09 10:33+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" +"PO-Revision-Date: 2012-03-11 13:40+0100\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -6360,6 +6360,10 @@ msgstr "%s%s: vous n'êtes pas connecté au serveur" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: ce tampon n'est pas un canal !" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +msgid "unknown" +msgstr "inconnu" + msgid "offline" msgstr "déconnecté" @@ -6379,10 +6383,22 @@ msgstr "Liste de notifications pour tous les serveurs:" msgid "Notify list is empty on all servers" msgstr "La liste de notifications est vide sur tous les serveurs" +#. TRANSLATORS: final "%s%s" is the server name +#, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%snotify: %s%s%s est connecté sur %s%s" + +#. TRANSLATORS: final "%s%s" is the server name +#, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%snotify: %s%s%s est déconnecté de %s%s" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%snotify: %s%s%s a rejoint %s%s" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%snotify: %s%s%s a quitté %s%s" diff --git a/po/hu.po b/po/hu.po index bdfc7c764..e2bddd773 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -5638,6 +5638,11 @@ msgstr "%s nincs csatlakozva szerverhez!\n" msgid "%s%s: this buffer is not a channel!" msgstr "Ez az ablak nem egy szoba!\n" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(ismeretlen)" + msgid "offline" msgstr "" @@ -5658,10 +5663,22 @@ msgstr "hotlist törlése" msgid "Notify list is empty on all servers" msgstr "" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" + +#. TRANSLATORS: final "%s%s" is the server name #, fuzzy, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" +#. TRANSLATORS: final "%s%s" is the server name #, fuzzy, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" diff --git a/po/it.po b/po/it.po index 7170a71e9..e846ecc4b 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -6292,6 +6292,11 @@ msgstr "%s%s: non connesso al server" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: questo buffer non è un canale!" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(sconosciuto)" + msgid "offline" msgstr "non in linea" @@ -6311,10 +6316,22 @@ msgstr "La lista notifiche per tutti i server:" msgid "Notify list is empty on all servers" msgstr "La lista notifiche è vuota su tutti i server" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%snotifica: %s%s%s è entrato in %s%s" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%snotifica: %s%s%s è entrato in %s%s" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%snotifica: %s%s%s è entrato in %s%s" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%snotifica: %s%s%s è uscito da %s%s" diff --git a/po/ja.po b/po/ja.po index 53d3f803f..218bb6455 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: \"AYANOKOUZI, Ryuunosuke\" \n" "Language-Team: Japanese\n" @@ -6127,6 +6127,11 @@ msgstr "%s%s: サーバに接続していません" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: このバッファはチャンネルではありません" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(未定義)" + msgid "offline" msgstr "オフライン" @@ -6146,10 +6151,22 @@ msgstr "全てのサーバの通知リスト:" msgid "Notify list is empty on all servers" msgstr "全てのサーバの通知リストは空です" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%s通知: %s%s%s が %s%s に参加" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%s通知: %s%s%s が %s%s に参加" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%s通知: %s%s%s が %s%s に参加" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%s通知: %s%s%s が %s%s から終了" diff --git a/po/pl.po b/po/pl.po index d27ed5d68..700bf698a 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -6257,6 +6257,11 @@ msgstr "%s%s: nie jesteś połączony z serwerem" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: to nie jest bufor kanału" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(nieznane)" + msgid "offline" msgstr "offline" @@ -6276,10 +6281,22 @@ msgstr "Lista powiadomień dla wszystkich serwerów" msgid "Notify list is empty on all servers" msgstr "Lista powiadomień jest pusta na wszystkich serwerach" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%spowiadomienie: %s%s%s wszedł na %s%s" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%spowiadomienie: %s%s%s wszedł na %s%s" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%spowiadomienie: %s%s%s wszedł na %s%s" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%spowiadomienie: %s%s%s wyszedł %s%s" diff --git a/po/pt_BR.po b/po/pt_BR.po index c8a472bf6..ee4dc9a9e 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -5775,6 +5775,11 @@ msgstr "%s%s: você não está conectado ao servidor" msgid "%s%s: this buffer is not a channel!" msgstr "%s%s: este buffer não é um canal!" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(desconhecido)" + msgid "offline" msgstr "" @@ -5794,10 +5799,22 @@ msgstr "Lista de notificação para todos os servidores:" msgid "Notify list is empty on all servers" msgstr "Lista de notificação está vazia em todos os servidores" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%snotificação: %s%s%s entrou %s%s" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%snotificação: %s%s%s entrou %s%s" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%snotificação: %s%s%s entrou %s%s" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%snotificação: %s%s%s saiu %s%s" diff --git a/po/ru.po b/po/ru.po index 183f2b7d7..768871843 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -5663,6 +5663,11 @@ msgstr "%s вы не подключены к серверу\n" msgid "%s%s: this buffer is not a channel!" msgstr "Это окно не является каналом!\n" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +#, fuzzy +msgid "unknown" +msgstr "(неизвестен)" + msgid "offline" msgstr "" @@ -5683,10 +5688,22 @@ msgstr "очистить хотлист" msgid "Notify list is empty on all servers" msgstr "" +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "%s%s%s выкинул %s%s%s с канала %s%s" + +#. TRANSLATORS: final "%s%s" is the server name +#, fuzzy, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "%s%s%s выкинул %s%s%s с канала %s%s" + +#. TRANSLATORS: final "%s%s" is the server name #, fuzzy, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "%s%s%s выкинул %s%s%s с канала %s%s" +#. TRANSLATORS: final "%s%s" is the server name #, fuzzy, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "%s%s%s выкинул %s%s%s с канала %s%s" diff --git a/po/weechat.pot b/po/weechat.pot index 740bae07b..04181e110 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-09 10:32+0100\n" +"POT-Creation-Date: 2012-03-12 07:47+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -4875,6 +4875,10 @@ msgstr "" msgid "%s%s: this buffer is not a channel!" msgstr "" +#. TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) +msgid "unknown" +msgstr "" + msgid "offline" msgstr "" @@ -4894,10 +4898,22 @@ msgstr "" msgid "Notify list is empty on all servers" msgstr "" +#. TRANSLATORS: final "%s%s" is the server name +#, c-format +msgid "%snotify: %s%s%s is connected on %s%s" +msgstr "" + +#. TRANSLATORS: final "%s%s" is the server name +#, c-format +msgid "%snotify: %s%s%s is offline on %s%s" +msgstr "" + +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has joined %s%s" msgstr "" +#. TRANSLATORS: final "%s%s" is the server name #, c-format msgid "%snotify: %s%s%s has quit %s%s" msgstr "" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 852916059..c5d1112bc 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -2930,6 +2930,7 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, IRC_PLUGIN_NAME, IRC_COLOR_CHAT_NICK, ptr_notify->nick); + irc_notify_check_now (ptr_notify); } else { diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c index e607266b4..e3fe8b557 100644 --- a/src/plugins/irc/irc-notify.c +++ b/src/plugins/irc/irc-notify.c @@ -193,7 +193,7 @@ irc_notify_new (struct t_irc_server *server, const char *nick, int check_away) new_notify->server = server; new_notify->nick = strdup (nick); new_notify->check_away = check_away; - new_notify->is_on_server = 0; + new_notify->is_on_server = -1; new_notify->away_message = NULL; new_notify->ison_received = 0; @@ -210,6 +210,35 @@ irc_notify_new (struct t_irc_server *server, const char *nick, int check_away) return new_notify; } +/* + * irc_notify_check_now: check now ison/whois for a notify (called when a + * notify is added) + */ + +void +irc_notify_check_now (struct t_irc_notify *notify) +{ + if (notify->server->is_connected) + { + /* send the ISON for nick */ + irc_redirect_new (notify->server, "ison", "notify", 1, + NULL, 0, NULL); + irc_server_sendf (notify->server, + IRC_SERVER_SEND_OUTQ_PRIO_LOW, NULL, + "ISON :%s", notify->nick); + + if (notify->check_away) + { + /* send the WHOIS for nick */ + irc_redirect_new (notify->server, "whois", "notify", 1, + notify->nick, 0, "301,401"); + irc_server_sendf (notify->server, + IRC_SERVER_SEND_OUTQ_PRIO_LOW, NULL, + "WHOIS :%s", notify->nick); + } + } +} + /* * irc_notify_new_for_server: create notify list for server with option * "irc.server.xxx.notify" @@ -332,7 +361,8 @@ irc_notify_free_all (struct t_irc_server *server) void irc_notify_display (struct t_gui_buffer *buffer, struct t_irc_notify *notify) { - if (!notify->is_on_server && !notify->away_message) + if ((notify->is_on_server < 0) + || (!notify->is_on_server && !notify->away_message)) { weechat_printf (buffer, " %s%s%s @ %s%s%s: %s%s", @@ -342,7 +372,10 @@ irc_notify_display (struct t_gui_buffer *buffer, struct t_irc_notify *notify) IRC_COLOR_CHAT_SERVER, notify->server->name, IRC_COLOR_RESET, - IRC_COLOR_MESSAGE_QUIT, + (notify->is_on_server < 0) ? "" : IRC_COLOR_MESSAGE_QUIT, + (notify->is_on_server < 0) ? + /* TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) */ + _("unknown") : _("offline")); } else @@ -462,20 +495,28 @@ irc_notify_set_is_on_server (struct t_irc_notify *notify, if (notify->is_on_server == is_on_server) return; - notify->is_on_server = is_on_server; - weechat_printf_tags (notify->server->buffer, irc_notify_get_tags (irc_config_look_notify_tags_ison), - (notify->is_on_server) ? - _("%snotify: %s%s%s has joined %s%s") : - _("%snotify: %s%s%s has quit %s%s"), + (notify->is_on_server < 0) ? + ((is_on_server) ? + /* TRANSLATORS: final "%s%s" is the server name */ + _("%snotify: %s%s%s is connected on %s%s") : + /* TRANSLATORS: final "%s%s" is the server name */ + _("%snotify: %s%s%s is offline on %s%s")) : + ((is_on_server) ? + /* TRANSLATORS: final "%s%s" is the server name */ + _("%snotify: %s%s%s has joined %s%s") : + /* TRANSLATORS: final "%s%s" is the server name */ + _("%snotify: %s%s%s has quit %s%s")), weechat_prefix ("network"), IRC_COLOR_CHAT_NICK, notify->nick, - (notify->is_on_server) ? + (is_on_server) ? IRC_COLOR_MESSAGE_JOIN : IRC_COLOR_MESSAGE_QUIT, IRC_COLOR_CHAT_SERVER, notify->server->name); + + notify->is_on_server = is_on_server; } /* diff --git a/src/plugins/irc/irc-notify.h b/src/plugins/irc/irc-notify.h index 7bd2319dd..d5e2acc41 100644 --- a/src/plugins/irc/irc-notify.h +++ b/src/plugins/irc/irc-notify.h @@ -29,6 +29,9 @@ struct t_irc_notify int check_away; /* check away status (with whois) */ /* current state of nick */ int is_on_server; /* 1 if nick is currently on server */ + /* 0 if nick is not on server */ + /* -1 for unknown status (check is */ + /* in progress) */ /* (using answer of ison command) */ char *away_message; /* current away message, NULL if */ /* nick is not away (using answer of */ @@ -47,6 +50,7 @@ extern void irc_notify_set_server_option (struct t_irc_server *server); extern struct t_irc_notify *irc_notify_new (struct t_irc_server *server, const char *nick, int check_away); +extern void irc_notify_check_now (struct t_irc_notify *notify); extern void irc_notify_new_for_server (struct t_irc_server *server); extern void irc_notify_new_for_all_servers (); extern void irc_notify_free (struct t_irc_server *server,