diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-02 11:35:43 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-02 11:35:43 +0200 |
commit | 35574d63ab25d6c65c408d7ca3fdada1b44e8a4a (patch) | |
tree | 14b3b92c81702fcd2d7c62483a27e3a0a0cfbb63 | |
parent | 2987f9208ea6fdec198cc9789f8020199d22a604 (diff) | |
download | weechat-35574d63ab25d6c65c408d7ca3fdada1b44e8a4a.zip |
irc: fix duplicate sender name in display of wallops (closes #142, closes #145)
-rw-r--r-- | AUTHORS.asciidoc | 1 | ||||
-rw-r--r-- | ChangeLog.asciidoc | 2 | ||||
-rw-r--r-- | po/cs.po | 4 | ||||
-rw-r--r-- | po/de.po | 4 | ||||
-rw-r--r-- | po/es.po | 4 | ||||
-rw-r--r-- | po/fr.po | 4 | ||||
-rw-r--r-- | po/hu.po | 4 | ||||
-rw-r--r-- | po/it.po | 4 | ||||
-rw-r--r-- | po/ja.po | 28 | ||||
-rw-r--r-- | po/pl.po | 4 | ||||
-rw-r--r-- | po/pt_BR.po | 4 | ||||
-rw-r--r-- | po/ru.po | 4 | ||||
-rw-r--r-- | po/tr.po | 4 | ||||
-rw-r--r-- | po/weechat.pot | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 128 |
15 files changed, 106 insertions, 97 deletions
diff --git a/AUTHORS.asciidoc b/AUTHORS.asciidoc index 08582e90e..a8c779664 100644 --- a/AUTHORS.asciidoc +++ b/AUTHORS.asciidoc @@ -55,6 +55,7 @@ Alphabetically: * Matt Robinson * Mantas Mikulėnas (grawity) * Mateusz Poszwa +* Max Anton Teufel * Murilo Opsfelder Araujo * Nicolas Cavigneaux * Nils Görs (nils_2) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index b3d0d715a..e2731059d 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -124,6 +124,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * alias: change default command for alias /beep to "/print -beep" * exec: add exec plugin: new command /exec and file exec.conf * guile: fix module used after unload of a script +* irc: fix duplicate sender name in display of wallops (closes #142, + closes #145) * irc: display locally away status changes in private buffers (in addition to channels) (closes #117) * irc: add value "+" for option irc.look.smart_filter_mode to use modes from @@ -7604,8 +7604,8 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s zrušil téma pro %s%s%s" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" -msgstr "%sWallops od %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" +msgstr "%sWallops od %s: %s" #, c-format msgid "%sUser mode for %s%s%s is %s[%s%s%s]" @@ -8691,8 +8691,8 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s hat das Thema von %s%s%s entfernt" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" -msgstr "%sWallops von %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" +msgstr "%sWallops von %s: %s" #, c-format msgid "%sUser mode for %s%s%s is %s[%s%s%s]" @@ -7893,8 +7893,8 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s ha borrado el tema para %s%s%s" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" -msgstr "%sWallops de %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" +msgstr "%sWallops de %s: %s" #, c-format msgid "%sUser mode for %s%s%s is %s[%s%s%s]" @@ -8477,8 +8477,8 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s a retiré le titre pour %s%s%s" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" -msgstr "%sWallops de %s%s %s(%s%s%s)%s : %s" +msgid "%sWallops from %s: %s" +msgstr "%sWallops de %s : %s" #, c-format msgid "%sUser mode for %s%s%s is %s[%s%s%s]" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-07-25 20:37+0200\n" +"POT-Creation-Date: 2014-08-02 11:25+0200\n" "PO-Revision-Date: 2014-07-25 07:49+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7063,7 +7063,7 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s törölte a %s%s szoba témáját\n" #, fuzzy, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" msgstr "%s%s %s(%s%s@%s%s)%s neve %s volt\n" #, fuzzy, c-format @@ -8051,8 +8051,8 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s ha rimosso l'argomento per %s%s%s" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" -msgstr "%sWallop da %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" +msgstr "%sWallop da %s: %s" #, c-format msgid "%sUser mode for %s%s%s is %s[%s%s%s]" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-07-25 20:37+0200\n" +"POT-Creation-Date: 2014-08-02 11:25+0200\n" "PO-Revision-Date: 2014-07-25 07:50+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n" @@ -40,11 +40,11 @@ msgid "max chars" msgstr "最大文字数" msgid "" -"a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)" -"green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal " -"color number or an alias; attributes are allowed before color (for text " -"color only, not background): \"*\" for bold, \"!\" for reverse, \"/\" for " -"italic, \"_\" for underline" +"a WeeChat color name (default, black, (dark)gray, white, (light)red, " +"(light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a " +"terminal color number or an alias; attributes are allowed before color (for " +"text color only, not background): \"*\" for bold, \"!\" for reverse, \"/\" " +"for italic, \"_\" for underline" msgstr "" "WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、" "brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号ま" @@ -5882,8 +5882,8 @@ msgstr "" " - 内部サーバ名 (/server add で作成されたもの、利用推奨)\n" " - ホスト名/ポート番号、又は IP アドレス/ポート番号 (これは一時的" "サーバを作る)、デフォルトのポート番号は 6667\n" -" - 次のフォーマットに従う URL: irc[6][s]://[nickname[:password]@]" -"irc.example.org[:port][/#channel1][,#channel2[...]]\n" +" - 次のフォーマットに従う URL: irc[6][s]://[nickname[:" +"password]@]irc.example.org[:port][/#channel1][,#channel2[...]]\n" " option: サーバに関するオプション (ブール型オプションでは、value は無視さ" "れる)\n" " nooption: ブール型オプションを 'off' にする (例: -nossl)\n" @@ -8142,8 +8142,8 @@ msgstr "%s%s%s%s が %s%s%s のトピックを削除 (古いトピック: \"%s%s msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s が %s%s%s のトピックを削除" -#, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" +#, fuzzy, c-format +msgid "%sWallops from %s: %s" msgstr "%sから %s%s Wallops 権を取得 %s(%s%s%s)%s: %s" #, c-format @@ -10768,8 +10768,8 @@ msgid "" "Examples (you can also look at default triggers with /trigger listdefault):\n" " add text attributes *bold*, _underline_ and /italic/ (only in user " "messages):\n" -" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==\\*" -"(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:" +" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==" +"\\*(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:" "underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" "italic}/\"\n" " hide nicklist bar on small terminals:\n" @@ -10843,8 +10843,8 @@ msgstr "" "\n" "例 (/trigger listdefault でデフォルトトリガを見ることができます):\n" " テキスト属性 *太字*、_下線_、/イタリック/ を追加 (ユーザメッセージのみ):\n" -" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==\\*" -"(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:" +" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==" +"\\*(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:" "underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" "italic}/\"\n" " 狭い端末ではニックネームリストバーを隠す:\n" @@ -8239,8 +8239,8 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s usunął temat %s%s%s" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" -msgstr "%sWallopy od %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" +msgstr "%sWallopy od %s: %s" #, c-format msgid "%sUser mode for %s%s%s is %s[%s%s%s]" diff --git a/po/pt_BR.po b/po/pt_BR.po index 3149792ef..feacb5cf9 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-07-25 20:37+0200\n" +"POT-Creation-Date: 2014-08-02 11:25+0200\n" "PO-Revision-Date: 2014-07-14 18:44+0200\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7312,7 +7312,7 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s%s limpou o tópico do canal %s%s%s" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" msgstr "" #, 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-07-25 20:37+0200\n" +"POT-Creation-Date: 2014-08-02 11:25+0200\n" "PO-Revision-Date: 2014-07-25 07:50+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7091,7 +7091,7 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "%s%s%s удалил тему канала для %s%s\n" #, fuzzy, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" msgstr "%s%s %s(%s%s@%s%s)%s был %s\n" #, fuzzy, c-format @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-07-25 20:37+0200\n" +"POT-Creation-Date: 2014-08-02 11:25+0200\n" "PO-Revision-Date: 2014-07-25 07:50+0200\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6326,7 +6326,7 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" msgstr "" #, c-format diff --git a/po/weechat.pot b/po/weechat.pot index b36624e06..6a0ecb4c2 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-07-25 20:37+0200\n" +"POT-Creation-Date: 2014-08-02 11:25+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" @@ -6265,7 +6265,7 @@ msgid "%s%s%s%s has unset topic for %s%s%s" msgstr "" #, c-format -msgid "%sWallops from %s%s %s(%s%s%s)%s: %s" +msgid "%sWallops from %s: %s" msgstr "" #, c-format diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 8b4e64dcd..fcf25d05b 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -145,6 +145,53 @@ irc_protocol_tags (const char *command, const char *tags, const char *nick, } /* + * Builds a string with nick and optional address. + * + * Argument nickname is mandatory, address can be NULL. + * If nickname and address are NULL, an empty string is returned. + */ + +const char * +irc_protocol_nick_address (struct t_irc_server *server, + struct t_irc_nick *nick, + const char *nickname, + const char *address) +{ + static char string[1024]; + + string[0] = '\0'; + + if (nickname && address && (strcmp (nickname, address) != 0)) + { + /* display nick and address if they are different */ + snprintf (string, sizeof (string), + "%s%s %s(%s%s%s)%s", + irc_nick_color_for_message (server, + nick, + nickname), + nickname, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + address, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET); + } + else if (nickname) + { + /* display only nick if no address or if nick == address */ + snprintf (string, sizeof (string), + "%s%s%s", + irc_nick_color_for_message (server, + nick, + nickname), + nickname, + IRC_COLOR_RESET); + } + + return string; +} + +/* * Callback for the IRC message "AUTHENTICATE". * * Message looks like: @@ -1138,6 +1185,7 @@ IRC_PROTOCOL_CALLBACK(nick) IRC_PROTOCOL_CALLBACK(notice) { char *pos_target, *pos_args, *pos, end_char, *channel, status_notice[2]; + const char *nick_address; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; int notify_private, is_channel, is_channel_orig; @@ -1362,59 +1410,20 @@ IRC_PROTOCOL_CALLBACK(notice) } else { - if (address && address[0] && (strcmp (nick, address) != 0)) - { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, - (notify_private) ? "notify_private" : NULL, - nick, - address), - "%s%s%s %s(%s%s%s)%s: %s", - weechat_prefix ("network"), - irc_nick_color_for_message (server, - NULL, - nick), - nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - address, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_args); - } - else - { - if (nick && nick[0]) - { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, - (notify_private) ? "notify_private" : NULL, - nick, - address), - "%s%s%s%s: %s", - weechat_prefix ("network"), - irc_nick_color_for_message (server, - NULL, - nick), - nick, - IRC_COLOR_RESET, - pos_args); - } - else - { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, - (notify_private) ? "notify_private" : NULL, - NULL, - address), - "%s%s", - weechat_prefix ("network"), - pos_args); - } - } + nick_address = irc_protocol_nick_address (server, NULL, + nick, address); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, + (notify_private) ? "notify_private" : NULL, + nick, + address), + "%s%s%s%s", + weechat_prefix ("network"), + nick_address, + (nick_address[0]) ? ": " : "", + pos_args); } } } @@ -2199,25 +2208,22 @@ IRC_PROTOCOL_CALLBACK(topic) IRC_PROTOCOL_CALLBACK(wallops) { + const char *nick_address; + IRC_PROTOCOL_MIN_ARGS(3); if (ignored) return WEECHAT_RC_OK; + nick_address = irc_protocol_nick_address (server, NULL, nick, address); weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL), date, irc_protocol_tags (command, NULL, nick, address), - _("%sWallops from %s%s %s(%s%s%s)%s: %s"), + _("%sWallops from %s: %s"), weechat_prefix ("network"), - irc_nick_color_for_message (server, NULL, nick), - nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - address, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", (argv_eol[2][0] == ':') ? argv_eol[2] + 1 : argv_eol[2]); return WEECHAT_RC_OK; |