core: add options weechat.look.quote_{nick_prefix|nick_suffix|time_format} to customize quoted messages in cursor mode (closes #403)

This commit is contained in:
Sébastien Helleu 2015-04-19 12:02:41 +02:00
parent 7ad2744b33
commit 60f2b50117
22 changed files with 330 additions and 29 deletions

View File

@ -19,6 +19,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
=== New features
* core: add options weechat.look.quote_{nick_prefix|nick_suffix|time_format} to
customize quoted messages in cursor mode (closes #403)
* core: add a welcome message on first WeeChat run (closes #318)
* core: add options weechat.look.word_chars_{highlight|input}
(closes #55, task #9459)

View File

@ -827,6 +827,21 @@
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `"|"`)
* [[option_weechat.look.quote_nick_prefix]] *weechat.look.quote_nick_prefix*
** Beschreibung: `text to display before nick when quoting a message (see /help cursor)`
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `"<"`)
* [[option_weechat.look.quote_nick_suffix]] *weechat.look.quote_nick_suffix*
** Beschreibung: `text to display after nick when quoting a message (see /help cursor)`
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `">"`)
* [[option_weechat.look.quote_time_format]] *weechat.look.quote_time_format*
** Beschreibung: `time format when quoting a message (see /help cursor)`
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `"%H:%M:%S"`)
* [[option_weechat.look.read_marker]] *weechat.look.read_marker*
** Beschreibung: `nutzt eine Linie oder ein Zeichen, als Lesezeichen, um die erste ungelesene Nachricht in einem Buffer hervorzuheben`
** Typ: integer

View File

@ -827,6 +827,21 @@
** type: string
** values: any string (default value: `"|"`)
* [[option_weechat.look.quote_nick_prefix]] *weechat.look.quote_nick_prefix*
** description: `text to display before nick when quoting a message (see /help cursor)`
** type: string
** values: any string (default value: `"<"`)
* [[option_weechat.look.quote_nick_suffix]] *weechat.look.quote_nick_suffix*
** description: `text to display after nick when quoting a message (see /help cursor)`
** type: string
** values: any string (default value: `">"`)
* [[option_weechat.look.quote_time_format]] *weechat.look.quote_time_format*
** description: `time format when quoting a message (see /help cursor)`
** type: string
** values: any string (default value: `"%H:%M:%S"`)
* [[option_weechat.look.read_marker]] *weechat.look.read_marker*
** description: `use a marker (line or char) on buffers to show first unread line`
** type: integer

View File

@ -827,6 +827,21 @@
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `"|"`)
* [[option_weechat.look.quote_nick_prefix]] *weechat.look.quote_nick_prefix*
** description: `texte à afficher avant le pseudo dans la citation d'un message (voir /help cursor)`
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `"<"`)
* [[option_weechat.look.quote_nick_suffix]] *weechat.look.quote_nick_suffix*
** description: `texte à afficher après le pseudo dans la citation d'un message (voir /help cursor)`
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `">"`)
* [[option_weechat.look.quote_time_format]] *weechat.look.quote_time_format*
** description: `format de date/heure dans la citation d'un message (voir /help cursor)`
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `"%H:%M:%S"`)
* [[option_weechat.look.read_marker]] *weechat.look.read_marker*
** description: `utiliser un marqueur (ligne ou caractère) sur les tampons pour montrer la première ligne non lue`
** type: entier

View File

@ -827,6 +827,21 @@
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `"|"`)
* [[option_weechat.look.quote_nick_prefix]] *weechat.look.quote_nick_prefix*
** descrizione: `text to display before nick when quoting a message (see /help cursor)`
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `"<"`)
* [[option_weechat.look.quote_nick_suffix]] *weechat.look.quote_nick_suffix*
** descrizione: `text to display after nick when quoting a message (see /help cursor)`
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `">"`)
* [[option_weechat.look.quote_time_format]] *weechat.look.quote_time_format*
** descrizione: `time format when quoting a message (see /help cursor)`
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `"%H:%M:%S"`)
* [[option_weechat.look.read_marker]] *weechat.look.read_marker*
** descrizione: `usa segnalibro (riga o carattere) sui buffer per mostrare la prima riga non letta`
** tipo: intero

View File

