From 770c73ec435f9736dd9b6ca81e72eae6eb09651c Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 15 Mar 2009 12:46:30 +0100 Subject: [PATCH] Add new option irc.look.display_old_topic to display old topic when channel topic is changed --- doc/de/autogen/irc_options.xml | 10 +++++ doc/de/autogen/weechat_commands.xml | 7 +++- doc/en/autogen/irc_options.xml | 10 +++++ doc/en/autogen/weechat_commands.xml | 7 +++- doc/fr/autogen/irc_commands.xml | 2 +- doc/fr/autogen/irc_options.xml | 10 +++++ doc/fr/autogen/weechat_commands.xml | 7 +++- po/cs.po | 13 +++++-- po/de.po | 13 +++++-- po/es.po | 13 +++++-- po/fr.po | 21 ++++++---- po/hu.po | 13 +++++-- po/ru.po | 13 +++++-- po/weechat.pot | 13 +++++-- src/plugins/irc/irc-config.c | 7 ++++ src/plugins/irc/irc-config.h | 1 + src/plugins/irc/irc-protocol.c | 59 +++++++++++++++++++++-------- 17 files changed, 171 insertions(+), 48 deletions(-) diff --git a/doc/de/autogen/irc_options.xml b/doc/de/autogen/irc_options.xml index 17df5b5a4..292e30578 100644 --- a/doc/de/autogen/irc_options.xml +++ b/doc/de/autogen/irc_options.xml @@ -76,6 +76,16 @@ +irc.look.display_old_topic: display old topic when channel topic is changed + + + type: boolean + + + values: on, off (default value: on) + + + irc.look.hide_nickserv_pwd: Von NickServ angezeigte Passwörter verstecken diff --git a/doc/de/autogen/weechat_commands.xml b/doc/de/autogen/weechat_commands.xml index 04da6bf84..8b2a36912 100644 --- a/doc/de/autogen/weechat_commands.xml +++ b/doc/de/autogen/weechat_commands.xml @@ -118,6 +118,8 @@ plugin.buffer: plugin and buffer where filter is active ("*" for all buffers) tags: comma separated list of tags, for example: "irc_join,irc_part,irc_quit" regex: regular expression to search in line (use \t to separate prefix from message) +The default key alt+'=' toggles filtering on/off. + Examples: use IRC smart filter for join/part/quit messages: /filter add irc_smart * irc_smart_filter * @@ -282,7 +284,7 @@ zeigt die Uptime von Weechat an -o: sendet die Weechat-Uptime als IRC-Nachricht in den aktuellen Channel -/window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight ] +/window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight | zoom] Fenster verwalten @@ -301,6 +303,7 @@ Fenster verwalten page_up: scroll one page up page_down: scroll one page down + refresh: refresh screen scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years scroll_up: scroll a few lines up scroll_down: scroll a few lines down @@ -308,7 +311,7 @@ Fenster verwalten scroll_bottom: scroll to bottom of buffer scroll_previous_highlight: scroll to previous highlight scroll_next_highlight: scroll to next highlight - refresh: refresh screen + zoom: zoom on window For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4 diff --git a/doc/en/autogen/irc_options.xml b/doc/en/autogen/irc_options.xml index 61743bb95..4bfdd15ae 100644 --- a/doc/en/autogen/irc_options.xml +++ b/doc/en/autogen/irc_options.xml @@ -76,6 +76,16 @@ +irc.look.display_old_topic: display old topic when channel topic is changed + + + type: boolean + + + values: on, off (default value: on) + + + irc.look.hide_nickserv_pwd: hide password displayed by nickserv diff --git a/doc/en/autogen/weechat_commands.xml b/doc/en/autogen/weechat_commands.xml index 01d4cf804..8bd7d93cf 100644 --- a/doc/en/autogen/weechat_commands.xml +++ b/doc/en/autogen/weechat_commands.xml @@ -118,6 +118,8 @@ plugin.buffer: plugin and buffer where filter is active ("*" for all buffers) tags: comma separated list of tags, for example: "irc_join,irc_part,irc_quit" regex: regular expression to search in line (use \t to separate prefix from message) +The default key alt+'=' toggles filtering on/off. + Examples: use IRC smart filter for join/part/quit messages: /filter add irc_smart * irc_smart_filter * @@ -282,7 +284,7 @@ show WeeChat uptime -o: send uptime on current channel as an IRC message -/window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight ] +/window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight | zoom] manage windows @@ -301,6 +303,7 @@ manage windows page_up: scroll one page up page_down: scroll one page down + refresh: refresh screen scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years scroll_up: scroll a few lines up scroll_down: scroll a few lines down @@ -308,7 +311,7 @@ manage windows scroll_bottom: scroll to bottom of buffer scroll_previous_highlight: scroll to previous highlight scroll_next_highlight: scroll to next highlight - refresh: refresh screen + zoom: zoom on window For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4 diff --git a/doc/fr/autogen/irc_commands.xml b/doc/fr/autogen/irc_commands.xml index 41bceba7f..d1062d8f7 100644 --- a/doc/fr/autogen/irc_commands.xml +++ b/doc/fr/autogen/irc_commands.xml @@ -203,7 +203,7 @@ masque_serveur: liste des serveurs correspondant au masque /list [canal[,canal] [serveur]] -lister les canaux et leur sujet +lister les canaux et leur titre canal: canal à lister (une expression régulière est acceptée) serveur: nom du serveur diff --git a/doc/fr/autogen/irc_options.xml b/doc/fr/autogen/irc_options.xml index fc67d25f2..6ef32a304 100644 --- a/doc/fr/autogen/irc_options.xml +++ b/doc/fr/autogen/irc_options.xml @@ -76,6 +76,16 @@ +irc.look.display_old_topic: afficher l'ancien titre lorsque le titre du canal est changé + + + type: booléen + + + valeurs: on, off (valeur par défaut: on) + + + irc.look.hide_nickserv_pwd: masquer le mot de passe affiché par nickserv diff --git a/doc/fr/autogen/weechat_commands.xml b/doc/fr/autogen/weechat_commands.xml index 136f12bb6..de764c748 100644 --- a/doc/fr/autogen/weechat_commands.xml +++ b/doc/fr/autogen/weechat_commands.xml @@ -116,6 +116,8 @@ extension.tampon: extension et tampon où le filtre est actif ("*" pour tous les tags: liste de tags, séparés par des virgules, par exemple: "irc_join,irc_part,irc_quit" regex: expressoin régulière à rechercher dans la ligne (utiliser \t pour séparer le préfixe du message) +La touche par défaut alt+'=' active/désactive le filtrage. + Exemples: utiliser le filtre intelligent IRC pour les messages join/part/quit: /filter add irc_smart * irc_smart_filter * @@ -281,7 +283,7 @@ montrer l'uptime de WeeChat -o: envoyer l'uptime sur le canal courant en tant que message IRC -/window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [ptc] | resize pct | merge [all] | page_up | page_down | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight] +/window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [ptc] | resize pct | merge [all] | page_up | page_down | refresh | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight | zoom] gestion des fenêtres @@ -299,6 +301,7 @@ gestion des fenêtres merge: fusionne la fenêtre avec une autre page_up: défilement d'une page vers le haut page_down: défilement d'une page vers le bas + refresh: redessine l'écran scroll: défilement d'un nombre de lignes (+/-N) ou avec du temps: s=secondes, m=minutes, h=heures, d=jours, M=mois, y=année scroll_up: défilement de quelques lignes vers le haut scroll_down: défilement de quelques lignes vers le bas @@ -306,7 +309,7 @@ gestion des fenêtres scroll_bottom: défilement jusqu'au bas du tampon scroll_previous_highlight: défilement jusqu'au highlight précédent scroll_next_highlight: défilement jusqu'au highlight suivant - refresh: redessine l'écran + zoom: zoom sur la fenêtre Pour splith et splitv, pct est un pourcentage qui représente la taille de la nouvelle fenêtre, calculée par rapport à la taille de la fenêtre courante. Par exemple 25 signifie créer une fenêtre qui a pour taille: taille_courante / 4 diff --git a/po/cs.po b/po/cs.po index 994222315..86cf42f31 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-03-15 11:55+0100\n" +"POT-Creation-Date: 2009-03-15 12:35+0100\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -3526,6 +3526,9 @@ msgstr "" msgid "display nick modes in \"input_prompt\" bar item" msgstr "" +msgid "display old topic when channel topic is changed" +msgstr "" + msgid "hide password displayed by nickserv" msgstr "schovat heslo zobrazené nickservem" @@ -3802,7 +3805,11 @@ msgid "%s%s: \"%s\" command received without channel" msgstr "%s \"%s\" příkaz obdržen bez kanálu\n" #, fuzzy, c-format -msgid "%s%s%s%s has changed topic for %s%s%s to: \"%s%s\"" +msgid "%s%s%s%s has changed topic for %s%s%s from \"%s%s\" to \"%s%s\"" +msgstr "%s%s%s změnil téma pro %s%s%s na:" + +#, fuzzy, c-format +msgid "%s%s%s%s has changed topic for %s%s%s to \"%s%s\"" msgstr "%s%s%s změnil téma pro %s%s%s na:" #, fuzzy, c-format @@ -3869,7 +3876,7 @@ msgid "%sNo topic set for channel %s%s" msgstr "Není nastaveno téma pro %s%s\n" #, fuzzy, c-format -msgid "%sTopic for %s%s%s is: \"%s%s\"" +msgid "%sTopic for %s%s%s is \"%s%s\"" msgstr "Téma pro %s%s%s je: " #, fuzzy, c-format diff --git a/po/de.po b/po/de.po index 7c3d123c3..5f3a23518 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-03-15 11:55+0100\n" +"POT-Creation-Date: 2009-03-15 12:35+0100\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Thomas Schuetz \n" "Language-Team: weechat-dev \n" @@ -3510,6 +3510,9 @@ msgstr "" msgid "display nick modes in \"input_prompt\" bar item" msgstr "" +msgid "display old topic when channel topic is changed" +msgstr "" + msgid "hide password displayed by nickserv" msgstr "Von NickServ angezeigte Passwörter verstecken" @@ -3785,7 +3788,11 @@ msgid "%s%s: \"%s\" command received without channel" msgstr "%s \"%s\"-Befehl empfangen ohne Channel\n" #, fuzzy, c-format -msgid "%s%s%s%s has changed topic for %s%s%s to: \"%s%s\"" +msgid "%s%s%s%s has changed topic for %s%s%s from \"%s%s\" to \"%s%s\"" +msgstr "%s%s%s setzt das Topic für %s%s%s auf:" + +#, fuzzy, c-format +msgid "%s%s%s%s has changed topic for %s%s%s to \"%s%s\"" msgstr "%s%s%s setzt das Topic für %s%s%s auf:" #, fuzzy, c-format @@ -3852,7 +3859,7 @@ msgid "%sNo topic set for channel %s%s" msgstr "Kein Topic gesetzt für %s%s\n" #, fuzzy, c-format -msgid "%sTopic for %s%s%s is: \"%s%s\"" +msgid "%sTopic for %s%s%s is \"%s%s\"" msgstr "Das Topic von %s%s%s lautet: " #, fuzzy, c-format diff --git a/po/es.po b/po/es.po index 682307fb5..2e5225d0f 100644 --- a/po/es.po +++ b/po/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-03-15 11:55+0100\n" +"POT-Creation-Date: 2009-03-15 12:35+0100\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Roberto González Cardenete \n" "Language-Team: weechat-dev \n" @@ -3497,6 +3497,9 @@ msgstr "" msgid "display nick modes in \"input_prompt\" bar item" msgstr "" +msgid "display old topic when channel topic is changed" +msgstr "" + msgid "hide password displayed by nickserv" msgstr "ocultar contraseña mostrada por nickserv" @@ -3773,7 +3776,11 @@ msgid "%s%s: \"%s\" command received without channel" msgstr "%s comando \"%s\" recibido sin canal\n" #, fuzzy, c-format -msgid "%s%s%s%s has changed topic for %s%s%s to: \"%s%s\"" +msgid "%s%s%s%s has changed topic for %s%s%s from \"%s%s\" to \"%s%s\"" +msgstr "%s%s%s ha cambiado el tema para %s%s%s a:" + +#, fuzzy, c-format +msgid "%s%s%s%s has changed topic for %s%s%s to \"%s%s\"" msgstr "%s%s%s ha cambiado el tema para %s%s%s a:" #, fuzzy, c-format @@ -3840,7 +3847,7 @@ msgid "%sNo topic set for channel %s%s" msgstr "Sin tema establecido para %s%s\n" #, fuzzy, c-format -msgid "%sTopic for %s%s%s is: \"%s%s\"" +msgid "%sTopic for %s%s%s is \"%s%s\"" msgstr "El tema para %s%s%s es: " #, fuzzy, c-format diff --git a/po/fr.po b/po/fr.po index f5d800847..418b936c1 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-03-15 11:55+0100\n" -"PO-Revision-Date: 2009-03-15 11:56+0100\n" +"POT-Creation-Date: 2009-03-15 12:35+0100\n" +"PO-Revision-Date: 2009-03-15 12:35+0100\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "MIME-Version: 1.0\n" @@ -3003,7 +3003,7 @@ msgstr "" "masque_serveur: liste des serveurs correspondant au masque" msgid "list channels and their topic" -msgstr "lister les canaux et leur sujet" +msgstr "lister les canaux et leur titre" msgid "[channel[,channel] [server]]" msgstr "[canal[,canal] [serveur]]" @@ -3641,6 +3641,9 @@ msgstr "affiche les modes du canal dans l'objet de barre \"buffer_name\"" msgid "display nick modes in \"input_prompt\" bar item" msgstr "affiche les modes du pseudo dans l'objet de barre \"input_prompt\"" +msgid "display old topic when channel topic is changed" +msgstr "afficher l'ancien titre lorsque le titre du canal est changé" + msgid "hide password displayed by nickserv" msgstr "masquer le mot de passe affiché par nickserv" @@ -3910,8 +3913,12 @@ msgid "%s%s: \"%s\" command received without channel" msgstr "%s%s: commande \"%s\" reçue sans canal" #, c-format -msgid "%s%s%s%s has changed topic for %s%s%s to: \"%s%s\"" -msgstr "%s%s%s%s a changé le titre pour %s%s%s en: \"%s%s\"" +msgid "%s%s%s%s has changed topic for %s%s%s from \"%s%s\" to \"%s%s\"" +msgstr "%s%s%s%s a changé le titre pour %s%s%s de \"%s%s\" en \"%s%s\"" + +#, c-format +msgid "%s%s%s%s has changed topic for %s%s%s to \"%s%s\"" +msgstr "%s%s%s%s a changé le titre pour %s%s%s en \"%s%s\"" #, c-format msgid "%s%s%s%s has unset topic for %s%s" @@ -3979,8 +3986,8 @@ msgid "%sNo topic set for channel %s%s" msgstr "%sPas de titre défini pour le canal %s%s" #, c-format -msgid "%sTopic for %s%s%s is: \"%s%s\"" -msgstr "%sLe titre pour %s%s%s est: \"%s%s\"" +msgid "%sTopic for %s%s%s is \"%s%s\"" +msgstr "%sLe titre pour %s%s%s est \"%s%s\"" #, c-format msgid "%sTopic set by %s%s%s on %s" diff --git a/po/hu.po b/po/hu.po index 6c6ddcfbe..8adb444a8 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-03-15 11:55+0100\n" +"POT-Creation-Date: 2009-03-15 12:35+0100\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -3545,6 +3545,9 @@ msgstr "" msgid "display nick modes in \"input_prompt\" bar item" msgstr "" +msgid "display old topic when channel topic is changed" +msgstr "" + msgid "hide password displayed by nickserv" msgstr "a nickserv által mutatott jelszó elrejtése" @@ -3813,7 +3816,11 @@ msgid "%s%s: \"%s\" command received without channel" msgstr "%s \"%s\" parancs érkezett szoba megadása nélkül\n" #, fuzzy, c-format -msgid "%s%s%s%s has changed topic for %s%s%s to: \"%s%s\"" +msgid "%s%s%s%s has changed topic for %s%s%s from \"%s%s\" to \"%s%s\"" +msgstr "%s%s%s megváltoztatta a %s%s%s szoba témáját:" + +#, fuzzy, c-format +msgid "%s%s%s%s has changed topic for %s%s%s to \"%s%s\"" msgstr "%s%s%s megváltoztatta a %s%s%s szoba témáját:" #, fuzzy, c-format @@ -3880,7 +3887,7 @@ msgid "%sNo topic set for channel %s%s" msgstr "Nincs téma beállítva a %s%s szobában\n" #, fuzzy, c-format -msgid "%sTopic for %s%s%s is: \"%s%s\"" +msgid "%sTopic for %s%s%s is \"%s%s\"" msgstr "A %s%s%s szoba témája: " #, fuzzy, c-format diff --git a/po/ru.po b/po/ru.po index 8f1edc585..8ce5a2550 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-03-15 11:55+0100\n" +"POT-Creation-Date: 2009-03-15 12:35+0100\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -3538,6 +3538,9 @@ msgstr "" msgid "display nick modes in \"input_prompt\" bar item" msgstr "" +msgid "display old topic when channel topic is changed" +msgstr "" + msgid "hide password displayed by nickserv" msgstr "скрывать пароль, отображаемый nickserv'ом" @@ -3806,7 +3809,11 @@ msgid "%s%s: \"%s\" command received without channel" msgstr "%s \"%s\" команда получена без канала\n" #, fuzzy, c-format -msgid "%s%s%s%s has changed topic for %s%s%s to: \"%s%s\"" +msgid "%s%s%s%s has changed topic for %s%s%s from \"%s%s\" to \"%s%s\"" +msgstr "%s%s%s сменил тему %s%s%s на:" + +#, fuzzy, c-format +msgid "%s%s%s%s has changed topic for %s%s%s to \"%s%s\"" msgstr "%s%s%s сменил тему %s%s%s на:" #, fuzzy, c-format @@ -3873,7 +3880,7 @@ msgid "%sNo topic set for channel %s%s" msgstr "Не установлена тема канала для %s%s\n" #, fuzzy, c-format -msgid "%sTopic for %s%s%s is: \"%s%s\"" +msgid "%sTopic for %s%s%s is \"%s%s\"" msgstr "Тема канала %s%s%s: " #, fuzzy, c-format diff --git a/po/weechat.pot b/po/weechat.pot index cb67b9084..2129af358 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: 2009-03-15 11:55+0100\n" +"POT-Creation-Date: 2009-03-15 12:35+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3009,6 +3009,9 @@ msgstr "" msgid "display nick modes in \"input_prompt\" bar item" msgstr "" +msgid "display old topic when channel topic is changed" +msgstr "" + msgid "hide password displayed by nickserv" msgstr "" @@ -3255,7 +3258,11 @@ msgid "%s%s: \"%s\" command received without channel" msgstr "" #, c-format -msgid "%s%s%s%s has changed topic for %s%s%s to: \"%s%s\"" +msgid "%s%s%s%s has changed topic for %s%s%s from \"%s%s\" to \"%s%s\"" +msgstr "" + +#, c-format +msgid "%s%s%s%s has changed topic for %s%s%s to \"%s%s\"" msgstr "" #, c-format @@ -3320,7 +3327,7 @@ msgid "%sNo topic set for channel %s%s" msgstr "" #, c-format -msgid "%sTopic for %s%s%s is: \"%s%s\"" +msgid "%sTopic for %s%s%s is \"%s%s\"" msgstr "" #, c-format diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 95040fd87..af3d21c36 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -51,6 +51,7 @@ struct t_config_option *irc_config_look_nick_completion_smart; struct t_config_option *irc_config_look_display_away; struct t_config_option *irc_config_look_display_channel_modes; struct t_config_option *irc_config_look_display_nick_modes; +struct t_config_option *irc_config_look_display_old_topic; struct t_config_option *irc_config_look_hide_nickserv_pwd; struct t_config_option *irc_config_look_highlight_tags; struct t_config_option *irc_config_look_notice_as_pv; @@ -1078,6 +1079,12 @@ irc_config_init () N_("display nick modes in \"input_prompt\" bar item"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, &irc_config_change_look_display_nick_modes, NULL, NULL, NULL); + irc_config_look_display_old_topic = weechat_config_new_option ( + irc_config_file, ptr_section, + "display_old_topic", "boolean", + N_("display old topic when channel topic is changed"), + NULL, 0, 0, "on", NULL, 0, NULL, NULL, + NULL, NULL, NULL, NULL); irc_config_look_hide_nickserv_pwd = weechat_config_new_option ( irc_config_file, ptr_section, "hide_nickserv_pwd", "boolean", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 836c7f7f8..6e735e0c5 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -40,6 +40,7 @@ extern struct t_config_option *irc_config_look_nick_completion_smart; extern struct t_config_option *irc_config_look_display_away; extern struct t_config_option *irc_config_look_display_channel_modes; extern struct t_config_option *irc_config_look_display_nick_modes; +extern struct t_config_option *irc_config_look_display_old_topic; extern struct t_config_option *irc_config_look_hide_nickserv_pwd; extern struct t_config_option *irc_config_look_highlight_tags; extern struct t_config_option *irc_config_look_notice_as_pv; diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index e1173e1ab..dbca108fd 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -2272,7 +2272,7 @@ int irc_protocol_cmd_topic (struct t_irc_server *server, const char *command, int argc, char **argv, char **argv_eol) { - char *pos_topic, *topic_color; + char *pos_topic, *old_topic_color, *topic_color; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; struct t_gui_buffer *ptr_buffer; @@ -2306,20 +2306,47 @@ irc_protocol_cmd_topic (struct t_irc_server *server, const char *command, { topic_color = irc_color_decode (pos_topic, weechat_config_boolean (irc_config_network_colors_receive)); - weechat_printf_tags (ptr_buffer, - irc_protocol_tags (command, NULL), - _("%s%s%s%s has changed topic for %s%s%s to: " - "\"%s%s\""), - (ptr_buffer == server->buffer) ? - irc_buffer_get_server_prefix (server, "network") : weechat_prefix ("network"), - IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), - nick, - IRC_COLOR_CHAT, - IRC_COLOR_CHAT_CHANNEL, - argv[2], - IRC_COLOR_CHAT, - (topic_color) ? topic_color : pos_topic, - IRC_COLOR_CHAT); + if (weechat_config_boolean (irc_config_look_display_old_topic) + && ptr_channel && ptr_channel->topic && ptr_channel->topic[0]) + { + old_topic_color = irc_color_decode (ptr_channel->topic, + weechat_config_boolean (irc_config_network_colors_receive)); + weechat_printf_tags (ptr_buffer, + irc_protocol_tags (command, NULL), + _("%s%s%s%s has changed topic for %s%s%s " + "from \"%s%s\" to \"%s%s\""), + (ptr_buffer == server->buffer) ? + irc_buffer_get_server_prefix (server, "network") : weechat_prefix ("network"), + IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_CHAT, + (old_topic_color) ? old_topic_color : ptr_channel->topic, + IRC_COLOR_CHAT, + (topic_color) ? topic_color : pos_topic, + IRC_COLOR_CHAT); + if (old_topic_color) + free (old_topic_color); + } + else + { + weechat_printf_tags (ptr_buffer, + irc_protocol_tags (command, NULL), + _("%s%s%s%s has changed topic for %s%s%s to " + "\"%s%s\""), + (ptr_buffer == server->buffer) ? + irc_buffer_get_server_prefix (server, "network") : weechat_prefix ("network"), + IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick), + nick, + IRC_COLOR_CHAT, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_CHAT, + (topic_color) ? topic_color : pos_topic, + IRC_COLOR_CHAT); + } if (topic_color) free (topic_color); } @@ -3308,7 +3335,7 @@ irc_protocol_cmd_332 (struct t_irc_server *server, const char *command, weechat_printf_tags (ptr_buffer, irc_protocol_tags (command, "irc_numeric"), - _("%sTopic for %s%s%s is: \"%s%s\""), + _("%sTopic for %s%s%s is \"%s%s\""), (ptr_buffer == server->buffer) ? irc_buffer_get_server_prefix (server, "network") : weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL,