diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2014-01-23 11:31:57 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2014-01-23 11:31:57 +0100 |
commit | 3acdcee0d94feaf2845c3e74d323f8c5dd01d70a (patch) | |
tree | 1aca3f34fb571b74b4190ef8d188c4b140ca2640 | |
parent | 6d4bc94536e162f40a0e5ec5d9db21f6cde85863 (diff) | |
download | weechat-3acdcee0d94feaf2845c3e74d323f8c5dd01d70a.zip |
irc: use MONITOR instead of ISON for /notify when it is available on server (task #11477) (patch from Nils Görs)
38 files changed, 885 insertions, 327 deletions
@@ -81,6 +81,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * aspell: fix detection of nicks with non-alphanumeric chars * guile: disable guile gmp allocator (fix crash on unload of relay plugin) (bug #40628) +* irc: use MONITOR instead of ISON for /notify when it is available on server + (task #11477) * irc: do not display names by default when joining a channel (task #13045) * irc: add server option "ssl_fingerprint" (task #12724) * irc: display PONG answer when resulting from manual /ping command diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt index fa8f56a39..01a91fd74 100644 --- a/doc/de/autogen/plugin_api/hdata.txt +++ b/doc/de/autogen/plugin_api/hdata.txt @@ -182,6 +182,8 @@ *** 'casemapping' (integer) *** 'chantypes' (string) *** 'chanmodes' (string) +*** 'monitor' (integer) +*** 'monitor_time' (time) *** 'reconnect_delay' (integer) *** 'reconnect_start' (time) *** 'command_time' (time) @@ -204,6 +206,7 @@ *** 'last_redirect' (pointer, hdata: "irc_redirect") *** 'notify_list' (pointer, hdata: "irc_notify") *** 'last_notify' (pointer, hdata: "irc_notify") +*** 'notify_count' (integer) *** 'join_manual' (hashtable) *** 'join_channel_key' (hashtable) *** 'join_noswitch' (hashtable) diff --git a/doc/de/weechat_user.de.txt b/doc/de/weechat_user.de.txt index 76cd1ac0c..1a21eaca7 100644 --- a/doc/de/weechat_user.de.txt +++ b/doc/de/weechat_user.de.txt @@ -2263,6 +2263,10 @@ Unvollständige Liste der IRC Nachrichten bzw. Alias die angepasst werden könne | 671 | whois | whois (sichere Verbindung) | 728 | quietlist | quiet Liste | 729 | quietlist | Ende der quiet Liste +// TRANSLATION MISSING +| 732 | monitor | list of monitored nicks +// TRANSLATION MISSING +| 733 | monitor | list of monitored nicks (end) | 901 | | Sie sind nun eingelogged |=== diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt index 04ef11b96..0624485c0 100644 --- a/doc/en/autogen/plugin_api/hdata.txt +++ b/doc/en/autogen/plugin_api/hdata.txt @@ -182,6 +182,8 @@ *** 'casemapping' (integer) *** 'chantypes' (string) *** 'chanmodes' (string) +*** 'monitor' (integer) +*** 'monitor_time' (time) *** 'reconnect_delay' (integer) *** 'reconnect_start' (time) *** 'command_time' (time) @@ -204,6 +206,7 @@ *** 'last_redirect' (pointer, hdata: "irc_redirect") *** 'notify_list' (pointer, hdata: "irc_notify") *** 'last_notify' (pointer, hdata: "irc_notify") +*** 'notify_count' (integer) *** 'join_manual' (hashtable) *** 'join_channel_key' (hashtable) *** 'join_noswitch' (hashtable) diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index cc0fa8bf7..4e75654ec 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -8415,6 +8415,7 @@ Argument is a hashtable with following entries (keys and values are string): ** 'mode_channel_ban_exception' ("mode #channel e") ** 'mode_channel_invite' ("mode #channel I") ** 'mode_user' +** 'monitor' ** 'names' ** 'ping' ** 'time' diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index 075942d0b..0fb56502a 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -2225,6 +2225,8 @@ Non-comprehensive list of IRC messages or alias that you can customize: | 671 | whois | whois (secure connection) | 728 | quietlist | quiet list | 729 | quietlist | end of quiet list +| 732 | monitor | list of monitored nicks +| 733 | monitor | list of monitored nicks (end) | 901 | | you are now logged in |=== diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt index cf62a1ee6..f68f67dea 100644 --- a/doc/fr/autogen/plugin_api/hdata.txt +++ b/doc/fr/autogen/plugin_api/hdata.txt @@ -182,6 +182,8 @@ *** 'casemapping' (integer) *** 'chantypes' (string) *** 'chanmodes' (string) +*** 'monitor' (integer) +*** 'monitor_time' (time) *** 'reconnect_delay' (integer) *** 'reconnect_start' (time) *** 'command_time' (time) @@ -204,6 +206,7 @@ *** 'last_redirect' (pointer, hdata: "irc_redirect") *** 'notify_list' (pointer, hdata: "irc_notify") *** 'last_notify' (pointer, hdata: "irc_notify") +*** 'notify_count' (integer) *** 'join_manual' (hashtable) *** 'join_channel_key' (hashtable) *** 'join_noswitch' (hashtable) diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index c46cd955c..f455a63ee 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -8546,6 +8546,7 @@ sont des chaînes) : ** 'mode_channel_ban_exception' ("mode #channel e") ** 'mode_channel_invite' ("mode #channel I") ** 'mode_user' +** 'monitor' ** 'names' ** 'ping' ** 'time' diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt index 55b8c3ba0..f488f9f3e 100644 --- a/doc/fr/weechat_user.fr.txt +++ b/doc/fr/weechat_user.fr.txt @@ -2294,6 +2294,8 @@ Liste non exhaustive des messages ou alias que vous pouvez paramétrer : | 671 | whois | whois (connexion sécurisée) | 728 | quietlist | liste des "quiet" | 729 | quietlist | fin de la liste des "quiet" +| 732 | monitor | liste des pseudos surveillés +| 733 | monitor | liste des pseudos surveillés (fin) | 901 | | vous êtes maintenant identifié |=== diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt index 6d4373f18..7622d1e1c 100644 --- a/doc/it/autogen/plugin_api/hdata.txt +++ b/doc/it/autogen/plugin_api/hdata.txt @@ -182,6 +182,8 @@ *** 'casemapping' (integer) *** 'chantypes' (string) *** 'chanmodes' (string) +*** 'monitor' (integer) +*** 'monitor_time' (time) *** 'reconnect_delay' (integer) *** 'reconnect_start' (time) *** 'command_time' (time) @@ -204,6 +206,7 @@ *** 'last_redirect' (pointer, hdata: "irc_redirect") *** 'notify_list' (pointer, hdata: "irc_notify") *** 'last_notify' (pointer, hdata: "irc_notify") +*** 'notify_count' (integer) *** 'join_manual' (hashtable) *** 'join_channel_key' (hashtable) *** 'join_noswitch' (hashtable) diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index f52d63a6c..2bcd7984c 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -8606,6 +8606,7 @@ sono stringhe): ** 'mode_channel_ban_exception' ("mode #channel e") ** 'mode_channel_invite' ("mode #channel I") ** 'mode_user' +** 'monitor' ** 'names' ** 'ping' ** 'time' diff --git a/doc/it/weechat_user.it.txt b/doc/it/weechat_user.it.txt index 560dc3b99..4947dec54 100644 --- a/doc/it/weechat_user.it.txt +++ b/doc/it/weechat_user.it.txt @@ -2324,6 +2324,10 @@ personalizzare: | 728 | quietlist | quiet list // TRANSLATION MISSING | 729 | quietlist | end of quiet list +// TRANSLATION MISSING +| 732 | monitor | list of monitored nicks +// TRANSLATION MISSING +| 733 | monitor | list of monitored nicks (end) | 901 | | ora si è loggati |=== diff --git a/doc/ja/autogen/plugin_api/hdata.txt b/doc/ja/autogen/plugin_api/hdata.txt index 36a56d0bf..3162b4b35 100644 --- a/doc/ja/autogen/plugin_api/hdata.txt +++ b/doc/ja/autogen/plugin_api/hdata.txt @@ -182,6 +182,8 @@ *** 'casemapping' (integer) *** 'chantypes' (string) *** 'chanmodes' (string) +*** 'monitor' (integer) +*** 'monitor_time' (time) *** 'reconnect_delay' (integer) *** 'reconnect_start' (time) *** 'command_time' (time) @@ -204,6 +206,7 @@ *** 'last_redirect' (pointer, hdata: "irc_redirect") *** 'notify_list' (pointer, hdata: "irc_notify") *** 'last_notify' (pointer, hdata: "irc_notify") +*** 'notify_count' (integer) *** 'join_manual' (hashtable) *** 'join_channel_key' (hashtable) *** 'join_noswitch' (hashtable) diff --git a/doc/ja/weechat_plugin_api.ja.txt b/doc/ja/weechat_plugin_api.ja.txt index 52f9b8961..d0f572673 100644 --- a/doc/ja/weechat_plugin_api.ja.txt +++ b/doc/ja/weechat_plugin_api.ja.txt @@ -8413,6 +8413,7 @@ hsignal "irc_redirect_command" は irc ** 'mode_channel_ban_exception' ("mode #channel e") ** 'mode_channel_invite' ("mode #channel I") ** 'mode_user' +** 'monitor' ** 'names' ** 'ping' ** 'time' diff --git a/doc/ja/weechat_user.ja.txt b/doc/ja/weechat_user.ja.txt index 46b4c5d23..6b305bf07 100644 --- a/doc/ja/weechat_user.ja.txt +++ b/doc/ja/weechat_user.ja.txt @@ -2224,6 +2224,10 @@ weechat:: | 671 | whois | whois (セキュアな接続) | 728 | quietlist | 発言禁止リスト | 729 | quietlist | 発言禁止リストの終了 +// TRANSLATION MISSING +| 732 | monitor | list of monitored nicks +// TRANSLATION MISSING +| 733 | monitor | list of monitored nicks (end) | 901 | | ログインに成功 |=== diff --git a/doc/pl/autogen/plugin_api/hdata.txt b/doc/pl/autogen/plugin_api/hdata.txt index a7d473809..4111c1b37 100644 --- a/doc/pl/autogen/plugin_api/hdata.txt +++ b/doc/pl/autogen/plugin_api/hdata.txt @@ -182,6 +182,8 @@ *** 'casemapping' (integer) *** 'chantypes' (string) *** 'chanmodes' (string) +*** 'monitor' (integer) +*** 'monitor_time' (time) *** 'reconnect_delay' (integer) *** 'reconnect_start' (time) *** 'command_time' (time) @@ -204,6 +206,7 @@ *** 'last_redirect' (pointer, hdata: "irc_redirect") *** 'notify_list' (pointer, hdata: "irc_notify") *** 'last_notify' (pointer, hdata: "irc_notify") +*** 'notify_count' (integer) *** 'join_manual' (hashtable) *** 'join_channel_key' (hashtable) *** 'join_noswitch' (hashtable) diff --git a/doc/pl/weechat_user.pl.txt b/doc/pl/weechat_user.pl.txt index db87c1829..ac7d6f9ba 100644 --- a/doc/pl/weechat_user.pl.txt +++ b/doc/pl/weechat_user.pl.txt @@ -2241,6 +2241,10 @@ Niepełna lista wiadomości IRC lub aliasów jakie można dostosować: | 671 | whois | whois (bezpieczne połączenie) | 728 | quietlist | cicha lista | 729 | quietlist | koniec cichej listy +// TRANSLATION MISSING +| 732 | monitor | list of monitored nicks +// TRANSLATION MISSING +| 733 | monitor | list of monitored nicks (end) | 901 | | jesteś teraz zalogowany |=== @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-18 21:20+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4722,7 +4722,11 @@ msgid "%s%s: notify already exists" msgstr "%s%s: notifikace již existuje" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, fuzzy, c-format +msgid "%s: notification added for %s%s%s" msgstr "%s: přidána notifikace pro %s%s" #, c-format @@ -4737,9 +4741,9 @@ msgstr "%s: všechny notifikace byly smazány" msgid "%s: no notification in list" msgstr "%s: žádné notifikace v seznamu" -#, c-format -msgid "%s: notification deleted" -msgstr "%s: notifikace smazána" +#, fuzzy, c-format +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: přidána notifikace pro %s%s" #, c-format msgid "%s%s: notification not found" @@ -7012,20 +7016,20 @@ msgid "Notify list is empty on all servers" msgstr "Seznam notifikací na všech serverech je prázdný" #, fuzzy, c-format -msgid "%snotify: %s%s%s is connected" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%snotifikace: %s%s%s se připojil %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s is offline" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%snotifikace: %s%s%s se připojil %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s has joined" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%snotifikace: %s%s%s se připojil %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%snotifikace: %s%s%s odešel %s%s" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s%s%s%s%s%s%s%s%s skončil" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -10093,6 +10097,13 @@ msgstr "" msgid "Constants" msgstr "" +#~ msgid "%s: notification deleted" +#~ msgstr "%s: notifikace smazána" + +#, fuzzy +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%snotifikace: %s%s%s odešel %s%s" + #~ msgid "No layout saved" #~ msgstr "Nebylo uloženo žádné rozložení" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-23 11:21+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-22 21:22+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <weechatter@arcor.de>\n" @@ -5410,7 +5410,11 @@ msgid "%s%s: notify already exists" msgstr "%s%s: Benachrichtigung existiert schon" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, fuzzy, c-format +msgid "%s: notification added for %s%s%s" msgstr "%s: Benachrichtigung für %s%s hinzugefügt" #, c-format @@ -5425,9 +5429,9 @@ msgstr "%s: alle Benachrichtigungen wurden gelöscht" msgid "%s: no notification in list" msgstr "%s keine Benachrichtigung in Liste vorhanden" -#, c-format -msgid "%s: notification deleted" -msgstr "%s: Benachrichtigung gelöscht" +#, fuzzy, c-format +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: Benachrichtigung für %s%s hinzugefügt" #, c-format msgid "%s%s: notification not found" @@ -7949,21 +7953,21 @@ msgstr "Benachrichtigungen für alle Server:" msgid "Notify list is empty on all servers" msgstr "es liegt für keinen Server eine Benachrichtigung vor" -#, c-format -msgid "%snotify: %s%s%s is connected" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%snotify: %s%s%s ist angemeldet" -#, c-format -msgid "%snotify: %s%s%s is offline" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%snotify: %s%s%s ist offline" -#, c-format -msgid "%snotify: %s%s%s has joined" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%snotify: %s%s%s hat sich angemeldet" -#, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%snotify: %s%s%s hat sich abgemeldet" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s%s%s%s%s%s%s%s%s hat den IRC verlassen" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -11232,6 +11236,12 @@ msgstr "Type" msgid "Constants" msgstr "Konstanten" +#~ msgid "%s: notification deleted" +#~ msgstr "%s: Benachrichtigung gelöscht" + +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%snotify: %s%s%s hat sich abgemeldet" + #~ msgid "No layout saved" #~ msgstr "Kein Layout gespeichert" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-18 21:21+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4939,7 +4939,11 @@ msgid "%s%s: notify already exists" msgstr "%s%s: la notificación ya existe" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, fuzzy, c-format +msgid "%s: notification added for %s%s%s" msgstr "%s: notificación para %s%s agregada" #, c-format @@ -4954,9 +4958,9 @@ msgstr "%s: todas las notificaciones borradas" msgid "%s: no notification in list" msgstr "%s: no hay notificaciones en la lista" -#, c-format -msgid "%s: notification deleted" -msgstr "%s: notificación borrada" +#, fuzzy, c-format +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: notificación para %s%s agregada" #, c-format msgid "%s%s: notification not found" @@ -7289,21 +7293,21 @@ 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" -#, c-format -msgid "%snotify: %s%s%s is connected" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%saviso: %s%s%s está conectado" -#, c-format -msgid "%snotify: %s%s%s is offline" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%saviso: %s%s%s está desconectado" -#, c-format -msgid "%snotify: %s%s%s has joined" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%saviso: %s%s%s se ha unido" -#, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%saviso: %s%s%s ha salido" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s%s%s%s%s%s%s%s%s ha salido" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -10363,6 +10367,12 @@ msgstr "Tipo" msgid "Constants" msgstr "Constantes" +#~ msgid "%s: notification deleted" +#~ msgstr "%s: notificación borrada" + +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%saviso: %s%s%s ha salido" + #~ msgid "No layout saved" #~ msgstr "Ningún esquema guardado" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" -"PO-Revision-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" +"PO-Revision-Date: 2014-01-23 11:27+0100\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -3486,7 +3486,8 @@ msgid "save configuration file on exit" msgstr "sauvegarder la configuration en quittant" msgid "save layout on exit (buffers, windows, or both)" -msgstr "sauvegarder la disposition en quittant (tampons, fenêtres, ou les deux)" +msgstr "" +"sauvegarder la disposition en quittant (tampons, fenêtres, ou les deux)" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "nombre de lignes pour le défilement avec scroll_up et scroll_down" @@ -5275,8 +5276,12 @@ msgid "%s%s: notify already exists" msgstr "%s%s: la notification existe déjà" #, c-format -msgid "%s: notification added for %s%s" -msgstr "%s: notification ajoutée pour %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "%sLa liste de surveillance est pleine (%d)" + +#, c-format +msgid "%s: notification added for %s%s%s" +msgstr "%s: notification ajoutée pour %s%s%s" #, c-format msgid "%s%s: error adding notification" @@ -5291,8 +5296,8 @@ msgid "%s: no notification in list" msgstr "%s: pas de notification dans la liste" #, c-format -msgid "%s: notification deleted" -msgstr "%s: notification supprimée" +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: notification supprimée pour %s%s%s" #, c-format msgid "%s%s: notification not found" @@ -7731,20 +7736,20 @@ msgid "Notify list is empty on all servers" msgstr "La liste de notifications est vide sur tous les serveurs" #, c-format -msgid "%snotify: %s%s%s is connected" -msgstr "%snotify: %s%s%s est connecté" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" +msgstr "%snotify: %s%s%s%s%s%s%s%s%s est connecté" #, c-format -msgid "%snotify: %s%s%s is offline" -msgstr "%snotify: %s%s%s est déconnecté" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" +msgstr "%snotify: %s%s%s%s%s%s%s%s%s est déconnecté" #, c-format -msgid "%snotify: %s%s%s has joined" -msgstr "%snotify: %s%s%s a rejoint" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" +msgstr "%snotify: %s%s%s%s%s%s%s%s%s a rejoint" #, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%snotify: %s%s%s a quitté" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%snotify: %s%s%s%s%s%s%s%s%s a quitté" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -10958,6 +10963,12 @@ msgstr "Type" msgid "Constants" msgstr "Constantes" +#~ msgid "%s: notification deleted" +#~ msgstr "%s: notification supprimée" + +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%snotify: %s%s%s a quitté" + #~ msgid "No layout saved" #~ msgstr "Pas de disposition sauvée" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-06 10:16+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4299,8 +4299,12 @@ msgstr "%s \"%s\" parancs nem futtatható a szerverablakban\n" msgid "%s%s: notify already exists" msgstr "%s az ignore már létezik\n" +#, c-format +msgid "%sMonitor list is full (%d)" +msgstr "" + #, fuzzy, c-format -msgid "%s: notification added for %s%s" +msgid "%s: notification added for %s%s%s" msgstr "%s IP-cím nem található\n" #, fuzzy, c-format @@ -4316,8 +4320,8 @@ msgid "%s: no notification in list" msgstr "%s nem található ilyen mellőzés\n" #, fuzzy, c-format -msgid "%s: notification deleted" -msgstr "Nincs mellőzés megadva.\n" +msgid "%s: notification deleted for %s%s%s" +msgstr "%s IP-cím nem található\n" #, fuzzy, c-format msgid "%s%s: notification not found" @@ -6513,20 +6517,20 @@ msgid "Notify list is empty on all servers" msgstr "" #, fuzzy, c-format -msgid "%snotify: %s%s%s is connected" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" #, fuzzy, c-format -msgid "%snotify: %s%s%s is offline" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" #, fuzzy, c-format -msgid "%snotify: %s%s%s has joined" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" #, fuzzy, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s %s(%s%s%s)%s kilépett" #, fuzzy, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -9514,6 +9518,14 @@ msgid "Constants" msgstr "" #, fuzzy +#~ msgid "%s: notification deleted" +#~ msgstr "Nincs mellőzés megadva.\n" + +#, fuzzy +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%s%s%s kirúgta %s%s%s-t a(z) %s%s szobából" + +#, fuzzy #~ msgid "%sgnutls: fingerprint does NOT match" #~ msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-18 21:22+0100\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5076,7 +5076,11 @@ msgid "%s%s: notify already exists" msgstr "%s%s: la notifica esiste già" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, fuzzy, c-format +msgid "%s: notification added for %s%s%s" msgstr "%s: notifica aggiunta per %s%s" #, c-format @@ -5091,9 +5095,9 @@ msgstr "%s: tutte le notifiche eliminate" msgid "%s: no notification in list" msgstr "%s: nessuna notifica nella lista" -#, c-format -msgid "%s: notification deleted" -msgstr "%s: notifica eliminata" +#, fuzzy, c-format +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: notifica aggiunta per %s%s" #, c-format msgid "%s%s: notification not found" @@ -7429,21 +7433,21 @@ 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" -#, c-format -msgid "%snotify: %s%s%s is connected" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%snotifica: %s%s%s è connesso" -#, c-format -msgid "%snotify: %s%s%s is offline" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%snotifica: %s%s%s non è in linea" -#, c-format -msgid "%snotify: %s%s%s has joined" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%snotifica: %s%s%s è entrato" -#, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%snotifica: %s%s%s si è disconnesso" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s%s%s%s%s%s%s%s%s si è disconnesso" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -10515,6 +10519,12 @@ msgstr "Tipo" msgid "Constants" msgstr "Costanti" +#~ msgid "%s: notification deleted" +#~ msgstr "%s: notifica eliminata" + +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%snotifica: %s%s%s si è disconnesso" + #~ msgid "No layout saved" #~ msgstr "Nessun layout salvato" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-18 21:22+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/WeeChat>\n" @@ -5038,7 +5038,11 @@ msgid "%s%s: notify already exists" msgstr "%s%s: notify は既に存在しています" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, fuzzy, c-format +msgid "%s: notification added for %s%s%s" msgstr "%s: %s%s の通知を追加" #, c-format @@ -5053,9 +5057,9 @@ msgstr "%s: 全ての通知を削除" msgid "%s: no notification in list" msgstr "%s: リストに通知がありません" -#, c-format -msgid "%s: notification deleted" -msgstr "%s: 通知を削除" +#, fuzzy, c-format +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: %s%s の通知を追加" #, c-format msgid "%s%s: notification not found" @@ -7410,21 +7414,21 @@ msgstr "全てのサーバの通知リスト:" msgid "Notify list is empty on all servers" msgstr "全てのサーバの通知リストは空です" -#, c-format -msgid "%snotify: %s%s%s is connected" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%s通知: %s%s%s が接続しました" -#, c-format -msgid "%snotify: %s%s%s is offline" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%s通知: %s%s%s はオフライン状態" -#, c-format -msgid "%snotify: %s%s%s has joined" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%s通知: %s%s%s が参加" -#, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%s通知: %s%s%s が終了" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s%s%s%s%s%s%s%s%s が終了" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -10542,6 +10546,12 @@ msgstr "タイプ" msgid "Constants" msgstr "定数" +#~ msgid "%s: notification deleted" +#~ msgstr "%s: 通知を削除" + +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%s通知: %s%s%s が終了" + #~ msgid "No layout saved" #~ msgstr "レイアウトが保存されていません" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-18 21:23+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5156,7 +5156,11 @@ msgid "%s%s: notify already exists" msgstr "%s%s: powiadomienie juz istnieje" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, fuzzy, c-format +msgid "%s: notification added for %s%s%s" msgstr "%s: powiadomienie dodane dla %s%s" #, c-format @@ -5171,9 +5175,9 @@ msgstr "%s: usunięto wszystkie powiadomienia" msgid "%s: no notification in list" msgstr "%s: brak powiadomień na liście" -#, c-format -msgid "%s: notification deleted" -msgstr "%s: usunięto powiadomienie" +#, fuzzy, c-format +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: powiadomienie dodane dla %s%s" #, c-format msgid "%s%s: notification not found" @@ -7572,21 +7576,21 @@ msgstr "Lista powiadomień dla wszystkich serwerów:" msgid "Notify list is empty on all servers" msgstr "Lista powiadomień jest pusta na wszystkich serwerach" -#, c-format -msgid "%snotify: %s%s%s is connected" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%spowiadomienie: %s%s%s jest podłączony" -#, c-format -msgid "%snotify: %s%s%s is offline" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%spowiadomienie: %s%s%s jest offline" -#, c-format -msgid "%snotify: %s%s%s has joined" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%spowiadomienie: %s%s%s wszedł" -#, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%spowiadomienie: %s%s%s wyszedł" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s%s%s%s%s%s%s%s%s wyszedł z IRC" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -10734,6 +10738,12 @@ msgstr "Typ" msgid "Constants" msgstr "Stałe" +#~ msgid "%s: notification deleted" +#~ msgstr "%s: usunięto powiadomienie" + +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%spowiadomienie: %s%s%s wyszedł" + #~ msgid "No layout saved" #~ msgstr "Nie zapisano żadnego układu" diff --git a/po/pt_BR.po b/po/pt_BR.po index 3bf8be576..a32257cd2 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: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-18 21:23+0100\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4766,9 +4766,13 @@ msgid "%s%s: notify already exists" msgstr "" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" msgstr "" +#, fuzzy, c-format +msgid "%s: notification added for %s%s%s" +msgstr "%s%s: falha na autenticação com cliente %s%s%s (%s.%s)" + #, c-format msgid "%s%s: error adding notification" msgstr "" @@ -4781,9 +4785,9 @@ msgstr "" msgid "%s: no notification in list" msgstr "" -#, c-format -msgid "%s: notification deleted" -msgstr "" +#, fuzzy, c-format +msgid "%s: notification deleted for %s%s%s" +msgstr "%s: desconectado do cliente %s%s%s (%s.%s)" #, c-format msgid "%s%s: notification not found" @@ -6724,19 +6728,19 @@ msgid "Notify list is empty on all servers" msgstr "Lista de notificação está vazia em todos os servidores" #, fuzzy, c-format -msgid "%snotify: %s%s%s is connected" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%snotificação: %s%s%s entrou %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s is offline" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%snotificação: %s%s%s entrou %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s has joined" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%snotificação: %s%s%s entrou %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s has quit" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" msgstr "%snotificação: %s%s%s saiu %s%s" #, c-format @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-06 10:17+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4335,8 +4335,12 @@ msgstr "%s \"%s\" команда может быть выполнена толь msgid "%s%s: notify already exists" msgstr "%s игнорирование уже существует\n" +#, c-format +msgid "%sMonitor list is full (%d)" +msgstr "" + #, fuzzy, c-format -msgid "%s: notification added for %s%s" +msgid "%s: notification added for %s%s%s" msgstr "%s IP адрес не найден\n" #, fuzzy, c-format @@ -4352,8 +4356,8 @@ msgid "%s: no notification in list" msgstr "%s игнорирования не найдены\n" #, fuzzy, c-format -msgid "%s: notification deleted" -msgstr "Игнорирования не заданы.\n" +msgid "%s: notification deleted for %s%s%s" +msgstr "%s IP адрес не найден\n" #, fuzzy, c-format msgid "%s%s: notification not found" @@ -6542,20 +6546,20 @@ msgid "Notify list is empty on all servers" msgstr "" #, fuzzy, c-format -msgid "%snotify: %s%s%s is connected" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "%s%s%s выкинул %s%s%s с канала %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s is offline" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "%s%s%s выкинул %s%s%s с канала %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s has joined" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "%s%s%s выкинул %s%s%s с канала %s%s" #, fuzzy, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "%s%s%s выкинул %s%s%s с канала %s%s" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s %s(%s%s%s)%s вышел" #, fuzzy, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" @@ -9537,6 +9541,14 @@ msgstr "" msgid "Constants" msgstr "" +#, fuzzy +#~ msgid "%s: notification deleted" +#~ msgstr "Игнорирования не заданы.\n" + +#, fuzzy +#~ msgid "%snotify: %s%s%s has quit" +#~ msgstr "%s%s%s выкинул %s%s%s с канала %s%s" + #~ msgid "No layout saved" #~ msgstr "Нет сохранённых раскладок" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2014-01-06 10:17+0100\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3892,7 +3892,11 @@ msgid "%s%s: notify already exists" msgstr "" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, c-format +msgid "%s: notification added for %s%s%s" msgstr "" #, c-format @@ -3908,7 +3912,7 @@ msgid "%s: no notification in list" msgstr "" #, c-format -msgid "%s: notification deleted" +msgid "%s: notification deleted for %s%s%s" msgstr "" #, c-format @@ -5780,21 +5784,21 @@ msgstr "" msgid "Notify list is empty on all servers" msgstr "" -#, c-format -msgid "%snotify: %s%s%s is connected" -msgstr "" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" +msgstr "%s%s%s%s%s%s%s%s%s%s çıktı" -#, c-format -msgid "%snotify: %s%s%s is offline" -msgstr "" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" +msgstr "%s%s%s%s%s%s%s%s%s%s çıktı" -#, c-format -msgid "%snotify: %s%s%s has joined" -msgstr "" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" +msgstr "%s%s%s%s%s%s%s%s%s%s katıldı %s%s%s" -#, c-format -msgid "%snotify: %s%s%s has quit" -msgstr "" +#, fuzzy, c-format +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" +msgstr "%s%s%s%s%s%s%s%s%s%s çıktı" #, c-format msgid "%snotify: %s%s%s is now away: \"%s\"" diff --git a/po/weechat.pot b/po/weechat.pot index 5e52699b6..e1dd1ff43 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-22 18:47+0100\n" +"POT-Creation-Date: 2014-01-23 11:24+0100\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3895,7 +3895,11 @@ msgid "%s%s: notify already exists" msgstr "" #, c-format -msgid "%s: notification added for %s%s" +msgid "%sMonitor list is full (%d)" +msgstr "" + +#, c-format +msgid "%s: notification added for %s%s%s" msgstr "" #, c-format @@ -3911,7 +3915,7 @@ msgid "%s: no notification in list" msgstr "" #, c-format -msgid "%s: notification deleted" +msgid "%s: notification deleted for %s%s%s" msgstr "" #, c-format @@ -5737,19 +5741,19 @@ msgid "Notify list is empty on all servers" msgstr "" #, c-format -msgid "%snotify: %s%s%s is connected" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is connected" msgstr "" #, c-format -msgid "%snotify: %s%s%s is offline" +msgid "%snotify: %s%s%s%s%s%s%s%s%s is offline" msgstr "" #, c-format -msgid "%snotify: %s%s%s has joined" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has joined" msgstr "" #, c-format -msgid "%snotify: %s%s%s has quit" +msgid "%snotify: %s%s%s%s%s%s%s%s%s has quit" msgstr "" #, c-format diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 092c54859..ae6dbedfa 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -3428,17 +3428,27 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_OK; } + if ((ptr_server->monitor > 0) + && (ptr_server->notify_count >= ptr_server->monitor)) + { + weechat_printf (ptr_server->buffer, + _("%sMonitor list is full (%d)"), + weechat_prefix ("error"), ptr_server->monitor); + return WEECHAT_RC_OK; + } + ptr_notify = irc_notify_new (ptr_server, argv[2], check_away); if (ptr_notify) { irc_notify_set_server_option (ptr_server); weechat_printf (ptr_server->buffer, - _("%s: notification added for %s%s"), + _("%s: notification added for %s%s%s"), IRC_PLUGIN_NAME, irc_nick_color_for_server_message (ptr_server, NULL, ptr_notify->nick), - ptr_notify->nick); + ptr_notify->nick, + weechat_color ("reset")); irc_notify_check_now (ptr_notify); } else @@ -3505,10 +3515,16 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, ptr_notify = irc_notify_search (ptr_server, argv[2]); if (ptr_notify) { - irc_notify_free (ptr_server, ptr_notify); + weechat_printf (ptr_server->buffer, + _("%s: notification deleted for %s%s%s"), + IRC_PLUGIN_NAME, + irc_nick_color_for_server_message (ptr_server, + NULL, + ptr_notify->nick), + ptr_notify->nick, + weechat_color ("reset")); + irc_notify_free (ptr_server, ptr_notify, 1); irc_notify_set_server_option (ptr_server); - weechat_printf (NULL, _("%s: notification deleted"), - IRC_PLUGIN_NAME); } else { diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index 1e1e5cb45..1b0fc76bd 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -798,7 +798,7 @@ irc_message_split (struct t_irc_server *server, const char *message) { struct t_hashtable *hashtable; char **argv, **argv_eol, *tags, *host, *command, *arguments, target[512]; - char *pos; + char *pos, monitor_action[3]; int split_ok, argc, index_args, max_length_nick, max_length_host; split_ok = 0; @@ -868,17 +868,47 @@ irc_message_split (struct t_irc_server *server, const char *message) if ((weechat_strcasecmp (command, "ison") == 0) || (weechat_strcasecmp (command, "wallops") == 0)) { + /* + * ISON :nick1 nick2 nick3 + * WALLOPS :some text here + */ split_ok = irc_message_split_string (hashtable, tags, host, command, NULL, ":", (argv_eol[index_args][0] == ':') ? argv_eol[index_args] + 1 : argv_eol[index_args], NULL, ' ', max_length_host); } + else if (weechat_strcasecmp (command, "monitor") == 0) + { + /* + * MONITOR + nick1,nick2,nick3 + * MONITOR - nick1,nick2,nick3 + */ + if (((argv_eol[index_args][0] == '+') || (argv_eol[index_args][0] == '-')) + && (argv_eol[index_args][1] == ' ')) + { + snprintf (monitor_action, sizeof (monitor_action), + "%c ", argv_eol[index_args][0]); + split_ok = irc_message_split_string (hashtable, tags, host, command, + NULL, monitor_action, + argv_eol[index_args] + 2, + NULL, ',', max_length_host); + } + else + { + split_ok = irc_message_split_string (hashtable, tags, host, command, + NULL, ":", + (argv_eol[index_args][0] == ':') ? + argv_eol[index_args] + 1 : argv_eol[index_args], + NULL, ',', max_length_host); + } + } else if (weechat_strcasecmp (command, "join") == 0) { - /* split join (if it's more than 510 bytes) */ + /* JOIN #channel1,#channel2,#channel3 key1,key2 */ if (strlen (message) > 510) { + /* split join if it's more than 510 bytes */ split_ok = irc_message_split_join (hashtable, tags, host, arguments); } @@ -886,7 +916,10 @@ irc_message_split (struct t_irc_server *server, const char *message) else if ((weechat_strcasecmp (command, "privmsg") == 0) || (weechat_strcasecmp (command, "notice") == 0)) { - /* split privmsg/notice */ + /* + * PRIVMSG target :some text here + * NOTICE target :some text here + */ if (index_args + 1 <= argc - 1) { split_ok = irc_message_split_privmsg_notice (hashtable, tags, host, @@ -899,7 +932,7 @@ irc_message_split (struct t_irc_server *server, const char *message) } else if (weechat_strcasecmp (command, "005") == 0) { - /* split 005 (isupport) */ + /* :server 005 nick MODES=4 CHANLIMIT=#:20 NICKLEN=16 USERLEN=10 ... */ if (index_args + 1 <= argc - 1) { split_ok = irc_message_split_005 (hashtable, tags, host, command, @@ -911,7 +944,7 @@ irc_message_split (struct t_irc_server *server, const char *message) else if (weechat_strcasecmp (command, "353") == 0) { /* - * split 353 (list of users on channel): + * list of users on channel: * :server 353 mynick = #channel :mynick nick1 @nick2 +nick3 */ if (index_args + 2 <= argc - 1) diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c index 823c52dff..503a34cbe 100644 --- a/src/plugins/irc/irc-notify.c +++ b/src/plugins/irc/irc-notify.c @@ -189,8 +189,12 @@ irc_notify_new (struct t_irc_server *server, const char *nick, int check_away) { struct t_irc_notify *new_notify; - if (!server || !nick || !nick[0]) + if (!server || !nick || !nick[0] + || ((server->monitor > 0) + && ((server->notify_count >= server->monitor)))) + { return NULL; + } new_notify = malloc (sizeof (*new_notify)); if (new_notify) @@ -210,37 +214,146 @@ irc_notify_new (struct t_irc_server *server, const char *nick, int check_away) server->notify_list = new_notify; server->last_notify = new_notify; new_notify->next_notify = NULL; + + server->notify_count++; } return new_notify; } /* - * Checks now ison/whois for a notify (called when a notify is added). + * Checks now if a nick is connected with ison/monitor + whois (if away checking + * is enabled). + * + * It is called when a notify is added. */ void irc_notify_check_now (struct t_irc_notify *notify) { - if (notify->server->is_connected) + /* don't send anything if we are not connected to the server */ + if (!notify->server->is_connected) + return; + + if (notify->server->monitor > 0) { - /* 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, + /* send MONITOR for nick */ + irc_server_sendf (notify->server, IRC_SERVER_SEND_OUTQ_PRIO_LOW, NULL, + "MONITOR + %s", notify->nick); + } + else + { + /* send ISON for nick (MONITOR not supported on server) */ + 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 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); + } +} + +/* + * Builds a message with nicks (ISON or MONITOR). + * + * Argument "message" must be "ISON :" or "MONITOR + " or "MONITOR - ". + * Argument "separator" must be " " for ISON and "," for MONITOR. + * Argument "num_nicks" is set with the number of nicks added in message. + * + * Note: result must be freed after use. + */ + +char * +irc_notify_build_message_with_nicks (struct t_irc_server *server, + const char *irc_message, + const char *separator, + int *num_nicks) +{ + char *message, *message2; + int length, total_length, length_separator; + struct t_irc_notify *ptr_notify; + + *num_nicks = 0; + + length = strlen (irc_message) + 1; + total_length = length; + length_separator = strlen (separator); - if (notify->check_away) + message = malloc (length); + if (!message) + return NULL; + snprintf (message, length, "%s", irc_message); + + for (ptr_notify = server->notify_list; ptr_notify; + ptr_notify = ptr_notify->next_notify) + { + length = strlen (ptr_notify->nick); + total_length += length + length_separator; + message2 = realloc (message, total_length); + if (!message2) { - /* 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); + if (message) + free (message); + message = NULL; + break; } + message = message2; + if (*num_nicks > 0) + strcat (message, separator); + strcat (message, ptr_notify->nick); + + (*num_nicks)++; } + + return message; +} + +/* + * Sends the MONITOR message (after server connection or if the option + * "irc.server.xxx.notify" is changed). + */ + +void +irc_notify_send_monitor (struct t_irc_server *server) +{ + struct t_hashtable *hashtable; + char *message, hash_key[32]; + const char *str_message; + int num_nicks, number; + + message = irc_notify_build_message_with_nicks (server, + "MONITOR + ", + ",", + &num_nicks); + if (message && (num_nicks > 0)) + { + hashtable = irc_message_split (server, message); + if (hashtable) + { + number = 1; + while (1) + { + snprintf (hash_key, sizeof (hash_key), "msg%d", number); + str_message = weechat_hashtable_get (hashtable, + hash_key); + if (!str_message) + break; + irc_server_sendf (server, + IRC_SERVER_SEND_OUTQ_PRIO_LOW, + NULL, "%s", str_message); + number++; + } + weechat_hashtable_free (hashtable); + } + } + if (message) + free (message); } /* @@ -257,12 +370,10 @@ irc_notify_new_for_server (struct t_irc_server *server) irc_notify_free_all (server); notify = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_NOTIFY); - if (!notify || !notify[0]) return; items = weechat_string_split (notify, ",", 0, 0, &num_items); - if (items) { for (i = 0; i < num_items; i++) @@ -293,6 +404,10 @@ irc_notify_new_for_server (struct t_irc_server *server) } weechat_string_free_split (items); } + + /* if we are using MONITOR, send it now with new nicks monitored */ + if (server->is_connected && (server->monitor > 0)) + irc_notify_send_monitor (server); } /* @@ -316,14 +431,25 @@ irc_notify_new_for_all_servers () */ void -irc_notify_free (struct t_irc_server *server, struct t_irc_notify *notify) +irc_notify_free (struct t_irc_server *server, struct t_irc_notify *notify, + int remove_monitor) { weechat_hook_signal_send ("irc_notify_removing", WEECHAT_HOOK_SIGNAL_POINTER, notify); /* free data */ if (notify->nick) + { + if ((server->monitor > 0) && remove_monitor + && (server->is_connected) && !irc_signal_upgrade_received) + { + /* remove one monitored nick */ + irc_server_sendf (notify->server, + IRC_SERVER_SEND_OUTQ_PRIO_LOW, NULL, + "MONITOR - %s", notify->nick); + } free (notify->nick); + } if (notify->away_message) free (notify->away_message); @@ -339,6 +465,9 @@ irc_notify_free (struct t_irc_server *server, struct t_irc_notify *notify) free (notify); + if (server->notify_count > 0) + server->notify_count--; + weechat_hook_signal_send ("irc_notify_removed", WEECHAT_HOOK_SIGNAL_STRING, NULL); } @@ -350,9 +479,18 @@ irc_notify_free (struct t_irc_server *server, struct t_irc_notify *notify) void irc_notify_free_all (struct t_irc_server *server) { + /* remove all monitored nicks */ + if ((server->monitor > 0) && (server->is_connected) + && !irc_signal_upgrade_received) + { + irc_server_sendf (server, IRC_SERVER_SEND_OUTQ_PRIO_LOW, NULL, + "MONITOR C"); + } + + /* free notify list */ while (server->notify_list) { - irc_notify_free (server, server->notify_list); + irc_notify_free (server, server->notify_list, 0); } } @@ -524,7 +662,7 @@ irc_notify_send_signal (struct t_irc_notify *notify, */ void -irc_notify_set_is_on_server (struct t_irc_notify *notify, +irc_notify_set_is_on_server (struct t_irc_notify *notify, const char *host, int is_on_server) { if (!notify) @@ -540,18 +678,23 @@ irc_notify_set_is_on_server (struct t_irc_notify *notify, notify->nick), (notify->is_on_server < 0) ? ((is_on_server) ? - _("%snotify: %s%s%s is connected") : - _("%snotify: %s%s%s is offline")) : + _("%snotify: %s%s%s%s%s%s%s%s%s is connected") : + _("%snotify: %s%s%s%s%s%s%s%s%s is offline")) : ((is_on_server) ? - _("%snotify: %s%s%s has joined") : - _("%snotify: %s%s%s has quit")), + _("%snotify: %s%s%s%s%s%s%s%s%s has joined") : + _("%snotify: %s%s%s%s%s%s%s%s%s has quit")), weechat_prefix ("network"), irc_nick_color_for_server_message (notify->server, NULL, notify->nick), notify->nick, - (is_on_server) ? - IRC_COLOR_MESSAGE_JOIN : IRC_COLOR_MESSAGE_QUIT); + (host && host[0]) ? IRC_COLOR_CHAT_DELIMITERS : "", + (host && host[0]) ? " (" : "", + (host && host[0]) ? IRC_COLOR_CHAT_HOST : "", + (host && host[0]) ? host : "", + (host && host[0]) ? IRC_COLOR_CHAT_DELIMITERS : "", + (host && host[0]) ? ")" : "", + (is_on_server) ? IRC_COLOR_MESSAGE_JOIN : IRC_COLOR_MESSAGE_QUIT); irc_notify_send_signal (notify, (is_on_server) ? "join" : "quit", NULL); notify->is_on_server = is_on_server; @@ -726,7 +869,9 @@ irc_notify_hsignal_cb (void *data, const char *signal, ptr_notify->nick, nicks_recv[j]) == 0) { - irc_notify_set_is_on_server (ptr_notify, 1); + irc_notify_set_is_on_server (ptr_notify, + NULL, + 1); ptr_notify->ison_received = 1; } } @@ -757,7 +902,7 @@ irc_notify_hsignal_cb (void *data, const char *signal, } if (nick_was_sent) { - irc_notify_set_is_on_server (ptr_notify, 0); + irc_notify_set_is_on_server (ptr_notify, NULL, 0); } } @@ -824,11 +969,10 @@ irc_notify_hsignal_cb (void *data, const char *signal, int irc_notify_timer_ison_cb (void *data, int remaining_calls) { - char *message, *message2, hash_key[32]; + char *message, hash_key[32]; const char *str_message; - int total_length, length, nicks_added, number; + int num_nicks, number; struct t_irc_server *ptr_server; - struct t_irc_notify *ptr_notify, *ptr_next_notify; struct t_hashtable *hashtable; /* make C compiler happy */ @@ -838,41 +982,15 @@ irc_notify_timer_ison_cb (void *data, int remaining_calls) for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { - if (ptr_server->is_connected && ptr_server->notify_list) + if (ptr_server->is_connected + && ptr_server->notify_list + && (ptr_server->monitor == 0)) { - message = malloc (7); - if (!message) - continue; - - snprintf (message, 7, "ISON :"); - total_length = 7; - nicks_added = 0; - - ptr_notify = ptr_server->notify_list; - while (ptr_notify) - { - ptr_next_notify = ptr_notify->next_notify; - - length = strlen (ptr_notify->nick); - total_length += length + 1; - message2 = realloc (message, total_length); - if (!message2) - { - if (message) - free (message); - message = NULL; - break; - } - message = message2; - if (nicks_added > 0) - strcat (message, " "); - strcat (message, ptr_notify->nick); - nicks_added++; - - ptr_notify = ptr_next_notify; - } - - if (message && (nicks_added > 0)) + message = irc_notify_build_message_with_nicks (ptr_server, + "ISON :", + " ", + &num_nicks); + if (message && (num_nicks > 0)) { hashtable = irc_message_split (ptr_server, message); if (hashtable) @@ -895,7 +1013,6 @@ irc_notify_timer_ison_cb (void *data, int remaining_calls) weechat_hashtable_free (hashtable); } } - if (message) free (message); } diff --git a/src/plugins/irc/irc-notify.h b/src/plugins/irc/irc-notify.h index 9453a4f76..8590c6f6d 100644 --- a/src/plugins/irc/irc-notify.h +++ b/src/plugins/irc/irc-notify.h @@ -54,9 +54,12 @@ 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, - struct t_irc_notify *notify); + struct t_irc_notify *notify, int remove_monitor); +extern void irc_notify_set_is_on_server (struct t_irc_notify *notify, + const char *host, int is_on_server); extern void irc_notify_free_all (struct t_irc_server *server); extern void irc_notify_display_list (struct t_irc_server *server); +extern void irc_notify_send_monitor (struct t_irc_server *server); extern int irc_notify_timer_ison_cb (void *data, int remaining_calls); extern int irc_notify_timer_whois_cb (void *data, int remaining_calls); extern struct t_hdata *irc_notify_hdata_notify_cb (void *data, diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 8622bbc7f..4283f58ee 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -52,6 +52,7 @@ #include "irc-nick.h" #include "irc-sasl.h" #include "irc-server.h" +#include "irc-notify.h" /* @@ -2159,6 +2160,8 @@ IRC_PROTOCOL_CALLBACK(001) /* connection to IRC server is OK! */ server->is_connected = 1; server->reconnect_delay = 0; + server->monitor_time = time (NULL) + 5; + if (server->hook_timer_connection) { weechat_unhook (server->hook_timer_connection); @@ -2232,7 +2235,8 @@ IRC_PROTOCOL_CALLBACK(001) IRC_PROTOCOL_CALLBACK(005) { char *pos, *pos2, *pos_start, *error, *isupport2; - int length_isupport, length, nick_max_length, casemapping; + int length_isupport, length, casemapping; + long value; IRC_PROTOCOL_MIN_ARGS(4); @@ -2262,9 +2266,9 @@ IRC_PROTOCOL_CALLBACK(005) if (pos2) pos2[0] = '\0'; error = NULL; - nick_max_length = (int)strtol (pos, &error, 10); - if (error && !error[0] && (nick_max_length > 0)) - server->nick_max_length = nick_max_length; + value = strtol (pos, &error, 10); + if (error && !error[0] && (value > 0)) + server->nick_max_length = (int)value; if (pos2) pos2[0] = ' '; } @@ -2314,6 +2318,22 @@ IRC_PROTOCOL_CALLBACK(005) pos2[0] = ' '; } + /* save monitor (limit) */ + pos = strstr (argv_eol[3], "MONITOR="); + if (pos) + { + pos += 8; + pos2 = strchr (pos, ' '); + if (pos2) + pos2[0] = '\0'; + error = NULL; + value = strtol (pos, &error, 10); + if (error && !error[0] && (value > 0)) + server->monitor = (int)value; + if (pos2) + pos2[0] = ' '; + } + /* save whole message (concatenate to existing isupport, if any) */ pos_start = NULL; pos = strstr (argv_eol[3], " :"); @@ -4667,6 +4687,162 @@ IRC_PROTOCOL_CALLBACK(729) } /* + * Callback for the IRC message "730": monitored nicks are online + * (RPL_MONONLINE). + * + * Message looks like: + * :server 730 mynick :nick1!user1@host1,nick2!user2@host2 + */ + +IRC_PROTOCOL_CALLBACK(730) +{ + struct t_irc_notify *ptr_notify; + const char *monitor_nick, *monitor_host; + char **nicks; + int i, num_nicks; + + IRC_PROTOCOL_MIN_ARGS(4); + + nicks = weechat_string_split ((argv_eol[3][0] == ':') ? + argv_eol[3] + 1 : argv_eol[3], + ",", 0, 0, &num_nicks); + if (nicks) + { + for (i = 0; i < num_nicks; i++) + { + monitor_nick = irc_message_get_nick_from_host (nicks[i]); + monitor_host = strchr (nicks[i], '!'); + if (monitor_host) + monitor_host++; + ptr_notify = irc_notify_search (server, monitor_nick); + if (ptr_notify) + irc_notify_set_is_on_server (ptr_notify, monitor_host, 1); + } + weechat_string_free_split (nicks); + } + + return WEECHAT_RC_OK; +} + +/* + * Callback for the IRC message "731": monitored nicks are offline + * (RPL_MONOFFLINE). + * + * Message looks like: + * :server 731 mynick :nick1!user1@host1,nick2!user2@host2 + */ + +IRC_PROTOCOL_CALLBACK(731) +{ + struct t_irc_notify *ptr_notify; + const char *monitor_nick, *monitor_host; + char **nicks; + int i, num_nicks; + + IRC_PROTOCOL_MIN_ARGS(4); + + nicks = weechat_string_split ((argv_eol[3][0] == ':') ? + argv_eol[3] + 1 : argv_eol[3], + ",", 0, 0, &num_nicks); + if (nicks) + { + for (i = 0; i < num_nicks; i++) + { + monitor_nick = irc_message_get_nick_from_host (nicks[i]); + monitor_host = strchr (nicks[i], '!'); + if (monitor_host) + monitor_host++; + ptr_notify = irc_notify_search (server, monitor_nick); + if (ptr_notify) + irc_notify_set_is_on_server (ptr_notify, monitor_host, 0); + } + weechat_string_free_split (nicks); + } + + return WEECHAT_RC_OK; +} + +/* + * Callback for the IRC message "732": list of monitored nicks (RPL_MONLIST). + * + * Message looks like: + * :server 732 mynick :nick1!user1@host1,nick2!user2@host2 + */ + +IRC_PROTOCOL_CALLBACK(732) +{ + char *pos_args; + + IRC_PROTOCOL_MIN_ARGS(3); + + pos_args = (argc > 3) ? + ((argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]) : NULL; + + weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, + command, "monitor", + NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL), + "%s%s", + weechat_prefix ("network"), + (pos_args && pos_args[0]) ? pos_args : ""); + + return WEECHAT_RC_OK; +} + +/* + * Callback for the IRC message "733": end of a monitor list (RPL_ENDOFMONLIST). + * + * Message looks like: + * :server 733 mynick :End of MONITOR list + */ + +IRC_PROTOCOL_CALLBACK(733) +{ + char *pos_args; + + IRC_PROTOCOL_MIN_ARGS(3); + + pos_args = (argc > 3) ? + ((argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]) : NULL; + + weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, + command, "monitor", + NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL), + "%s%s", + weechat_prefix ("network"), + (pos_args && pos_args[0]) ? pos_args : ""); + + return WEECHAT_RC_OK; +} + +/* + * Callback for the IRC message "734": monitor list is full (ERR_MONLISTFULL) + * + * Message looks like: + * :server 734 mynick limit nick1,nick2 :Monitor list is full. + */ + +IRC_PROTOCOL_CALLBACK(734) +{ + IRC_PROTOCOL_MIN_ARGS(5); + + weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, + command, "monitor", + NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL), + "%s%s (%s)", + weechat_prefix ("error"), + (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], + argv[3]); + + return WEECHAT_RC_OK; +} + +/* * Callback for the IRC message "900": logged in as (SASL). * * Message looks like: @@ -5005,6 +5181,11 @@ irc_protocol_recv_command (struct t_irc_server *server, { "671", /* whois (secure connection) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, { "728", /* quietlist */ 1, 0, &irc_protocol_cb_728 }, { "729", /* end of quietlist */ 1, 0, &irc_protocol_cb_729 }, + { "730", /* monitored nicks online */ 1, 0, &irc_protocol_cb_730 }, + { "731", /* monitored nicks offline */ 1, 0, &irc_protocol_cb_731 }, + { "732", /* list of monitored nicks */ 1, 0, &irc_protocol_cb_732 }, + { "733", /* end of monitor list */ 1, 0, &irc_protocol_cb_733 }, + { "734", /* monitor list is full */ 1, 0, &irc_protocol_cb_734 }, { "900", /* logged in as (SASL) */ 1, 0, &irc_protocol_cb_900 }, { "901", /* you are now logged in */ 1, 0, &irc_protocol_cb_901 }, { "903", /* SASL authentication successful */ 1, 0, &irc_protocol_cb_sasl_end }, diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c index 30da704bf..9d3194711 100644 --- a/src/plugins/irc/irc-redirect.c +++ b/src/plugins/irc/irc-redirect.c @@ -135,6 +135,17 @@ struct t_irc_redirect_pattern irc_redirect_patterns_default[] = NULL, NULL, NULL, }, + { "monitor", 0, 0, + /* + * monitor: start: 732: list of monitored nicks + * stop: 733: end of a monitor list + * extra; - + */ + "732:2", + "733:1", + NULL, + NULL, NULL, + }, { "names", 0, 0, /* * names: start: 353: list of nicks on channel diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 2e51a06c2..d7b391401 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -980,6 +980,8 @@ irc_server_alloc (const char *name) new_server->casemapping = IRC_SERVER_CASEMAPPING_RFC1459; new_server->chantypes = NULL; new_server->chanmodes = NULL; + new_server->monitor = 0; + new_server->monitor_time = 0; new_server->reconnect_delay = 0; new_server->reconnect_start = 0; new_server->command_time = 0; @@ -1007,6 +1009,7 @@ irc_server_alloc (const char *name) new_server->last_redirect = NULL; new_server->notify_list = NULL; new_server->last_notify = NULL; + new_server->notify_count = 0; new_server->join_manual = weechat_hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_TIME, @@ -2826,129 +2829,138 @@ irc_server_timer_cb (void *data, int remaining_calls) } else { - if (ptr_server->is_connected) - { - /* send queued messages */ - irc_server_outqueue_send (ptr_server); + if (!ptr_server->is_connected) + continue; - /* check for lag */ - if ((weechat_config_integer (irc_config_network_lag_check) > 0) - && (ptr_server->lag_check_time.tv_sec == 0) - && (current_time >= ptr_server->lag_next_check)) - { - irc_server_sendf (ptr_server, 0, NULL, "PING %s", - (ptr_server->current_address) ? - ptr_server->current_address : "weechat"); - gettimeofday (&(ptr_server->lag_check_time), NULL); - ptr_server->lag = 0; - ptr_server->lag_last_refresh = 0; - } - else + /* send queued messages */ + irc_server_outqueue_send (ptr_server); + + /* check for lag */ + if ((weechat_config_integer (irc_config_network_lag_check) > 0) + && (ptr_server->lag_check_time.tv_sec == 0) + && (current_time >= ptr_server->lag_next_check)) + { + irc_server_sendf (ptr_server, 0, NULL, "PING %s", + (ptr_server->current_address) ? + ptr_server->current_address : "weechat"); + gettimeofday (&(ptr_server->lag_check_time), NULL); + ptr_server->lag = 0; + ptr_server->lag_last_refresh = 0; + } + else + { + /* check away (only if lag check was not done) */ + away_check = IRC_SERVER_OPTION_INTEGER(ptr_server, IRC_SERVER_OPTION_AWAY_CHECK); + if (away_check > 0) { - /* check away (only if lag check was not done) */ - away_check = IRC_SERVER_OPTION_INTEGER(ptr_server, IRC_SERVER_OPTION_AWAY_CHECK); - if (away_check > 0) + if ((ptr_server->last_away_check == 0) + || (current_time >= ptr_server->last_away_check + (away_check * 60))) { - if ((ptr_server->last_away_check == 0) - || (current_time >= ptr_server->last_away_check + (away_check * 60))) - { - irc_server_check_away (ptr_server); - } + irc_server_check_away (ptr_server); } } + } - /* check if it's time to autojoin channels (after command delay) */ - if ((ptr_server->command_time != 0) - && (current_time >= ptr_server->command_time + - IRC_SERVER_OPTION_INTEGER(ptr_server, IRC_SERVER_OPTION_COMMAND_DELAY))) + /* check if it's time to autojoin channels (after command delay) */ + if ((ptr_server->command_time != 0) + && (current_time >= ptr_server->command_time + + IRC_SERVER_OPTION_INTEGER(ptr_server, IRC_SERVER_OPTION_COMMAND_DELAY))) + { + irc_server_autojoin_channels (ptr_server); + ptr_server->command_time = 0; + } + + /* check if it's time to send MONITOR command */ + if ((ptr_server->monitor_time != 0) + && (current_time >= ptr_server->monitor_time)) + { + if (ptr_server->monitor > 0) + irc_notify_send_monitor (ptr_server); + ptr_server->monitor_time = 0; + } + + /* compute lag */ + if (ptr_server->lag_check_time.tv_sec != 0) + { + gettimeofday (&tv, NULL); + ptr_server->lag = (int) weechat_util_timeval_diff (&(ptr_server->lag_check_time), + &tv); + /* refresh lag item if needed */ + if (((ptr_server->lag_last_refresh == 0) + || (current_time >= ptr_server->lag_last_refresh + weechat_config_integer (irc_config_network_lag_refresh_interval))) + && (ptr_server->lag >= weechat_config_integer (irc_config_network_lag_min_show))) { - irc_server_autojoin_channels (ptr_server); - ptr_server->command_time = 0; + ptr_server->lag_last_refresh = current_time; + weechat_bar_item_update ("lag"); } - - /* compute lag */ - if (ptr_server->lag_check_time.tv_sec != 0) + /* lag timeout? => disconnect */ + if ((weechat_config_integer (irc_config_network_lag_reconnect) > 0) + && (ptr_server->lag >= weechat_config_integer (irc_config_network_lag_reconnect) * 1000)) + { + weechat_printf (ptr_server->buffer, + _("%s%s: lag is high, reconnecting to " + "server %s%s%s"), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + ptr_server->name, + IRC_COLOR_RESET); + irc_server_disconnect (ptr_server, 0, 1); + } + else { - gettimeofday (&tv, NULL); - ptr_server->lag = (int) weechat_util_timeval_diff (&(ptr_server->lag_check_time), - &tv); - /* refresh lag item if needed */ - if (((ptr_server->lag_last_refresh == 0) - || (current_time >= ptr_server->lag_last_refresh + weechat_config_integer (irc_config_network_lag_refresh_interval))) - && (ptr_server->lag >= weechat_config_integer (irc_config_network_lag_min_show))) + /* stop lag counting if max lag is reached */ + if ((weechat_config_integer (irc_config_network_lag_max) > 0) + && (ptr_server->lag >= (weechat_config_integer (irc_config_network_lag_max) * 1000))) { + /* refresh lag item */ ptr_server->lag_last_refresh = current_time; weechat_bar_item_update ("lag"); - } - /* lag timeout? => disconnect */ - if ((weechat_config_integer (irc_config_network_lag_reconnect) > 0) - && (ptr_server->lag >= weechat_config_integer (irc_config_network_lag_reconnect) * 1000)) - { - weechat_printf (ptr_server->buffer, - _("%s%s: lag is high, reconnecting to " - "server %s%s%s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_SERVER, - ptr_server->name, - IRC_COLOR_RESET); - irc_server_disconnect (ptr_server, 0, 1); - } - else - { - /* stop lag counting if max lag is reached */ - if ((weechat_config_integer (irc_config_network_lag_max) > 0) - && (ptr_server->lag >= (weechat_config_integer (irc_config_network_lag_max) * 1000))) - { - /* refresh lag item */ - ptr_server->lag_last_refresh = current_time; - weechat_bar_item_update ("lag"); - - /* schedule next lag check in 5 seconds */ - ptr_server->lag_check_time.tv_sec = 0; - ptr_server->lag_check_time.tv_usec = 0; - ptr_server->lag_next_check = time (NULL) + - weechat_config_integer (irc_config_network_lag_check); - } + + /* schedule next lag check in 5 seconds */ + ptr_server->lag_check_time.tv_sec = 0; + ptr_server->lag_check_time.tv_usec = 0; + ptr_server->lag_next_check = time (NULL) + + weechat_config_integer (irc_config_network_lag_check); } } + } - /* remove redirects if timeout occurs */ - ptr_redirect = ptr_server->redirects; - while (ptr_redirect) - { - ptr_next_redirect = ptr_redirect->next_redirect; - - if ((ptr_redirect->start_time > 0) - && (ptr_redirect->start_time + ptr_redirect->timeout < current_time)) - { - irc_redirect_stop (ptr_redirect, "timeout"); - } + /* remove redirects if timeout occurs */ + ptr_redirect = ptr_server->redirects; + while (ptr_redirect) + { + ptr_next_redirect = ptr_redirect->next_redirect; - ptr_redirect = ptr_next_redirect; + if ((ptr_redirect->start_time > 0) + && (ptr_redirect->start_time + ptr_redirect->timeout < current_time)) + { + irc_redirect_stop (ptr_redirect, "timeout"); } - /* purge some data (every 10 minutes) */ - if (current_time > ptr_server->last_data_purge + (60 * 10)) + ptr_redirect = ptr_next_redirect; + } + + /* purge some data (every 10 minutes) */ + if (current_time > ptr_server->last_data_purge + (60 * 10)) + { + weechat_hashtable_map (ptr_server->join_manual, + &irc_server_check_join_manual_cb, + NULL); + weechat_hashtable_map (ptr_server->join_noswitch, + &irc_server_check_join_noswitch_cb, + NULL); + for (ptr_channel = ptr_server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) { - weechat_hashtable_map (ptr_server->join_manual, - &irc_server_check_join_manual_cb, - NULL); - weechat_hashtable_map (ptr_server->join_noswitch, - &irc_server_check_join_noswitch_cb, - NULL); - for (ptr_channel = ptr_server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) + if (ptr_channel->join_smart_filtered) { - if (ptr_channel->join_smart_filtered) - { - weechat_hashtable_map (ptr_channel->join_smart_filtered, - &irc_server_check_join_smart_filtered_cb, - NULL); - } + weechat_hashtable_map (ptr_channel->join_smart_filtered, + &irc_server_check_join_smart_filtered_cb, + NULL); } - ptr_server->last_data_purge = current_time; } + ptr_server->last_data_purge = current_time; } } } @@ -4251,7 +4263,7 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address, if (switch_address) irc_server_switch_address (server, 0); else - irc_server_set_index_current_address(server, 0); + irc_server_set_index_current_address (server, 0); if (server->nick_modes) { @@ -4267,6 +4279,8 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address, server->lag_next_check = time (NULL) + weechat_config_integer (irc_config_network_lag_check); server->lag_last_refresh = 0; + server->monitor = 0; + server->monitor_time = 0; if (reconnect && IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_AUTORECONNECT)) @@ -4789,6 +4803,8 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name) WEECHAT_HDATA_VAR(struct t_irc_server, casemapping, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, chantypes, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, chanmodes, STRING, 0, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_irc_server, monitor, INTEGER, 0, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_irc_server, monitor_time, TIME, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_delay, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_start, TIME, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, command_time, TIME, 0, NULL, NULL); @@ -4811,6 +4827,7 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name) WEECHAT_HDATA_VAR(struct t_irc_server, last_redirect, POINTER, 0, NULL, "irc_redirect"); WEECHAT_HDATA_VAR(struct t_irc_server, notify_list, POINTER, 0, NULL, "irc_notify"); WEECHAT_HDATA_VAR(struct t_irc_server, last_notify, POINTER, 0, NULL, "irc_notify"); + WEECHAT_HDATA_VAR(struct t_irc_server, notify_count, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, join_manual, HASHTABLE, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, join_channel_key, HASHTABLE, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, join_noswitch, HASHTABLE, 0, NULL, NULL); @@ -5003,6 +5020,10 @@ irc_server_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_string (ptr_item, "chanmodes", server->chanmodes)) return 0; + if (!weechat_infolist_new_var_integer (ptr_item, "monitor", server->monitor)) + return 0; + if (!weechat_infolist_new_var_time (ptr_item, "monitor_time", server->monitor_time)) + return 0; if (!weechat_infolist_new_var_integer (ptr_item, "reconnect_delay", server->reconnect_delay)) return 0; if (!weechat_infolist_new_var_time (ptr_item, "reconnect_start", server->reconnect_start)) @@ -5337,6 +5358,8 @@ irc_server_print_log () irc_server_casemapping_string[ptr_server->casemapping]); weechat_log_printf (" chantypes. . . . . . : '%s'", ptr_server->chantypes); weechat_log_printf (" chanmodes. . . . . . : '%s'", ptr_server->chanmodes); + weechat_log_printf (" monitor. . . . . . . : %d", ptr_server->monitor); + weechat_log_printf (" monitor_time . . . . : %ld", ptr_server->monitor_time); weechat_log_printf (" reconnect_delay. . . : %d", ptr_server->reconnect_delay); weechat_log_printf (" reconnect_start. . . : %ld", ptr_server->reconnect_start); weechat_log_printf (" command_time . . . . : %ld", ptr_server->command_time); @@ -5364,6 +5387,7 @@ irc_server_print_log () weechat_log_printf (" last_redirect. . . . : 0x%lx", ptr_server->last_redirect); weechat_log_printf (" notify_list. . . . . : 0x%lx", ptr_server->notify_list); weechat_log_printf (" last_notify. . . . . : 0x%lx", ptr_server->last_notify); + weechat_log_printf (" notify_count . . . . : %d", ptr_server->notify_count); weechat_log_printf (" join_manual. . . . . : 0x%lx (hashtable: '%s')", ptr_server->join_manual, weechat_hashtable_get_string (ptr_server->join_manual, "keys_values")); diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h index efcf094c6..6b4a9d9fb 100644 --- a/src/plugins/irc/irc-server.h +++ b/src/plugins/irc/irc-server.h @@ -181,6 +181,8 @@ struct t_irc_server char *chantypes; /* chantypes from msg 005 (eg "&#") */ char *chanmodes; /* chanmodes from msg 005 */ /* (eg "beI,k,l,imnpstaqr") */ + int monitor; /* monitor limit from msg 005 (eg 100) */ + time_t monitor_time; /* time for monitoring nicks (on connect)*/ int reconnect_delay; /* current reconnect delay (growing) */ time_t reconnect_start; /* this time + delay = reconnect time */ time_t command_time; /* this time + command_delay = time to */ @@ -205,6 +207,7 @@ struct t_irc_server struct t_irc_redirect *last_redirect; /* last command redirection */ struct t_irc_notify *notify_list; /* list of notify */ struct t_irc_notify *last_notify; /* last notify */ + int notify_count; /* number of notify in list */ struct t_hashtable *join_manual; /* manual joins pending */ struct t_hashtable *join_channel_key; /* keys pending for joins */ struct t_hashtable *join_noswitch; /* joins w/o switch to buffer */ diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c index f56fd7d5e..dfc76d718 100644 --- a/src/plugins/irc/irc-upgrade.c +++ b/src/plugins/irc/irc-upgrade.c @@ -403,6 +403,24 @@ irc_upgrade_read_cb (void *data, if (str) irc_upgrade_current_server->chanmodes = strdup (str); } + /* "monitor" is new in WeeChat 0.4.3 */ + if (weechat_infolist_search_var (infolist, "monitor")) + { + irc_upgrade_current_server->monitor = weechat_infolist_integer (infolist, "monitor"); + } + else + { + /* WeeChat <= 0.4.2 */ + str = irc_server_get_isupport_value (irc_upgrade_current_server, + "MONITOR"); + if (str) + { + error = NULL; + number = strtol (str, &error, 10); + if (error && !error[0]) + irc_upgrade_current_server->monitor = (int)number; + } + } irc_upgrade_current_server->reconnect_delay = weechat_infolist_integer (infolist, "reconnect_delay"); irc_upgrade_current_server->reconnect_start = weechat_infolist_time (infolist, "reconnect_start"); irc_upgrade_current_server->command_time = weechat_infolist_time (infolist, "command_time"); |