@ -827,6 +827,21 @@
** タイプ: 文字列
** 値: 未制約文字列 (デフォルト値: `"|"`)
* [[option_weechat.look.quote_nick_prefix]] *weechat.look.quote_nick_prefix*
** 説明: `text to display before nick when quoting a message (see /help cursor)`
** タイプ: 文字列
** 値: 未制約文字列 (デフォルト値: `"<"`)
* [[option_weechat.look.quote_nick_suffix]] *weechat.look.quote_nick_suffix*
** 説明: `text to display after nick when quoting a message (see /help cursor)`
** タイプ: 文字列
** 値: 未制約文字列 (デフォルト値: `">"`)
* [[option_weechat.look.quote_time_format]] *weechat.look.quote_time_format*
** 説明: `time format when quoting a message (see /help cursor)`
** タイプ: 文字列
** 値: 未制約文字列 (デフォルト値: `"%H:%M:%S"`)
* [[option_weechat.look.read_marker]] *weechat.look.read_marker*
** 説明: `最初の未読行を表示するマーカー (line か char) をバッファ内で使用`
** タイプ: 整数

View File

@ -827,6 +827,21 @@
** typ: ciąg
** wartości: dowolny ciąg (domyślna wartość: `"|"`)
* [[option_weechat.look.quote_nick_prefix]] *weechat.look.quote_nick_prefix*
** opis: `text to display before nick when quoting a message (see /help cursor)`
** typ: ciąg
** wartości: dowolny ciąg (domyślna wartość: `"<"`)
* [[option_weechat.look.quote_nick_suffix]] *weechat.look.quote_nick_suffix*
** opis: `text to display after nick when quoting a message (see /help cursor)`
** typ: ciąg
** wartości: dowolny ciąg (domyślna wartość: `">"`)
* [[option_weechat.look.quote_time_format]] *weechat.look.quote_time_format*
** opis: `time format when quoting a message (see /help cursor)`
** typ: ciąg
** wartości: dowolny ciąg (domyślna wartość: `"%H:%M:%S"`)
* [[option_weechat.look.read_marker]] *weechat.look.read_marker*
** opis: `używaj znacznika (linii albo znaku) do zaznaczania pierwszej nieprzeczytanej linii w buforze`
** typ: liczba

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-21 08:41+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3262,6 +3262,17 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "řetězec zobrazený za prefixem"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr "text pro zobrazení před přezdívkou v okně rozhovoru"
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "text pro zobrazení za přezdívkou v okně rozhovoru"
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
"použít značku (řádek nebo znak) v bufferech pro zobrazení první nepřečtené "

View File

