irc: add option irc.look.notice_welcome_redirect to automatically redirect channel welcome notices to the channel buffer

v2.8-utf8proc
Sebastien Helleu 2013-08-28 21:39:21 +02:00
parent fb51fb6052
commit 75cc0b0a77
21 changed files with 190 additions and 17 deletions

View File

@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.4.2-dev, 2013-08-26
v0.4.2-dev, 2013-08-28
This document lists all changes for each version.
@ -87,6 +87,8 @@ Version 0.4.2 (under dev!)
* aspell: rename option aspell.look.color to aspell.color.misspelled, add option
aspell.color.suggestions
* aspell: add support of enchant library (patch #6858)
* irc: add option irc.look.notice_welcome_redirect to automatically redirect
channel welcome notices to the channel buffer
* irc: replace default prefix modes "qaohvu" by the standard ones "ov" when
PREFIX is not sent by server (bug #39802)
* irc: use 6697 as default port for SSL servers created with URL "ircs://"

View File

@ -253,6 +253,11 @@
** Typ: integer
** Werte: auto, never, always (Standardwert: `auto`)
* [[option_irc.look.notice_welcome_redirect]] *irc.look.notice_welcome_redirect*
** Beschreibung: `automatically redirect channel welcome notices to the channel buffer; such notices have the nick as target but a channel name in beginning of notice message, for example notices sent by freenode server which look like: "[#channel] Welcome to this channel..."`
** Typ: boolesch
** Werte: on, off (Standardwert: `on`)
* [[option_irc.look.notify_tags_ison]] *irc.look.notify_tags_ison*
** Beschreibung: `durch Kommata getrennte Liste von Schlagwörtern die in notify-Nachrichten genutzt werden sollen, falls ein Nick einen Server betritt oder verlässt (Rückgabe durch Befehl ison), zum Beispiel: "notify_message", "notify_private" oder "notify_highlight"`
** Typ: Zeichenkette

View File

@ -253,6 +253,11 @@
** type: integer
** values: auto, never, always (default value: `auto`)
* [[option_irc.look.notice_welcome_redirect]] *irc.look.notice_welcome_redirect*
** description: `automatically redirect channel welcome notices to the channel buffer; such notices have the nick as target but a channel name in beginning of notice message, for example notices sent by freenode server which look like: "[#channel] Welcome to this channel..."`
** type: boolean
** values: on, off (default value: `on`)
* [[option_irc.look.notify_tags_ison]] *irc.look.notify_tags_ison*
** description: `comma separated list of tags used in messages displayed by notify when a nick joins or quits server (result of command ison), for example: "notify_message", "notify_private" or "notify_highlight"`
** type: string

View File

@ -253,6 +253,11 @@
** type: entier
** valeurs: auto, never, always (valeur par défaut: `auto`)
* [[option_irc.look.notice_welcome_redirect]] *irc.look.notice_welcome_redirect*
** description: `rediriger automatiquement les notices de bienvenue sur le canal vers le tampon du canal; de telles notices ont le pseudo comme cible mais le nom du canal au début du message de notice, par exemple les notices envoyées par le serveur freenode qui ressemblent à: "[#canal] Bienvenue sur ce canal..."`
** type: booléen
** valeurs: on, off (valeur par défaut: `on`)
* [[option_irc.look.notify_tags_ison]] *irc.look.notify_tags_ison*
** description: `liste des tags (séparés par des virgules) utilisés dans les messages affichés par notify lorsqu'un pseudo a rejoint ou quitté le serveur (résultat de la commande ison), par exemple: "notify_message", "notify_private" ou "notify_highlight"`
** type: chaîne

View File

@ -253,6 +253,11 @@
** tipo: intero
** valori: auto, never, always (valore predefinito: `auto`)
* [[option_irc.look.notice_welcome_redirect]] *irc.look.notice_welcome_redirect*
** descrizione: `automatically redirect channel welcome notices to the channel buffer; such notices have the nick as target but a channel name in beginning of notice message, for example notices sent by freenode server which look like: "[#channel] Welcome to this channel..."`
** tipo: bool
** valori: on, off (valore predefinito: `on`)
* [[option_irc.look.notify_tags_ison]] *irc.look.notify_tags_ison*
** descrizione: `comma separated list of tags used in messages displayed by notify when a nick joins or quits server (result of command ison), for example: "notify_message", "notify_private" or "notify_highlight"`
** tipo: stringa

View File

@ -253,6 +253,11 @@
** タイプ: 整数
** 値: auto, never, always (デフォルト値: `auto`)
* [[option_irc.look.notice_welcome_redirect]] *irc.look.notice_welcome_redirect*
** 説明: `automatically redirect channel welcome notices to the channel buffer; such notices have the nick as target but a channel name in beginning of notice message, for example notices sent by freenode server which look like: "[#channel] Welcome to this channel..."`
** タイプ: ブール
** 値: on, off (デフォルト値: `on`)
* [[option_irc.look.notify_tags_ison]] *irc.look.notify_tags_ison*
** 説明: `comma separated list of tags used in messages displayed by notify when a nick joins or quits server (result of command ison), for example: "notify_message", "notify_private" or "notify_highlight"`
** タイプ: 文字列

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -6374,6 +6374,13 @@ msgstr ""
"zobrazovat upozornění jako soukromé zprávy (pokud je automaticky, použije se "
"soukromý buffer, kdy existuje)"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
#, fuzzy
msgid ""
"comma separated list of tags used in messages displayed by notify when a "

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-18 19:01+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@ -7136,6 +7136,13 @@ msgstr ""
"zeigt Notizen als private Nachricht an (wird die \"auto\" Option verwendet "
"dann wird ein privater Buffer genutzt, falls vorhanden)"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
msgid ""
"comma separated list of tags used in messages displayed by notify when a "
"nick joins or quits server (result of command ison), for example: "

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -6630,6 +6630,13 @@ msgstr ""
"mostrar avisos como mensajes privados (si es auto, usa un buffer privado si "
"lo encuentra)"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
#, fuzzy
msgid ""
"comma separated list of tags used in messages displayed by notify when a "

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"PO-Revision-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-28 21:25+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -6948,6 +6948,17 @@ msgstr ""
"afficher les notices comme des messages privés (si auto, utilise le tampon "
"privé s'il est trouvé)"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
"rediriger automatiquement les notices de bienvenue sur le canal vers le "
"tampon du canal; de telles notices ont le pseudo comme cible mais le nom du "
"canal au début du message de notice, par exemple les notices envoyées par le "
"serveur freenode qui ressemblent à: \"[#canal] Bienvenue sur ce canal...\""
msgid ""
"comma separated list of tags used in messages displayed by notify when a "
"nick joins or quits server (result of command ison), for example: "

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -5893,6 +5893,13 @@ msgid ""
"display notices as private messages (if auto, use private buffer if found)"
msgstr "figyelmeztetések privát üzenetként való mutatása"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
msgid ""
"comma separated list of tags used in messages displayed by notify when a "
"nick joins or quits server (result of command ison), for example: "

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -6702,6 +6702,13 @@ msgstr ""
"visualizza notifiche come messaggi privati (se automatico, usa il buffer "
"privato se viene trovato)"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
#, fuzzy
msgid ""
"comma separated list of tags used in messages displayed by notify when a "

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@ -6605,6 +6605,13 @@ msgstr ""
"notice をプライベートメッセージとして表示 (auto の場合、プライベートバッファ"
"が見つかればそれを使用する)"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
#, fuzzy
msgid ""
"comma separated list of tags used in messages displayed by notify when a "

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -6731,6 +6731,13 @@ msgstr ""
"wyświetlaj powiadomienia jako prywatne wiadomości (jeśli auto, używa "
"prywatnego bufora jeśli taki istnieje)"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
#, fuzzy
msgid ""
"comma separated list of tags used in messages displayed by notify when a "

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -6113,6 +6113,13 @@ msgid ""
"display notices as private messages (if auto, use private buffer if found)"
msgstr ""
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
msgid ""
"comma separated list of tags used in messages displayed by notify when a "
"nick joins or quits server (result of command ison), for example: "

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -5916,6 +5916,13 @@ msgid ""
"display notices as private messages (if auto, use private buffer if found)"
msgstr "отображать notice'ы в виде личных сообщений"
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
msgid ""
"comma separated list of tags used in messages displayed by notify when a "
"nick joins or quits server (result of command ison), for example: "

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\n"
"PO-Revision-Date: 2013-08-17 10:37+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -5208,6 +5208,13 @@ msgid ""
"display notices as private messages (if auto, use private buffer if found)"
msgstr ""
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
msgid ""
"comma separated list of tags used in messages displayed by notify when a "
"nick joins or quits server (result of command ison), for example: "

View File

@ -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: 2013-08-26 18:19+0200\n"
"POT-Creation-Date: 2013-08-28 21:24+0200\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"
@ -5167,6 +5167,13 @@ msgid ""
"display notices as private messages (if auto, use private buffer if found)"
msgstr ""
msgid ""
"automatically redirect channel welcome notices to the channel buffer; such "
"notices have the nick as target but a channel name in beginning of notice "
"message, for example notices sent by freenode server which look like: "
"\"[#channel] Welcome to this channel...\""
msgstr ""
msgid ""
"comma separated list of tags used in messages displayed by notify when a "
"nick joins or quits server (result of command ison), for example: "

View File

@ -86,6 +86,7 @@ struct t_config_option *irc_config_look_nick_completion_smart;
struct t_config_option *irc_config_look_nick_mode;
struct t_config_option *irc_config_look_nick_mode_empty;
struct t_config_option *irc_config_look_notice_as_pv;
struct t_config_option *irc_config_look_notice_welcome_redirect;
struct t_config_option *irc_config_look_notify_tags_ison;
struct t_config_option *irc_config_look_notify_tags_whois;
struct t_config_option *irc_config_look_part_closes_buffer;
@ -2444,6 +2445,14 @@ irc_config_init ()
N_("display notices as private messages (if auto, use private buffer "
"if found)"),
"auto|never|always", 0, 0, "auto", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_notice_welcome_redirect = weechat_config_new_option (
irc_config_file, ptr_section,
"notice_welcome_redirect", "boolean",
N_("automatically redirect channel welcome notices to the channel "
"buffer; such notices have the nick as target but a channel name in "
"beginning of notice message, for example notices sent by freenode "
"server which look like: \"[#channel] Welcome to this channel...\""),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_notify_tags_ison = weechat_config_new_option (
irc_config_file, ptr_section,
"notify_tags_ison", "string",

View File

@ -134,6 +134,7 @@ extern struct t_config_option *irc_config_look_nick_completion_smart;
extern struct t_config_option *irc_config_look_nick_mode;
extern struct t_config_option *irc_config_look_nick_mode_empty;
extern struct t_config_option *irc_config_look_notice_as_pv;
extern struct t_config_option *irc_config_look_notice_welcome_redirect;
extern struct t_config_option *irc_config_look_notify_tags_ison;
extern struct t_config_option *irc_config_look_notify_tags_whois;
extern struct t_config_option *irc_config_look_part_closes_buffer;

View File

@ -1057,7 +1057,7 @@ IRC_PROTOCOL_CALLBACK(nick)
IRC_PROTOCOL_CALLBACK(notice)
{
char *pos_target, *pos_args;
char *pos_target, *pos_args, *pos, end_char, *channel;
struct t_irc_channel *ptr_channel;
struct t_irc_nick *ptr_nick;
int notify_private, is_channel, notice_op, notice_voice;
@ -1105,10 +1105,56 @@ IRC_PROTOCOL_CALLBACK(notice)
}
else
{
if (pos_target && irc_channel_is_channel (server, pos_target))
is_channel = 0;
channel = NULL;
if (pos_target)
{
is_channel = irc_channel_is_channel (server, pos_target);
if (is_channel)
{
channel = strdup (pos_target);
}
else if (weechat_config_boolean (irc_config_look_notice_welcome_redirect))
{
end_char = ' ';
switch (pos_args[0])
{
case '[':
end_char = ']';
break;
case '(':
end_char = ')';
break;
case '{':
end_char = '}';
break;
case '<':
end_char = '>';
break;
}
if (end_char != ' ')
{
pos = strchr (pos_args, end_char);
if (pos)
{
channel = weechat_strndup (pos_args + 1, pos - pos_args - 1);
if (channel && irc_channel_search (server, channel))
{
is_channel = 1;
pos_args = pos + 1;
while (pos_args[0] == ' ')
{
pos_args++;
}
}
}
}
}
}
if (is_channel)
{
/* notice for channel */
ptr_channel = irc_channel_search (server, pos_target);
ptr_channel = irc_channel_search (server, channel);
/*
* unmask a smart filtered join if it is in hashtable
@ -1284,6 +1330,8 @@ IRC_PROTOCOL_CALLBACK(notice)
}
}
}
if (channel)
free (channel);
}
return WEECHAT_RC_OK;