@ -24,7 +24,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-04-15 18:52+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <>\n"
@ -3863,6 +3863,17 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "Nach dem Präfix anzufügende Zeichenfolge"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr "Text, der vor dem Nick dargestellt werden soll, Beispiel: \"<\""
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "Text, der nach dem Nick dargestellt werden soll, Beispiel: \">\""
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
"nutzt eine Linie oder ein Zeichen, als Lesezeichen, um die erste ungelesene "

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-21 08:41+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3454,6 +3454,17 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "cadena mostrada después del prefijo"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr "texto a mostrar antes del apodo en la ventana de charla"
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "texto a mostrar tras el apodo en la ventana de charla"
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
"usa un marcador (línea o carácter) para indicar la primera línea sin leer en "

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"PO-Revision-Date: 2015-04-19 09:06+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-04-19 11:30+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -3769,6 +3769,19 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "chaîne affichée après le préfixe"
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr ""
"texte à afficher avant le pseudo dans la citation d'un message (voir /help "
"cursor)"
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"texte à afficher après le pseudo dans la citation d'un message (voir /help "
"cursor)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "format de date/heure dans la citation d'un message (voir /help cursor)"
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
"utiliser un marqueur (ligne ou caractère) sur les tampons pour montrer la "

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-21 08:41+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2870,6 +2870,17 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "névkiegészítés után beszúrt szöveg"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr "a név előtt megjelenítendő szöveg a beszédablakban"
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "a név után megjelenítendő szöveg a beszédablakban"
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
#, fuzzy
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr "jelölje a szerveren/szobában utoljára olvasott sort"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-21 08:41+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3562,6 +3562,20 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "stringa visualizzata dopo il prefisso"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr ""
"testo da visualizzare prima del nick nel prefisso del messaggio, esempio: \"<"
"\""
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"testo da visualizzare dopo il nick nel prefisso del messaggio, esempio: \">\""
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
"usa segnalibro (riga o carattere) sui buffer per mostrare la prima riga non "

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-04-13 00:40+0900\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n"
@ -3629,6 +3629,19 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "プレフィックスの後ろに表示される文字列"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr ""
"メッセージプレフィックス中のニックネームの前に表示するテキスト、例: \"<\""
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"メッセージプレフィックス中のニックネームの後に表示するテキスト、例: \">\""
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr "最初の未読行を表示するマーカー (line か char) をバッファ内で使用"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-21 08:41+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3707,6 +3707,18 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "ciąg wyświetlany po przedrostku"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr "teks wyświetlany przed nickiem w prefiksie wiadomości, przykład: \"<\""
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"teks wyświetlany za nickiem w prefiksie wiadomości, przykład: przykład: \">\""
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
"używaj znacznika (linii albo znaku) do zaznaczania pierwszej nieprzeczytanej "

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-21 08:41+0100\n"
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3456,6 +3456,19 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "cadeia de caracteres mostrada após prefixo"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr ""
"texto a ser exibido antes do apelido no prefixo da mensagem, exemplo: \"<\""
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"texto a ser exibido depois do apelido no prefixo da mensage, examplo: \">\""
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
"use uma marcação (linha ou caractere) em buffers para mostrar a primeira "

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-21 08:41+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2900,6 +2900,17 @@ msgstr ""
msgid "string displayed after prefix"
msgstr "строка, вставляемая после автодополнения ника"
#, fuzzy
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr "текст, который отображать до ника в окне чата"
#, fuzzy
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "текст, который отображать после ника в окне чата"
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
#, fuzzy
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr "использовать маркер непрочитанных сообщений в окнах серверов и каналов"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2015-03-10 21:33+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2605,6 +2605,15 @@ msgstr ""
msgid "string displayed after prefix"
msgstr ""
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr ""
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-04-19 09:05+0200\n"
"POT-Creation-Date: 2015-04-19 11:28+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2602,6 +2602,15 @@ msgstr ""
msgid "string displayed after prefix"
msgstr ""
msgid "text to display before nick when quoting a message (see /help cursor)"
msgstr ""
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
msgid "time format when quoting a message (see /help cursor)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""

View File

@ -161,6 +161,9 @@ struct t_config_option *config_look_prefix_buffer_align_more;
struct t_config_option *config_look_prefix_buffer_align_more_after;
struct t_config_option *config_look_prefix_same_nick;
struct t_config_option *config_look_prefix_suffix;
struct t_config_option *config_look_quote_nick_prefix;
struct t_config_option *config_look_quote_nick_suffix;
struct t_config_option *config_look_quote_time_format;
struct t_config_option *config_look_read_marker;
struct t_config_option *config_look_read_marker_always_show;
struct t_config_option *config_look_read_marker_string;
@ -2767,6 +2770,23 @@ config_weechat_init_options ()
"prefix_suffix", "string",
N_("string displayed after prefix"),
NULL, 0, 0, "|", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
config_look_quote_nick_prefix = config_file_new_option (
weechat_config_file, ptr_section,
"quote_nick_prefix", "string",
N_("text to display before nick when quoting a message (see /help "
"cursor)"),
NULL, 0, 0, "<", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_quote_nick_suffix = config_file_new_option (
weechat_config_file, ptr_section,
"quote_nick_suffix", "string",
N_("text to display after nick when quoting a message (see /help "
"cursor)"),
NULL, 0, 0, ">", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_quote_time_format = config_file_new_option (
weechat_config_file, ptr_section,
"quote_time_format", "string",
N_("time format when quoting a message (see /help cursor)"),
NULL, 0, 0, "%H:%M:%S", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_read_marker = config_file_new_option (
weechat_config_file, ptr_section,
"read_marker", "integer",

View File

@ -207,6 +207,9 @@ extern struct t_config_option *config_look_prefix_buffer_align_more;
extern struct t_config_option *config_look_prefix_buffer_align_more_after;
extern struct t_config_option *config_look_prefix_same_nick;
extern struct t_config_option *config_look_prefix_suffix;
extern struct t_config_option *config_look_quote_nick_prefix;
extern struct t_config_option *config_look_quote_nick_suffix;
extern struct t_config_option *config_look_quote_time_format;
extern struct t_config_option *config_look_read_marker;
extern struct t_config_option *config_look_read_marker_always_show;
extern struct t_config_option *config_look_read_marker_string;

View File

@ -978,9 +978,15 @@ int
gui_chat_hsignal_quote_line_cb (void *data, const char *signal,
struct t_hashtable *hashtable)
{
const char *time, *prefix, *message;
int length_time, length_prefix, length_message, length;
char *str;
const char *date, *line, *prefix, *ptr_prefix, *message;
long unsigned int value;
long number;
struct tm *local_time;
struct t_gui_line *ptr_line;
int is_nick, length_time, length_nick_prefix, length_prefix;
int length_nick_suffix, length_message, length, rc;
time_t line_date;
char str_time[128], *str, *error;
/* make C compiler happy */
(void) data;
@ -988,33 +994,75 @@ gui_chat_hsignal_quote_line_cb (void *data, const char *signal,
if (!gui_current_window->buffer->input)
return WEECHAT_RC_OK;
time = (strstr (signal, "time")) ?
hashtable_get (hashtable, "_chat_line_time") : NULL;
/* get time */
str_time[0] = '\0';
date = (strstr (signal, "time")) ?
hashtable_get (hashtable, "_chat_line_date") : NULL;
if (date)
{
number = strtol (date, &error, 10);
if (error && !error[0])
{
line_date = (time_t)number;
local_time = localtime (&line_date);
if (local_time)
{
strftime (str_time, sizeof (str_time),
CONFIG_STRING(config_look_quote_time_format),
local_time);
}
}
}
/* check if the prefix is a nick */
is_nick = 0;
line = hashtable_get (hashtable, "_chat_line");
if (line && line[0])
{
rc = sscanf (line, "%lx", &value);
if ((rc != EOF) && (rc != 0))
{
ptr_line = (struct t_gui_line *)value;
if (gui_line_search_tag_starting_with (ptr_line, "prefix_nick"))
is_nick = 1;
}
}
/* get prefix + message */
prefix = (strstr (signal, "prefix")) ?
hashtable_get (hashtable, "_chat_line_prefix") : NULL;
ptr_prefix = prefix;
if (ptr_prefix)
{
while (ptr_prefix[0] == ' ')
{
ptr_prefix++;
}
}
message = hashtable_get (hashtable, "_chat_line_message");
if (!message)
return WEECHAT_RC_OK;
length_time = (time) ? strlen (time) : 0;
length_prefix = (prefix) ? strlen (prefix) : 0;
length_time = strlen (str_time);
length_nick_prefix = strlen (CONFIG_STRING(config_look_quote_nick_prefix));
length_prefix = (ptr_prefix) ? strlen (ptr_prefix) : 0;
length_nick_suffix = strlen (CONFIG_STRING(config_look_quote_nick_suffix));
length_message = strlen (message);
length = length_time + 1 + length_prefix + 1 +
strlen (CONFIG_STRING(config_look_prefix_suffix)) + 1 +
length = length_time + 1 +
length_nick_prefix + length_prefix + length_nick_suffix + 1 +
length_message + 1 + 1;
str = malloc (length);
if (str)
{
snprintf (str, length, "%s%s%s%s%s%s%s ",
(time) ? time : "",
(time) ? " " : "",
(prefix) ? prefix : "",
(prefix) ? " " : "",
(time || prefix) ? CONFIG_STRING(config_look_prefix_suffix) : "",
((time || prefix) && CONFIG_STRING(config_look_prefix_suffix)
&& CONFIG_STRING(config_look_prefix_suffix)[0]) ? " " : "",
str_time,
(str_time[0]) ? " " : "",
(ptr_prefix && ptr_prefix[0] && is_nick) ? CONFIG_STRING(config_look_quote_nick_prefix) : "",
(ptr_prefix) ? ptr_prefix : "",
(ptr_prefix && ptr_prefix[0] && is_nick) ? CONFIG_STRING(config_look_quote_nick_suffix) : "",
(ptr_prefix && ptr_prefix[0]) ? " " : "",
message);
gui_input_insert_string (gui_current_window->buffer, str, -1);
gui_input_text_changed_modifier_and_signal (gui_current_window->buffer,