diff options
214 files changed, 12487 insertions, 6836 deletions
diff --git a/.gitattributes b/.gitattributes index cc18559eb..1f3f31cca 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,4 @@ .git* export-ignore debian export-ignore weechat.spec export-ignore +.mailmap export-ignore diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..1fee3c648 --- /dev/null +++ b/.mailmap @@ -0,0 +1,19 @@ +# Map author and committer names and email addresses to canonical real names +# and email addresses. +# +# For example with these commands: +# git shortlog -nse +# git shortlog -se | cut -f2 | sort + +Sébastien Helleu <flashcode@flashtux.org> +Sébastien Helleu <flashcode@flashtux.org> <flashcode@krypton> +Sébastien Helleu <flashcode@flashtux.org> <flashcode> +Sébastien Helleu <flashcode@flashtux.org> <uid67137> +Nils Görs <weechatter@arcor.de> +Ryuunosuke Ayanokouzi <i38w7i3@yahoo.co.jp> +Krzysztof Korościk <soltys@szluug.org> +Marco Paolone <marcopaolone@gmail.com> +<marcopaolone@gmail.com> <marco@DrB4tch.sitecomwl601> +<mikaela.suomalainen@outlook.com> <mkaysi@outlook.com> +<simon@arlott.org> <sa.me.uk> +<Simon.Kuhnle@cs.fau.de> <simon@blarzwurst.de> diff --git a/.travis.yml b/.travis.yml index e66360b7a..9f85b31e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,19 @@ compiler: - clang env: - - BUILDTOOL=cmake - - BUILDTOOL=autotools + - BUILDTOOL="cmake" BUILDARGS="" + - BUILDTOOL="cmake" BUILDARGS="-DENABLE_PYTHON3=ON" + - BUILDTOOL="cmake" BUILDARGS="-DENABLE_GNUTLS=OFF" + - BUILDTOOL="autotools" BUILDARGS="" + - BUILDTOOL="autotools" BUILDARGS="--enable-python3" + - BUILDTOOL="autotools" BUILDARGS="--disable-gnutls" before_script: - echo 'APT::Install-Recommends "false";' | sudo tee -a /etc/apt/apt.conf - sudo apt-get update -qq + - sudo apt-get -y install devscripts equivs python-pip libenchant-dev autopoint asciidoc source-highlight xsltproc docbook-xsl docbook-xml cmake pkg-config libncursesw5-dev gem2deb libperl-dev python-dev python3-dev libaspell-dev liblua5.1-0-dev tcl8.5-dev guile-2.0-dev libcurl4-gnutls-dev libgcrypt11-dev libgnutls-dev zlib1g-dev - wget http://weechat.org/files/tests/ubuntu/precise/amd64/libcpputest-dev_3.4-3_amd64.deb - sudo dpkg -i libcpputest-dev_3.4-3_amd64.deb - - sudo apt-get -y install devscripts equivs python-pip libenchant-dev autopoint - - sudo mk-build-deps -i debian/control - sudo pip install msgcheck pylint script: @@ -24,7 +27,7 @@ script: after_success: - weechat --help - - weechat -r /quit + - weechat -r "/debug libs;/quit" matrix: fast_finish: true diff --git a/AUTHORS.asciidoc b/AUTHORS.asciidoc index 3157835ba..c4c91222d 100644 --- a/AUTHORS.asciidoc +++ b/AUTHORS.asciidoc @@ -59,11 +59,13 @@ Alphabetically: * Murilo Opsfelder Araujo * Nicolas Cavigneaux * Nils Görs (nils_2) +* nyuszika7h * Odin * Patrick Steinhardt * Paul Komkoff * Pavel Shevchuk (Stalwart) * Peter Boström (pbos) +* Phillip Sz * Pierre Carru * Piotr Szymaniak * Pistos @@ -79,6 +81,7 @@ Alphabetically: * Simon Kuhnle * Stefano Pigozzi * Stfn +* Tim D. Smith * Tom Alsberg * Tor Hveem (xt) * Valentin Lorentz (progval) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 1d99f7395..520ee504d 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -15,13 +15,94 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] == Version 1.1 (under dev) +=== New features + +* core: add option weechat.completion.command_inline (task #12491) +* core: add bar item "mouse_status", new options weechat.look.item_mouse_status + and weechat.color.status_mouse (closes #247) +* core: add signals "mouse_enabled" and "mouse_disabled" (closes #244) +* core: add hide of chars in string in evaluation of expressions +* core: add arraylists, improve speed of completions (about 50x faster) +* core: move bar item "scroll" between buffer name and lag in default bar items + of status bar +* core: allow incomplete commands if unambiguous, new option + weechat.look.command_incomplete (task #5419) +* api: add regex replace feature in function string_eval_expression +* api: use microseconds instead of milliseconds in functions util_timeval_diff + and util_timeval_add +* irc: disable SSLv3 by default in server option "ssl_priorities" (closes #248) +* irc: add support of "extended-join" capability (closes #143, closes #212) +* irc: automatically add current channel in command /samode (closes #241) +* irc: display own nick changes in server buffer (closes #188) +* irc: disable creation of temporary servers by default with command /connect, + new option irc.look.temporary_servers +* relay: add options "stop" and "restart" in command /relay +* relay: add option relay.network.ssl_priorities (closes #234) +* relay: add host in sender for IRC backlog PRIVMSG messages sent to clients +* trigger: evaluate and replace regex groups at same time, new format for regex + option in triggers (incompatible with version 1.0) (closes #224) +* trigger: add `${tg_displayed}` in conditions of default trigger "beep" +* trigger: add option "restore" in command /trigger + === Bugs fixed +* core: send mouse code only one time to terminal with command + /mouse enable|disable|toggle +* core: fix buffer property "lines_hidden" when merging buffers or when a line + is removed from a buffer (closes #226) +* core: display time in bare display only if option + weechat.look.buffer_time_format is not an empty string * core: fix translation of message displayed after /upgrade +* api: fix crash when reading config options with NULL value (closes #238) +* irc: use option irc.look.nick_mode_empty to display nick prefix in bar item + "input_prompt" +* irc: remove IRC color codes from buffer title in channels (closes #237) +* irc: add tag "nick_xxx" in invite messages +* irc: fix completion of commands /msg, /notice and /query +* irc: fix translation of CTCP PING reply (closes #137) +* lua: add detection of Lua 5.2 +* python: fix Python detection with Homebrew (closes #217) +* relay: don't remove relay from config when the binding fails (closes #225) +* relay: use comma separator in option relay.irc.backlog_tags, check the value + of option when it is changed with /set +* relay: remove "::ffff:" from IPv4-mapped IPv6 client address (closes #111) +* trigger: fix memory leak when allocating a new trigger with several regex +* xfer: bind to wildcard address when sending (closes #173) + +== Version 1.0.1 (2014-09-28) + +=== Bugs fixed + +* core: fix crash on buffer close when option weechat.look.hotlist_remove is + set to "merged" (closes #199) +* core: fix highlight of IRC action messages when option irc.look.nick_mode is + set to "action" or "both" (closes #206) +* core: fix compilation of plugin API functions (macros) when compiler + optimizations are enabled (closes #200) +* core: fix window/buffer pointers used in command /eval +* core: fix modifier "weechat_print": discard only one line when several lines + are displayed in same message (closes #171) +* api: fix bug in function hdata_move when absolute value of count is greater + than 1 +* tests: fix build of tests when the build directory is outside source tree + (closes #178) * tests: fix memory leak in tests launcher +* aspell: fix compilation with Enchant < 1.6.0 (closes #192) * aspell: fix crash with command "/aspell addword" if no word is given (closes #164, closes #165) -* irc: fix translation of CTCP PING reply (closes #137) +* irc: fix display of channel exception list (348) with 6 arguments (date + missing) +* irc: fix type of value stored in hashtable when joining a channel + (closes #211) +* guile: fix compilation with Guile < 2.0.4 (closes #198) +* perl: fix detection of Perl >= 5.20 with autotools +* relay: fix send of signals "relay_client_xxx" (closes #214) +* script: fix crash on "/script update" if a script detail is displayed in + buffer (closes #177) +* trigger: do not allow any changes on a trigger when it is currently running + (closes #189) +* trigger: fix regex used in default triggers to hide passwords ("\S" is not + supported on *BSD) (closes #172) == Version 1.0 (2014-08-15) diff --git a/Contributing.asciidoc b/Contributing.asciidoc index a77d9f896..e3e34b30b 100644 --- a/Contributing.asciidoc +++ b/Contributing.asciidoc @@ -1,10 +1,10 @@ -= Reporting WeeChat issues += Contributing to WeeChat :author: Sébastien Helleu :email: flashcode@flashtux.org :lang: en -== Report bugs +== Reporting bugs First, some basic things: @@ -13,55 +13,74 @@ First, some basic things: (if you are using a stable release or old version). * Report only one bug or feature request per issue. +=== Security reports + +Please *DO NOT* file a GitHub issue for security related problems, but send an +email to <security@weechat.org> instead. + === Required info -Please give some info: +When reporting https://github.com/weechat/weechat/issues[issues] on GitHub, +please include: -* The *version* of WeeChat: output of `/v` in WeeChat, for example: - `WeeChat 1.0-dev (git: v0.4.3-475-gb174b3c)`. + - If WeeChat does not start at all, give the version displayed by +* your *WeeChat version*: the output of `/v` in WeeChat, for example: + 'WeeChat 1.0-dev (git: v0.4.3-475-gb174b3c)'. + + If WeeChat does not start at all, please include the version displayed by `weechat --help` (or the version installed with your package manager). -* The operating system, including distribution name (for Linux) and its version - (examples: Linux Debian Wheezy, FreeBSD 10.0, Windows/Cygwin 64-bit, ...). -* If possible, please include a reproducible example: explain the steps which - led you to the problem. + +* your *operating system*: its name and version (examples: Linux Debian Wheezy, + FreeBSD 10.0, Windows/Cygwin 64-bit, ...). +* the *steps to reproduce*: if possible, please include a reproducible example: + explain the steps which led you to the problem. + It's even better if you can reproduce the problem with a new config (and no scripts loaded): try `weechat --dir /tmp/weechat` and check if you have the problem here. +* the *gdb's backtrace* (only for a crash): if you can reproduce the crash +(or if you have a core file), please include the backtrace from gdb (look at +http://weechat.org/files/doc/devel/weechat_user.en.html#report_crashes[User's guide] +for more info). -=== Use of scripts +[IMPORTANT] +Most of times, the WeeChat crash log file ('weechat_crash_YYYYMMDD_xxx.log') is +*NOT USEFUL* to fix the bug, so please report this file *ONLY* if a developer +asked you to send it (and be extremely careful, this file can contain personal +data like passwords and contents of your chats). + +=== Scripts related issues If you are using scripts, they can cause problems/crashes. To check if the problem is related to one script, try to unload them one by one (using command `/script unload <name>`). +Many issues reported are in fact related to bugs in scripts, so please first +check that before reporting any issue on WeeChat itself. + If you think the problem comes from a specific script, please report the issue -in the https://github.com/weechat/scripts[scripts git repository]. +in the https://github.com/weechat/scripts/issues[scripts git repository] +instead. -=== Report a crash +== Translations -If you are reporting a crash, please attach the backtrace from gdb (look at -http://weechat.org/files/doc/devel/weechat_user.en.html#report_crashes[user's guide] -for more info). +Pull requests on GitHub for fixes or new translations are welcome at any +time, for https://github.com/weechat/weechat[WeeChat] and +the web site https://github.com/weechat/weechat.org[weechat.org]. -Most of times, the WeeChat crash log file (`weechat_crash_YYYYMMDD_xxx.log`) is -*not useful* to fix the bug, so please report this file *ONLY* if a developer -asks you to send it (and be careful, this file can contain personal data like -passwords). +To start a translation in a new language (not yet supported), please look at +http://weechat.org/files/doc/devel/weechat_dev.en.html#translations[translations] +in Developer's guide. == Feature requests WeeChat is under active development, so your idea may already have been implemented, or scheduled for a future version (you can check in -http://weechat.org/dev/[roadmap]). - -Before submitting a feature request, it's better to discuss about it in IRC -(server: 'chat.freenode.net', channel '#weechat'). +http://weechat.org/dev/[roadmap] or +https://github.com/weechat/weechat/milestones[milestones] on GitHub. -== Contributing +Pull requests on GitHub are welcome for minor new features. -If you want to fix a bug or add a new feature, it's always a good idea to -discuss about it in IRC. +For major new features, it's better to discuss about it in IRC +(server: 'chat.freenode.net', channel '#weechat'). -And you can look at http://weechat.org/files/doc/devel/weechat_dev.en.html[developer's guide] for coding rules -(styles, naming convention, and other useful info). +Before submitting any pull request, be sure you have read the +http://weechat.org/files/doc/devel/weechat_dev.en.html#coding_rules[coding rules] +in Developer's guide, which contains info about styles used, naming convention +and other useful info. diff --git a/ReleaseNotes.asciidoc b/ReleaseNotes.asciidoc index 58ac4786d..67726aa45 100644 --- a/ReleaseNotes.asciidoc +++ b/ReleaseNotes.asciidoc @@ -15,6 +15,103 @@ http://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog] (file 'ChangeLog.asciidoc' in sources). +== Version 1.1 (under dev) + +=== New format for regex replacement in triggers + +A new format is used in regex replacement to use regex groups, this format +is incompatible with version 1.0. + +The existing triggers are *NOT automatically updated*. + +[width="60%",cols="2,2,3",options="header"] +|=== +| Old format | New format | Examples (new format) +| `$0` ... `$99` | `${re:0}` ... `${re:99}` | `${re:1}` +| `$+` | `${re:+}` | `${re:+}` +| `$.*N` | `${hide:*,${re:N}}` | `${hide:*,${re:2}}` + + `${hide:-,${re:+}}` +|=== + +Moreover, default triggers used to hide passwords have been fixed for *BSD +operating systems. + +You can restore them with the following command: + +---- +/trigger restore cmd_pass msg_auth server_pass +---- + +If you added triggers with the old regex replacement format, you must update +them manually. + +=== Default "beep" trigger + +The command of "beep" trigger is now executed only if the message is displayed +(not filtered with /filter). + +You can restore the default "beep" trigger with the following command: + +---- +/trigger restore beep +---- + +=== Completion of inline commands + +WeeChat now completes by default inline commands (not only at beginning of +line). + +When this feature is enabled, there is no more automatic completion of +absolute paths (except if you are completing a path inside a command argument, +like `/dcc send <nick> <path>`). + +To restore the old behavior (no completion of inline commands): + +---- +/set weechat.completion.command_inline off +---- + +=== Relay option relay.irc.backlog_tags + +The option 'relay.irc.backlog_tags' is now a list separated by commas +(it was separated by semicolons in older versions). + +If you are using a list of tags in this option, you must adjust the value +manually. + +=== IPv4-mapped IPv6 client address in relay + +The string "::ffff:" has been removed from IPv4-mapped IPv6 client address +in relay plugin. + +If you are using "::ffff:" in option 'relay.network.allowed_ips', you can +remove it. + +=== Temporary servers disabled by default with /connect + +Creating a temporary server with command `/connect <address>` or +`/connect irc://...` is now forbidden by default. + +A new option has been added to unlock the feature, you can do that for +the old behavior in command `/connect`: + +---- +/set irc.look.temporary_servers on +---- + +=== Microseconds in API timeval functions + +The API functions using timeval are now using or returning microseconds, +instead of milliseconds: + +* function 'util_timeval_diff': returns microseconds +* function 'util_timeval_add': the argument 'interval' is now expressed in + microseconds. + +== Version 1.0.1 (2014-09-28) + +Bug fix and maintenance release. + == Version 1.0 (2014-08-15) === Channel type not added by default on /join @@ -32,7 +129,7 @@ the new option: === Hide IRC channel modes arguments The option 'irc.look.item_channel_modes_hide_key' has been renamed to -'irc.look.item_channel_modes_hide_args' and it now a string. + +'irc.look.item_channel_modes_hide_args' and is now a string. + It can now hide arguments for multiple channel modes. By default, a channel key (mode "k") will hide channel arguments. For old @@ -726,7 +823,7 @@ IRC commands /ame and /amsg are now aliases, if you are upgrading from version == Version 0.3.0 (2009-09-06) This version brings *MAJOR* changes, especially for configuration files and -plugin API and it not compatible with previous versions. +plugin API and is not compatible with previous versions. Major differences: diff --git a/cmake/FindAspell.cmake b/cmake/FindAspell.cmake index b70d9816d..b2f54c14b 100644 --- a/cmake/FindAspell.cmake +++ b/cmake/FindAspell.cmake @@ -42,12 +42,14 @@ find_library(ASPELL_LIBRARY ) if(ASPELL_INCLUDE_PATH AND ASPELL_LIBRARY) + set(ASPELL_FOUND TRUE) + + # check if function aspell_version_string() exists set(CMAKE_REQUIRED_INCLUDES ${ASPELL_INCLUDE_PATH}) set(CMAKE_REQUIRED_LIBRARIES ${ASPELL_LIBRARY}) check_symbol_exists(aspell_version_string "aspell.h" HAVE_ASPELL_VERSION_STRING) set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) - set(ASPELL_FOUND TRUE) endif() mark_as_advanced( diff --git a/cmake/FindENCHANT.cmake b/cmake/FindENCHANT.cmake index e74695fc0..dd9a90962 100644 --- a/cmake/FindENCHANT.cmake +++ b/cmake/FindENCHANT.cmake @@ -41,4 +41,11 @@ else() mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES) + # check if function enchant_get_version() exists + set(CMAKE_REQUIRED_INCLUDES ${ENCHANT_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${ENCHANT_LIBRARIES}) + check_symbol_exists(enchant_get_version "enchant.h" HAVE_ENCHANT_GET_VERSION) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + endif() diff --git a/cmake/FindGuile.cmake b/cmake/FindGuile.cmake index 69e3ab011..6002876f4 100644 --- a/cmake/FindGuile.cmake +++ b/cmake/FindGuile.cmake @@ -34,4 +34,12 @@ endif() find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_search_module(GUILE guile-2.0) + if(GUILE_FOUND) + # check if variable "scm_install_gmp_memory_functions" exists + set(CMAKE_REQUIRED_INCLUDES ${GUILE_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${GUILE_LDFLAGS}) + check_symbol_exists(scm_install_gmp_memory_functions "libguile.h" HAVE_GUILE_GMP_MEMORY_FUNCTIONS) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + endif() endif() diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake index 87cb8af39..66c496664 100644 --- a/cmake/FindLua.cmake +++ b/cmake/FindLua.cmake @@ -33,51 +33,7 @@ if(LUA_FOUND) set(LUA_FIND_QUIETLY TRUE) endif() -find_path( - LUA51_INCLUDE_PATH lua.h - PATHS /usr/include /usr/local/include /usr/pkg/include - PATH_SUFFIXES lua51 lua5.1 lua-5.1 -) - -find_library( - LUA51_LIBRARY NAMES lua51 lua5.1 lua-5.1 lua - PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib - PATH_SUFFIXES lua51 lua5.1 lua-5.1 -) - -if(LUA51_INCLUDE_PATH AND LUA51_LIBRARY) - set(LUA_INCLUDE_PATH "${LUA51_INCLUDE_PATH}") - set(LUA_LIBRARY "${LUA51_LIBRARY}") - set(LUA_VERSION "5.1") - set(LUA_FOUND TRUE) -else() - find_path( - LUA50_INCLUDE_PATH lua.h - PATHS /usr/include /usr/local/include /usr/pkg/include - PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua - ) - find_library( - LUA50_LIBRARY NAMES lua50 lua5.0 lua-5.0 lua - PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib - PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua - ) - find_library( - LUALIB50_LIBRARY NAMES lualib50 lualib5.0 lualib-5.0 lualib - PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib - PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua - ) - if(LUA50_INCLUDE_PATH AND LUA50_LIBRARY AND LUALIB50_LIBRARY) - set(LUA_INCLUDE_PATH "${LUA50_INCLUDE_PATH}") - set(LUA_LIBRARY "${LUA50_LIBRARY}") - set(LUALIB_LIBRARY "${LUALIB50_LIBRARY}") - set(LUA_VERSION "5.0") - set(LUA_FOUND TRUE) - endif() +find_package(PkgConfig) +if(PKG_CONFIG_FOUND) + pkg_search_module(LUA lua5.2 lua52 lua5.1 lua51 lua5.0 lua50 lua) endif() - -mark_as_advanced( - LUA_INCLUDE_PATH - LUA_LIBRARY - LUALIB_LIBRARY -# LUA_VERSION -) diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake index 3c93c7bcb..ac92f85d2 100644 --- a/cmake/FindPython.cmake +++ b/cmake/FindPython.cmake @@ -63,17 +63,17 @@ if(PYTHON_EXECUTABLE) find_path(PYTHON_INCLUDE_PATH NAMES Python.h - PATHS ${PYTHON_INC_DIR} + HINTS ${PYTHON_INC_DIR} ) if(ENABLE_PYTHON3) find_library(PYTHON_LIBRARY NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python - PATHS ${PYTHON_POSSIBLE_LIB_PATH} + HINTS ${PYTHON_POSSIBLE_LIB_PATH} ) else() find_library(PYTHON_LIBRARY NAMES python2.7 python2.6 python2.5 python - PATHS ${PYTHON_POSSIBLE_LIB_PATH} + HINTS ${PYTHON_POSSIBLE_LIB_PATH} ) endif() diff --git a/config.h.cmake b/config.h.cmake index a7cdd0a81..82be05c6e 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -7,6 +7,8 @@ #cmakedefine HAVE_MALLINFO #cmakedefine HAVE_EAT_NEWLINE_GLITCH #cmakedefine HAVE_ASPELL_VERSION_STRING +#cmakedefine HAVE_ENCHANT_GET_VERSION +#cmakedefine HAVE_GUILE_GMP_MEMORY_FUNCTIONS #define PACKAGE_VERSION "@VERSION@" #define PACKAGE "@PROJECT_NAME@" #define PACKAGE_NAME "@PROJECT_NAME@" diff --git a/configure.ac b/configure.ac index e2db69ca0..e2fd547aa 100644 --- a/configure.ac +++ b/configure.ac @@ -102,6 +102,8 @@ AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS]) AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK]) AH_VERBATIM([HAVE_EAT_NEWLINE_GLITCH], [#undef HAVE_EAT_NEWLINE_GLITCH]) AH_VERBATIM([HAVE_ASPELL_VERSION_STRING], [#undef HAVE_ASPELL_VERSION_STRING]) +AH_VERBATIM([HAVE_ENCHANT_GET_VERSION], [#undef HAVE_ENCHANT_GET_VERSION]) +AH_VERBATIM([HAVE_GUILE_GMP_MEMORY_FUNCTIONS], [#undef HAVE_GUILE_GMP_MEMORY_FUNCTIONS]) AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS]) AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL]) AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET]) @@ -150,9 +152,6 @@ AC_ARG_ENABLE(tcl, [ --disable-tcl turn off Tcl script plugi AC_ARG_ENABLE(guile, [ --disable-guile turn off Guile (scheme) script plugin (default=compiled if found)],enable_guile=$enableval,enable_guile=yes) AC_ARG_ENABLE(trigger, [ --disable-trigger turn off Trigger plugin (default=compiled)],enable_trigger=$enableval,enable_trigger=yes) AC_ARG_ENABLE(xfer, [ --disable-xfer turn off Xfer (file transfer) plugin (default=compiled if found)],enable_xfer=$enableval,enable_xfer=yes) -AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='') -AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='') -AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='') AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR directory containing tcl configuration (tclConfig.sh)],tclconfig=$withval,tclconfig='') AC_ARG_WITH(debug, [ --with-debug debugging: 0=no debug, 1=debug compilation (default=1)],debug=$withval,debug=1) AC_ARG_ENABLE(tests, [ --enable-tests turn on build of tests (default=not built)],enable_tests=$enableval,enable_tests=no) @@ -307,6 +306,23 @@ if test "x$enable_aspell" = "xyes" ; then if test "x$ac_found_enchant_lib" = "xyes" ; then CFLAGS="$CFLAGS -DUSE_ENCHANT" ASPELL_LIB_USED="enchant" + + # check if function enchant_get_version() exists + ac_save_CFLAGS="$CFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS $ENCHANT_CFLAGS" + LDFLAGS="$LDFLAGS $ENCHANT_LIBS" + AC_CACHE_CHECK([for enchant_get_version() support], ac_cv_have_enchant_get_version, [ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <enchant.h>]], + [[ const char *version = enchant_get_version(); ]])], + [ ac_have_enchant_get_version="yes" ], + [ ac_have_enchant_get_version="no" ])]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + if test "x$ac_have_enchant_get_version" = "xyes"; then + AC_DEFINE(HAVE_ENCHANT_GET_VERSION) + fi else ASPELL_CFLAGS="" ASPELL_LFLAGS="" @@ -327,6 +343,8 @@ if test "x$enable_aspell" = "xyes" ; then AC_MSG_RESULT(yes) ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell" ASPELL_LIB_USED="aspell" + + # check if function aspell_version_string() exists ac_save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $ASPELL_LFLAGS" AC_CACHE_CHECK([for aspell_version_string() support], ac_cv_have_aspell_version_string, [ @@ -444,7 +462,7 @@ if test "x$enable_perl" = "xyes" ; then PERL_VERSION=`perl -V:version | sed "s/version='\(.*\)';/\1/"` AC_MSG_CHECKING(for Perl headers files) - PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` + PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1` if test "x$PERL_HEADER_TEST" = "x0" ; then PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts` @@ -635,7 +653,7 @@ if test "x$enable_lua" = "xyes" ; then if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then AC_MSG_CHECKING(for Lua headers and librairies with pkg-config) echo - for l in "$lua_suffix" "" "51" "5.1" "50" "5.0" ; do + for l in "$lua_suffix" "" "52" "5.2" "51" "5.1" "50" "5.0" ; do pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null` if test "x$?" = "x0" ; then LUA_VERSION=`$PKGCONFIG --modversion lua$l` @@ -654,7 +672,7 @@ if test "x$enable_lua" = "xyes" ; then if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then LUACONFIG="" - AC_CHECK_PROGS(LUACONFIG, lua-config lua-config51 lua-config5.1 lua-config50 lua-config5.0) + AC_CHECK_PROGS(LUACONFIG, lua-config lua-config52 lua-config5.2 lua-config51 lua-config5.1 lua-config50 lua-config5.0) if test "x$LUACONFIG" != "x" ; then AC_MSG_CHECKING(for Lua headers and librairies with lua-config) echo @@ -672,7 +690,7 @@ if test "x$enable_lua" = "xyes" ; then if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then LUA_CFLAGS="$CFLAGS" fi - for l in "$lua_suffix" "" "51" "5.1" "50" "5.0" ; do + for l in "$lua_suffix" "" "52" "5.2" "51" "5.1" "50" "5.0" ; do AC_CHECK_LIB(lua$l,lua_call,ac_found_lua_lib="yes",ac_found_lua_lib="no") if test "x$ac_found_lua_lib" = "xyes" ; then LUA_VERSION=">=5.1.0" @@ -794,7 +812,24 @@ if test "x$enable_guile" = "xyes" ; then fi done - if test "x$guile_found" = "xno" ; then + if test "x$guile_found" = "xyes" ; then + # check if variable "scm_install_gmp_memory_functions" exists + ac_save_CFLAGS="$CFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS $GUILE_CFLAGS" + LDFLAGS="$LDFLAGS $GUILE_LFLAGS" + AC_CACHE_CHECK([for variable scm_install_gmp_memory_functions], ac_cv_have_guile_gmp_memory_functions, [ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <libguile.h>]], + [[ scm_install_gmp_memory_functions = 0; ]])], + [ ac_have_guile_gmp_memory_functions="yes" ], + [ ac_have_guile_gmp_memory_functions="no" ])]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + if test "x$ac_have_guile_gmp_memory_functions" = "xyes"; then + AC_DEFINE(HAVE_GUILE_GMP_MEMORY_FUNCTIONS) + fi + else AC_MSG_WARN([ *** Guile >= 2.0 couldn't be found on your system. *** WeeChat will be built without Guile (scheme) support.]) diff --git a/debian/changelog b/debian/changelog index b8c06acce..07275a9d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,34 @@ +weechat (1.0-1) unstable; urgency=medium + + * New upstream release (Closes: #758230, #751108) + - Remove the patch to fix FTBFS while building against ruby 2.1 + - Fix the way to install upstream changelog + - Add new plugins (exec, trigger) + - Fix the way to install docs (upstream changes to asciidoc) + * Re-enable the build of guile plugin + * Fix various typos in packaging + * Update copyright years in debian/copyright + * Add new doc-base files (Relay Protocol in Japanese) + * Add git-buildpackage configuration + + -- Emmanuel Bouthenot <kolter@debian.org> Sun, 24 Aug 2014 17:40:36 +0200 + +weechat (0.4.3-4) unstable; urgency=medium + + * Fix FTBFS by adding a missing Build Depends on docbook-xml + (Closes:#753166) + * Update libgnutls and libgcrypt Build Depends to libgnutls28-dev and + libgcrypt20-dev (Closes: #753167) + + -- Emmanuel Bouthenot <kolter@debian.org> Wed, 02 Jul 2014 23:42:41 +0200 + +weechat (0.4.3-3) unstable; urgency=medium + + * Add patch (backported from upstream) to fix a FTBFS while building + against ruby 2.1 (Closes: #747708) + + -- Emmanuel Bouthenot <kolter@debian.org> Mon, 12 May 2014 12:49:14 +0200 + weechat (0.4.3-2) unstable; urgency=medium * Add missing symlink for Polish manpage diff --git a/debian/control b/debian/control index 77788d89e..cdab4957f 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,8 @@ Build-Depends: asciidoc (>= 8.5), source-highlight, xsltproc, - docbook-xml, docbook-xsl, + docbook-xsl, + docbook-xml, debhelper (>= 9), cmake, pkg-config, libncursesw5-dev, @@ -123,7 +124,7 @@ Package: weechat-dev Section: devel Architecture: all Depends: ${misc:Depends} -Description: Fast, light and extensible chat client - developement headers +Description: Fast, light and extensible chat client - development headers WeeChat (Wee Enhanced Environment for Chat) is a fast and light chat client for many operating systems. Everything can be done with a keyboard. . diff --git a/debian/copyright b/debian/copyright index 23fa61161..35447688f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -11,7 +11,7 @@ License: GPL-3+ Files: debian/* Copyright: 2005-2008, Julien Louis <ptitlouis@sysif.net> - 2008-2012, Emmanuel Bouthenot <kolter@openics.org> + 2008-2014, Emmanuel Bouthenot <kolter@openics.org> License: GPL-3+ License: GPL-3+ diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 000000000..cc3e99701 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,5 @@ +[DEFAULT] +upstream-branch = upstream +debian-branch = unstable +upstream-tag = v%(version)s +compression = xz diff --git a/debian/rules b/debian/rules index 400ca69ce..b92991d82 100755 --- a/debian/rules +++ b/debian/rules @@ -23,6 +23,9 @@ override_dh_auto_configure: # debhelper try to use it but that's not needed echo +override_dh_installchangelogs: + dh_installchangelogs ChangeLog.asciidoc + override_dh_strip: dh_strip --dbg-package=weechat-dbg diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 000000000..95a390b97 --- /dev/null +++ b/debian/source/include-binaries @@ -0,0 +1 @@ +debian/upstream-signing-key.pgp diff --git a/debian/source/local-options b/debian/source/local-options new file mode 100644 index 000000000..9cdfca9f9 --- /dev/null +++ b/debian/source/local-options @@ -0,0 +1,2 @@ +unapply-patches +abort-on-upstream-changes diff --git a/doc/de/autogen/plugin_api/completions.asciidoc b/doc/de/autogen/plugin_api/completions.asciidoc index c03bd625d..2806d88c6 100644 --- a/doc/de/autogen/plugin_api/completions.asciidoc +++ b/doc/de/autogen/plugin_api/completions.asciidoc @@ -86,6 +86,8 @@ | trigger | trigger_names | trigger +| trigger | trigger_names_default | voreingestellte Trigger + | trigger | trigger_option_value | Werte für Trigger-Option | trigger | trigger_options | Optionen für Trigger @@ -134,7 +136,7 @@ | weechat | layouts_names | Namen der Layouts -| weechat | nicks | Nicks in Nickliste für aktuellen Buffer +| weechat | nicks | Nicks in Benutzerliste für aktuellen Buffer | weechat | palette_colors | Farbpalette diff --git a/doc/de/autogen/plugin_api/hdata.asciidoc b/doc/de/autogen/plugin_api/hdata.asciidoc index 7cce14427..2f66dad4b 100644 --- a/doc/de/autogen/plugin_api/hdata.asciidoc +++ b/doc/de/autogen/plugin_api/hdata.asciidoc @@ -586,21 +586,13 @@ *** 'direction' (integer) *** 'add_space' (integer) *** 'force_partial_completion' (integer) -*** 'completion_list' (pointer) +*** 'list' (pointer) *** 'word_found' (string) *** 'word_found_is_nick' (integer) *** 'position_replace' (integer) *** 'diff_size' (integer) *** 'diff_length' (integer) -*** 'partial_completion_list' (pointer, hdata: "completion_partial") -*** 'last_partial_completion' (pointer, hdata: "completion_partial") -* 'completion_partial': Struktur mit teilweise Vervollständigung -** Erweiterung: weechat -** Variablen: -*** 'word' (string) -*** 'count' (integer) -*** 'prev_item' (pointer, hdata: "completion_partial") -*** 'next_item' (pointer, hdata: "completion_partial") +*** 'partial_list' (pointer) * 'config_file': Konfigurationsdatei ** Erweiterung: weechat ** Variablen: @@ -815,7 +807,7 @@ *** 'buffer_max_length_refresh' (integer) *** 'prefix_max_length' (integer) *** 'prefix_max_length_refresh' (integer) -* 'nick': Nick in Nickliste +* 'nick': Nick in Benutzerliste ** Erweiterung: weechat ** Variablen: *** 'group' (pointer, hdata: "nick_group") @@ -826,7 +818,7 @@ *** 'visible' (integer) *** 'prev_nick' (pointer, hdata: "nick") *** 'next_nick' (pointer, hdata: "nick") -* 'nick_group': Gruppen in Nickliste +* 'nick_group': Gruppen in Benutzerliste ** Erweiterung: weechat ** Variablen: *** 'name' (shared_string) diff --git a/doc/de/autogen/plugin_api/infolists.asciidoc b/doc/de/autogen/plugin_api/infolists.asciidoc index 0e942c8fa..38f35e278 100644 --- a/doc/de/autogen/plugin_api/infolists.asciidoc +++ b/doc/de/autogen/plugin_api/infolists.asciidoc @@ -54,7 +54,7 @@ | weechat | layout | Auflistung der Layouts | - | - -| weechat | nicklist | Nicks in Nickliste für einen Buffer | Buffer Pointer | nick_xxx oder group_xxx um nur den Nick/Group xxx abzufragen (optional) +| weechat | nicklist | Nicks in Benutzerliste für einen Buffer | Buffer Pointer | nick_xxx oder group_xxx um nur den Nick/Group xxx abzufragen (optional) | weechat | option | Auflistung der Optionen | - | Name einer Option (Platzhalter "*" kann verwendet werden) (optional) diff --git a/doc/de/autogen/user/exec_options.asciidoc b/doc/de/autogen/user/exec_options.asciidoc index b199c8ed7..06ffde654 100644 --- a/doc/de/autogen/user/exec_options.asciidoc +++ b/doc/de/autogen/user/exec_options.asciidoc @@ -9,7 +9,7 @@ ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `lightgreen`) * [[option_exec.command.default_options]] *exec.command.default_options* -** Beschreibung: `Standardoptionen für den Befehl /exec (siehe /help exec); Beispiele: "-nosh -bg" führt alle Befehle im Hintergrund aus (keine Textausgabe) und ohne das die shell genutzt wird` +** Beschreibung: `Standardoptionen für den Befehl /exec (siehe /help exec); Beispiele: "-nosh -bg" führt alle Befehle im Hintergrund aus (keine Textausgabe) und ohne das die shell genutzt wird` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `""`) diff --git a/doc/de/autogen/user/irc_commands.asciidoc b/doc/de/autogen/user/irc_commands.asciidoc index a094d0b1c..de5b99534 100644 --- a/doc/de/autogen/user/irc_commands.asciidoc +++ b/doc/de/autogen/user/irc_commands.asciidoc @@ -14,7 +14,7 @@ target: Servername /allchan [-current] [-exclude=<channel>[,<channel>...]] <command> [<arguments>] -current: führt einen Befehl aus der an alle Channels des aktuellen Servers gesendet wird - -exclude: dient zum Ausschluss ausgewählter Channels (Platzhalter "*" kann verwendet werden) + -exclude: dient zum Ausschluss ausgewählter Channels (Platzhalter "*" kann verwendet werden) command: Befehl der ausgeführt werden soll arguments: Argumente für Befehl (Variablen die genutzt werden können und durch das Äquivalent ersetzt wird: $nick, $channel und $server) @@ -87,15 +87,16 @@ Ohne Angabe von Argumenten wird die Ban-Liste für den aktuellen Channel angezei /connect <server> [<server>...] [-<option>[=<value>]] [-no<option>] [-nojoin] [-switch] -all|-auto|-open [-nojoin] [-switch] - server: Name des Servers (folgende Möglichkeiten bestehen): - - intern genutzter Servername, zu dem eine Verbindung aufgebaut werden soll (Der Server sollte zuerst mittels "/server add" angelegt werden) - - Hostname/Port oder IP/Port (damit wird lediglich ein TEMPORÄRER Server erstellt), Port 6667 wird standardmäßig verwendet + server: Name des Servers, folgende Möglichkeiten bestehen: + - intern genutzter Servername, zu dem eine Verbindung aufgebaut werden soll (Server muss zuerst mittels "/server add" angelegt werden (wird empfohlen!)) + - Hostname/Port oder IP/Port, Port 6667 wird standardmäßig verwendet - URL mit folgendem Format: irc[6][s]://[nickname[:password]@]irc.example.org[:port][/#channel1][,#channel2[...]] + Hinweis: bei einer Adresse/IP/URL, wird ein temporärer Server erstellt (DIESER WIRD NICHT GESPEICHERT), siehe /help irc.look.temporary_servers option: legt Option für den Server fest (die Boolean-Optionen können weggelassen werden) nooption: deaktiviert eine Boolean Option (Beispiel: -nossl) -all: Verbindung wird zu den Servern hergestellt, für die eine Konfiguration vorhanden ist -auto: Verbindung zu den Servern herstellen, für die die Option "autoconnect" aktiviert ist - -open: stellt eine Verbindung zu allen geöffneten Servern her, zu denen aktuell aber keine Verbindung besteht + -open: stellt eine Verbindung zu allen geöffneten Servern her, zu denen aktuell keine Verbindung besteht -nojoin: Channel(s) werden nicht betreten (auch falls die Funktion "autojoin" aktiviert sein sollte) -switch: wechselt zur nächsten Server-Adresse @@ -198,7 +199,7 @@ target: Servername server: interner Name des Servers -all: Verbindung zu allen Servern trennen --pending: bricht eine automatische Wiederverbindung für Server ab, zu denen gerade eine erneute Verbindung aufgebaut werden soll +-pending: bricht eine automatische Wiederverbindung für Server ab, zu denen gerade eine erneute Verbindung aufgebaut werden soll reason: Begründung der Trennung ---- @@ -237,7 +238,7 @@ Beispiele: /ignore add toto ignoriert den Host "toto@domain.com" auf dem freenode Server: /ignore add toto@domain.com freenode - ignoriert den Host "toto*@*.domain.com" im Chat freenode/#weechat: + ignoriert den Host "toto*@*.domain.com" im Chat freenode/#weechat: /ignore add toto*@*.domain.com freenode #weechat ---- @@ -295,7 +296,7 @@ Beispiele: channel: Channelname nick: Nick der rausgeworfen werden soll - reason: Begründung für den Rauswurf (Variablen die genutzt werden können: $nick, $channel und $server) + reason: Begründung für den Rauswurf (Variablen die genutzt werden können: $nick, $channel und $server) ---- [[command_irc_kickban]] @@ -605,7 +606,7 @@ option: zusätzliche Option, die von manchen Servern berücksichtigt wird channel: Channelname nick: Nick der rausgeworfen werden soll - reason: Begründung für den Rauswurf (Variablen die genutzt werden können: $nick, $channel und $server) + reason: Begründung für den Rauswurf (Variablen die genutzt werden können: $nick, $channel und $server) ---- [[command_irc_restart]] @@ -631,7 +632,7 @@ channel: Name des Channels [command]*`samode`* ändert den Modus des Channels ohne das Operator-Privilegien vorliegen:: ---- -/samode <channel> <mode> +/samode [<channel>] <mode> Channel: Name des Channel Mode: neuer Modus für Channel diff --git a/doc/de/autogen/user/irc_options.asciidoc b/doc/de/autogen/user/irc_options.asciidoc index a370b5e25..8293be55f 100644 --- a/doc/de/autogen/user/irc_options.asciidoc +++ b/doc/de/autogen/user/irc_options.asciidoc @@ -129,7 +129,7 @@ ** Werte: on, off (Standardwert: `on`) * [[option_irc.look.display_host_join_local]] *irc.look.display_host_join_local* -** Beschreibung: `zeigt den Host innerhalb einer join Nachrichten des lokalen Client an` +** Beschreibung: `zeigt den Host innerhalb einer join Nachrichten des lokalen Client an` ** Typ: boolesch ** Werte: on, off (Standardwert: `on`) @@ -159,17 +159,17 @@ ** Werte: on, off (Standardwert: `on`) * [[option_irc.look.highlight_channel]] *irc.look.highlight_channel* -** Beschreibung: `durch Kommata getrennte Liste von Wörtern die in Channel-Buffern als Highlight erscheinen sollen (zwischen Groß- und Kleinschreibung wird nicht unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss zu Beginn "(?-i)" genutzt werden; des weiteren können folgende Variablen genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann werden die angegeben Wörter dem Buffer-Merkmal "highlight_words" hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein Highlight für den Nick. Beispiel: "$nick", "(?-i)$nick"` +** Beschreibung: `durch Kommata getrennte Liste von Wörtern die in Channel-Buffern als Highlight erscheinen sollen (zwischen Groß- und Kleinschreibung wird nicht unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss zu Beginn "(?-i)" genutzt werden; des weiteren können folgende Variablen genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann werden die angegeben Wörter dem Buffer-Merkmal "highlight_words" hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein Highlight für den Nick. Beispiel: "$nick", "(?-i)$nick"` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"$nick"`) * [[option_irc.look.highlight_pv]] *irc.look.highlight_pv* -** Beschreibung: `durch Kommata getrennte Liste von Wörtern die in einem privaten Buffer als Highlight erscheinen sollen (zwischen Groß- und Kleinschreibung wird nicht unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss zu Beginn "(?-i)" genutzt werden; des weiteren können folgende Variablen genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann werden die angegeben Wörter dem Buffer-Merkmal "highlight_words" hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein Highlight für den Nick. Beispiel: "$nick", "(?-i)$nick"` +** Beschreibung: `durch Kommata getrennte Liste von Wörtern die in einem privaten Buffer als Highlight erscheinen sollen (zwischen Groß- und Kleinschreibung wird nicht unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss zu Beginn "(?-i)" genutzt werden; des weiteren können folgende Variablen genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann werden die angegeben Wörter dem Buffer-Merkmal "highlight_words" hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein Highlight für den Nick. Beispiel: "$nick", "(?-i)$nick"` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"$nick"`) * [[option_irc.look.highlight_server]] *irc.look.highlight_server* -** Beschreibung: `durch Kommata getrennte Liste von Wörtern die in Server-Buffern als Highlight erscheinen sollen (zwischen Groß- und Kleinschreibung wird nicht unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss zu Beginn "(?-i)" genutzt werden; des weiteren können folgende Variablen genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann werden die angegeben Wörter dem Buffer-Merkmal "highlight_words" hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein Highlight für den Nick. Beispiel: "$nick", "(?-i)$nick"` +** Beschreibung: `durch Kommata getrennte Liste von Wörtern die in Server-Buffern als Highlight erscheinen sollen (zwischen Groß- und Kleinschreibung wird nicht unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss zu Beginn "(?-i)" genutzt werden; des weiteren können folgende Variablen genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann werden die angegeben Wörter dem Buffer-Merkmal "highlight_words" hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein Highlight für den Nick. Beispiel: "$nick", "(?-i)$nick"` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"$nick"`) @@ -329,7 +329,7 @@ ** Werte: 0 .. 10080 (Standardwert: `30`) * [[option_irc.look.smart_filter_mode]] *irc.look.smart_filter_mode* -** Beschreibung: `aktiviert einen intelligenten Filter für "mode" Nachrichten: "*" filtert alle Modi-Nachrichten, "+" um alle Modi im Server-Präfix zu filtern (zum Beispiel "ovh"), "xyz" um die Modi x/y/z zu filtern, "-xyz" um alle Modi, außer x/y/z, zu filtern; Beispiele: "ovh": filtert die Modi o/v/h, "-bkl": filtert alle Modi, ausgenommen b/k/l` +** Beschreibung: `aktiviert einen intelligenten Filter für "mode" Nachrichten: "*" filtert alle Modi-Nachrichten, "+" um alle Modi im Server-Präfix zu filtern (zum Beispiel "ovh"), "xyz" um die Modi x/y/z zu filtern, "-xyz" um alle Modi, außer x/y/z, zu filtern; Beispiele: "ovh": filtert die Modi o/v/h, "-bkl": filtert alle Modi, ausgenommen b/k/l` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"+"`) @@ -343,6 +343,11 @@ ** Typ: boolesch ** Werte: on, off (Standardwert: `on`) +* [[option_irc.look.temporary_servers]] *irc.look.temporary_servers* +** Beschreibung: `aktiviert die Erstellung von temporären Servern mit dem Befehl /connect` +** Typ: boolesch +** Werte: on, off (Standardwert: `off`) + * [[option_irc.look.topic_strip_colors]] *irc.look.topic_strip_colors* ** Beschreibung: `Farben werden im Channel-Thema entfernt (wird nur genutzt wenn der Buffer-Titel angezeigt wird)` ** Typ: boolesch @@ -364,7 +369,7 @@ ** Werte: 0 .. 604800 (Standardwert: `600`) * [[option_irc.network.ban_mask_default]] *irc.network.ban_mask_default* -** Beschreibung: `Vorgabewert für Befehle /ban, /unban und /kickban; Variablen $nick, $user, $ident und $host werden durch den jeweiligen Wert ersetzt (extrahiert aus "nick!user@host"); $ident ist identisch mit $user, sofern $user nicht mit "~" beginnt. Andernfalls wird daraus "*"; diese Vorgabemaske wird nur angewendet, sofern WeeChat den Host des Nicks ermitteln kann` +** Beschreibung: `Vorgabewert für Befehle /ban, /unban und /kickban; Variablen $nick, $user, $ident und $host werden durch den jeweiligen Wert ersetzt (extrahiert aus "nick!user@host"); $ident ist identisch mit $user, sofern $user nicht mit "~" beginnt. Andernfalls wird daraus "*"; diese Vorgabemaske wird nur angewendet, sofern WeeChat den Host des Nicks ermitteln kann` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"*!$ident@$host"`) @@ -479,7 +484,7 @@ ** Werte: 0 .. 1000000 (Standardwert: `25`) * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** Beschreibung: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, multi-prefix, server-time, userhost-in-names, (example: "away-notify,multi-prefix")` +** Beschreibung: `durch Kommata getrennte Liste von erweiterten Client Fähigkeiten ("client capabilities"), welche vom Server angeboten und genutzt werden sollen. Fähigkeiten die von WeeChat unterstützt werden: away-notify, extended-join, multi-prefix, server-time, userhost-in-name (Beispiel: "away-notify,multi-prefix")` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `""`) @@ -591,7 +596,7 @@ * [[option_irc.server_default.ssl_priorities]] *irc.server_default.ssl_priorities* ** Beschreibung: `Zeichenkette mit Prioritäten für gnutls (für die korrekte Syntax siehe gnutls Dokumentation unter Funktion gnutls_priority_init. Gebräuchliche Zeichenketten sind: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` ** Typ: Zeichenkette -** Werte: beliebige Zeichenkette (Standardwert: `"NORMAL"`) +** Werte: beliebige Zeichenkette (Standardwert: `"NORMAL:-VERS-SSL3.0"`) * [[option_irc.server_default.ssl_verify]] *irc.server_default.ssl_verify* ** Beschreibung: `überprüft ob die SSL-Verbindung vertrauenswürdig ist` diff --git a/doc/de/autogen/user/relay_commands.asciidoc b/doc/de/autogen/user/relay_commands.asciidoc index a326b630b..4fa54a796 100644 --- a/doc/de/autogen/user/relay_commands.asciidoc +++ b/doc/de/autogen/user/relay_commands.asciidoc @@ -3,8 +3,8 @@ ---- /relay list|listfull|listrelay - add [ipv4.][ipv6.][ssl.]<protocol.name> <port> - del [ipv4.][ipv6.][ssl.]<protocol.name> + add <name> <port> + del|stop|restart <name> raw sslcertkey @@ -13,15 +13,23 @@ listrelay: Auflistung der Relays (Name und Port) add: fügt ein Relay, für ein Protokoll + Name, hinzu del: entfernt Relay für ein Protokoll + Name + stop: schließt den Server Socket (Clients bleiben verbunden) + restart: beendet den Server Socket und lauscht erneut am Port (Clients bleiben verbunden) + name: Name des Relays (siehe Format weiter unten) + port: Port der für Relay genutzt werden soll + raw: öffnet einen Buffer mit Relay-Rohdaten + sslcertkey: setzt SSL Zertifikat/Schlüssel mittels Pfad in Option relay.network.ssl_cert_key + +Aufbau des Relay-Namens: [ipv4.][ipv6.][ssl.]<Protokoll.Name> ipv4: erzwingt die Nutzung von IPv4 ipv6: erzwingt die Nutzung von IPv6 ssl: aktiviert SSL -protocol.name: Protokoll und Name des Relay: - - Protokoll "irc": Name des Servers welcher geteilt werden soll (optional). Wird kein Name angegeben, dann muss der Client den Servernamen mittels Befehl "PASS" anfordern. Format: "PASS Server:Passwort") - - Protokoll "weechat" (Name wird nicht unterstützt) - port: Port den das Relay nutzen soll - raw: öffnet Buffer mit RAW-Relay Daten - sslcertkey: setzt SSL Zertifikat/Schlüssel mittels Eintrag in Option relay.network.ssl_cert_key +protocol.name: Protokoll und Name relay: + - Protokoll "irc": Name des Servers welcher geteilt werden soll (optional. Falls kein Name angegeben wird, muss der Client einen Namen mit dem Befehl "PASS" übermitteln, das Format ist wie folgt: "PASS Server:Passwort") + - Protokoll "weechat" (es wird kein Name verwendet) + +Das "irc" Protokoll dient dazu eine Verbindung zu einem anderen IRC Client (oder zu einem zweiten WeeChat) herzustellen. +Das "weechat" Protokoll wird von einem Remote-Interface genutzt um eine Verbindung herzustellen. Siehe http://weechat.org/download/ Ohne Angabe von Argumenten werden alle Relay-Clients in einem neuen Buffer dargestellt. diff --git a/doc/de/autogen/user/relay_options.asciidoc b/doc/de/autogen/user/relay_options.asciidoc index 1528bdd05..a2b5781ff 100644 --- a/doc/de/autogen/user/relay_options.asciidoc +++ b/doc/de/autogen/user/relay_options.asciidoc @@ -59,7 +59,7 @@ ** Werte: on, off (Standardwert: `on`) * [[option_relay.irc.backlog_tags]] *relay.irc.backlog_tags* -** Beschreibung: `Nachrichten-Tags welche im Verlaufsspeicher, für IRC Channels, angezeigt werden (unterstützte Tags: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = alle unterstützten Tags` +** Beschreibung: `durch Kommata getrennte Liste von Nachrichten-Tags welche im Verlaufsspeicher von IRC Channels angezeigt werden (unterstützte Tags: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = alle unterstützten Tags` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"irc_privmsg"`) @@ -79,7 +79,7 @@ ** Werte: 0 .. 65535 (Standardwert: `256`) * [[option_relay.network.allowed_ips]] *relay.network.allowed_ips* -** Beschreibung: `erweiterter regulärer POSIX Ausdruck für IP Adressen die auf das Relay zugreifen dürfen (zwischen Groß- und Kleinschreibung wird dabei nicht unterschieden. Um zwischen Groß-und Kleinschreibung zu unterscheiden muss am Wortanfang "(?-i)" genutzt werden) . Sollte IPv6 aktiviert sein und es wird eine IPv4 Verbindung aufgebaut, werden die IPv6 Adressen nach IPv4 gewandelt (siehe: "::ffff:127.0.0.1"), Beispiele: "^((::ffff:)?123.45.67.89|192.160.*)$"` +** Beschreibung: `erweiterter regulärer POSIX Ausdruck für IP Adressen die auf das Relay zugreifen dürfen (zwischen Groß- und Kleinschreibung wird dabei nicht unterschieden. Um zwischen Groß-und Kleinschreibung zu unterscheiden muss am Wortanfang "(?-i)" genutzt werden) . Sollte IPv6 aktiviert sein und es wird eine IPv4 Verbindung aufgebaut, werden die IPv6 Adressen nach IPv4 gewandelt (siehe: "::ffff:127.0.0.1"), Beispiele: "^((::ffff:)?123.45.67.89|192.160.*)$"` ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `""`) @@ -118,6 +118,11 @@ ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"%h/ssl/relay.pem"`) +* [[option_relay.network.ssl_priorities]] *relay.network.ssl_priorities* +** Beschreibung: `Zeichenkette mit Prioritäten für gnutls (für die korrekte Syntax siehe gnutls Dokumentation unter Funktion gnutls_priority_init. Gebräuchliche Zeichenketten sind: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` +** Typ: Zeichenkette +** Werte: beliebige Zeichenkette (Standardwert: `"NORMAL:-VERS-SSL3.0"`) + * [[option_relay.network.websocket_allowed_origins]] *relay.network.websocket_allowed_origins* ** Beschreibung: `erweiterter regulärer POSIX Ausdruck für Origins in WebSockets (Groß- und Kleinschreibung wird ignoriert, um Groß- und Kleinschreibung zu nutzen muss "(?-i)" dem Origin vorangestellt werden), Beispiele: "^http://(www\.)?example\.(com|org)"` ** Typ: Zeichenkette diff --git a/doc/de/autogen/user/script_commands.asciidoc b/doc/de/autogen/user/script_commands.asciidoc index 197453e6d..e617c368a 100644 --- a/doc/de/autogen/user/script_commands.asciidoc +++ b/doc/de/autogen/user/script_commands.asciidoc @@ -56,7 +56,7 @@ Befehle die in der Eingabezeile des Skript-Buffers eingegeben werden können: i/r/l/L/u/h Aktionen die für ein Skript ausgeführt werden können (siehe Tastenbefehle, weiter oben) q schließt den Buffer $ Buffer wird aktualisiert - s:x,y Buffer wird nach den Vorgaben x und y sortiert (siehe /help script.look.sort) + s:x,y Buffer wird nach den Vorgaben x und y sortiert (siehe /help script.look.sort) s: die Sortierung des Buffers wird zurückgesetzt (Standardwerte werden genutzt) word(s) Skripten werden gefiltert: sucht nach einem oder mehreren Wörtern in den Skripten (der Beschreibung, in den Schlagwörtern, ...) * Filter wird zurückgesetzt diff --git a/doc/de/autogen/user/trigger_commands.asciidoc b/doc/de/autogen/user/trigger_commands.asciidoc index 228d6645a..c0ac520c7 100644 --- a/doc/de/autogen/user/trigger_commands.asciidoc +++ b/doc/de/autogen/user/trigger_commands.asciidoc @@ -12,6 +12,7 @@ restart <name>|-all [<name>...] show <name> del <name>|-all [<name>...] + restore <name> [<name>...] default -yes monitor [<filter>] @@ -54,6 +55,7 @@ return_code: Rückgabewert für Callback (ok (standard), ok_eat, error) show: zeigt detaillierte Informationen zu einem Trigger (inklusive einer kleinen Statistik) del: entfernt einen Trigger -all: führt eine Aktion aus, die alle Trigger beinhaltet + restore: stellt Trigger mit Standardwerten wieder her (funktioniert nur bei vorgegebenen Triggern) default: stellt die standardmäßigen Trigger wieder her monitor: öffnet den Trigger Monitor-Buffer, mit optionaler Filterfunktion: Filter: zeigt Hooks/Trigger an (ein Hook muss mit "@" beginnen, zum Beispiel "@signal"), mehrere Filter können durch Kommata voneinander getrennt werden; Platzhalter "*" kann im Namen des Trigger verwendet werden @@ -66,7 +68,7 @@ Wenn ein Trigger-Callback aufgerufen wird, dann wird folgende Befehlskette ausge Beispiele (die standardmäßig, eingebauten Trigger kann man sich mit "/trigger listdefault" anzeigen lassen): fügt einer Nachricht die Textattribute *fett*, _unterstrichen_ und /kursiv/ hinzu: - /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}/" + /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/" verbirgt die Nicklist auf kleineren Terminals: /trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist" /trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist" diff --git a/doc/de/autogen/user/weechat_commands.asciidoc b/doc/de/autogen/user/weechat_commands.asciidoc index a4ad51e28..f6b6b2764 100644 --- a/doc/de/autogen/user/weechat_commands.asciidoc +++ b/doc/de/autogen/user/weechat_commands.asciidoc @@ -30,7 +30,7 @@ message: Abwesenheitsnachricht (ohne Angabe einer Nachricht wird der Abwesenheit condition: Merkmal(e) für eine Infobar (nur nutzbar mit der Type-Option "window"): active: in einem aktiven Fenster inactive: in einem inaktiven Fenster - nicklist: in Fenstern mit einer Nickliste + nicklist: in Fenstern mit einer Benutzerliste weitere Merkmale: siehe /help weechat.bar.xxx.conditions und /help eval ohne Angabe von Merkmalen wird die Infobar immer angezeigt position: bottom (unten), top (oben), left (links) oder right (rechts) @@ -54,7 +54,7 @@ Beispiele: /bar add mybar root bottom 1 0 [time],buffer_number+:+buffer_name,completion versteckt die Infobar (meinebar): /bar hide meinebar - scrollt die Nickliste im aktuellen Buffer um 10 Zeilen nach unten: + scrollt die Benutzerliste im aktuellen Buffer um 10 Zeilen nach unten: /bar scroll nicklist * y+10 scrollt zum Ende der Nicklist im aktuellen Buffer: /bar scroll nicklist * ye @@ -191,7 +191,7 @@ Ohne Angabe von Argumenten wird der Cursor-Modus umgeschaltet. Ist die Mausfunktion aktiviert (siehe /help mouse), startet man den Cursor-Modus mit der mittleren Maustaste und positioniert den Cursor auf diesen Punkt. Beispiele: - gehe zur Nickliste: + gehe zur Benutzerliste: /cursor go nicklist gehe zu den Koordinaten x=10, y=5: /cursor go 10,5 @@ -260,11 +260,12 @@ Um einen Vergleich zwischen zwei Zeichenketten zu erzwingen, müssen die Ausdrü Einige Variablen werden im Ausdruck, mittels der Formatierung ${Variable}, ersetzt. Mögliche Variablen sind, nach Reihenfolge ihrer Priorität: 1. eine Zeichenkette mit Escapesequenzen (Format: "esc:xxx" oder "\xxx") - 2. eine Farbe (Format: color:xxx) - 3. eine Info (Format: "info:name,arguments", Argumente sind optional) - 4. der Name einer Option (Format: file.section.option) - 5. der Name einer lokalen Variablen eines Buffer - 6. ein hdata Name/Variable (der Wert wird automatisch als Zeichenkette konvertiert), standardmäßig wird für "window" und "buffer" das aktuelle Fenster/Buffer verwendet. + 2. Zeichen welche in einer Zeichenkette nicht dargestellt werden sollen (Format: "hide:Zeichen,Zeichenkette") + 3. eine Farbe (Format: color:xxx) + 4. eine Info (Format: "info:name,arguments", Argumente sind optional) + 5. der Name einer Option (Format: file.section.option) + 6. der Name einer lokalen Variablen eines Buffer + 7. ein hdata Name/Variable (der Wert wird automatisch als Zeichenkette konvertiert), standardmäßig wird für "window" und "buffer" das aktuelle Fenster/Buffer verwendet. Das Format für hdata kann wie folgt aufgebaut sein: hdata.var1.var2...: startet mit hdata (der Pointer muss bekannt sein) und fragt eine Variable nach der anderen ab (weitere hdata können folgen) hdata[list].var1.var2...: startet hdata mittels einer Liste, zum Beispiel: @@ -280,6 +281,7 @@ Beispiele (einfache Zeichenketten): /eval -n ${window.buffer.full_name} ==> core.weechat /eval -n ${window.buffer.number} ==> 1 /eval -n ${\t} ==> <tab> + /eval -n ${hide:-,${relay.network.password}} ==> -------- Beispiele (Bedingungen): /eval -n -c ${window.buffer.number} > 2 ==> 0 @@ -316,13 +318,13 @@ disable: Filter deaktivieren - "*" bedeutet, alle Buffer - beginnt ein Name mit '!' wird für diesen Buffer kein Filter genutzt - Platzhalter "*" kann verwendet werden - tags: durch Kommata getrennte Liste von Schlagwörtern. Zum Beispiel: "irc_join,irc_part,irc_quit" - - logisch "und": wird "+" zwischen den Tags verwendet (zum Beispiel: "nick_toto+irc_action") + tags: durch Kommata getrennte Liste von Schlagwörtern. Zum Beispiel: "irc_join,irc_part,irc_quit" + - logisch "und": mittels "+" zwischen den Tags (zum Beispiel: "nick_toto+irc_action") - Platzhalter "*" kann verwendet werden - wird ein Tag mit '!' eingeleitet, dann muss dieser Tag NICHT in der Nachricht enthalten sein regex: erweiterter regulärer POSIX Ausdruck, um in einer Zeile zu suchen - das Präfix (z.B. Nick) wird mittels '\t' von der Nachricht getrennt. Sonderzeichen wie '|' müssen mit einer Escapesequenz : '\|' eingebunden werden) - - wird ein regulärer Ausdruck mit '!' eingeleitet dann wird das übereinstimmende Ergebnis umgekehrt (nutze '\!' um mit '!' zu beginnen) + - wird ein regulärer Ausdruck mit '!' eingeleitet dann wird das übereinstimmende Ergebnis umgekehrt (nutze '\!' um mit '!' zu beginnen) - es werden zwei reguläre Ausdrücke erstellt: Der erste für den Präfix und der zweite für die eigentliche Nachricht - reguläre Ausdrücke unterscheiden nicht zwischen Groß- und Kleinschreibung. Um zwischen Groß- und Kleinschreibung zu unterscheiden müssen diese mit "(?-i)" eingeleitet werden. @@ -335,7 +337,7 @@ Die am häufigsten gebrauchten Schlagwörter lauten: host_xxx (xxx ist der Username + Host), irc_xxx (xxx ist durch einen IRC-Befehl/-Nummer zu ersetzen, siehe /server raw oder /debug tags) irc_numeric, irc_error, irc_action, irc_ctcp, irc_ctcp_reply, irc_smart_filter, away_info. -Mittels "/debug tags" kann man sich die Tags jeder einzelnen Zeile darstellen zu lassen. +Mittels "/debug tags" kann man sich die Tags jeder einzelnen Zeile darstellen lassen. Beispiele: aktiviert den intelligenten IRC Filter für alle Buffer: @@ -458,7 +460,7 @@ Dieser Befehl wird sinnvollerweise mittels Tastenbelegungen oder Erweiterungen g listdefault: zeigt die Standardeinstellung der Tastenbelegung an listdiff: zeigt die Unterschiede zwischen der aktuell genutzten Tastaturbelegung und der Standardbelegung an (hinzugefügte/verändert/gelöschte Tastenbelegungen) context: Name des Kontextes ("default" oder "search") - bind: belegt eine Taste mit einem Befehl oder zeigt an welcher Befehl auf eine Taste gelegt wurde (für Kontext "default") + bind: belegt eine Taste mit einem Befehl oder zeigt an welcher Befehl auf eine Taste gelegt wurde (für Kontext "default") bindctxt: belegt eine Taste mit einem Befehl oder zeigt an welcher Befehl auf eine Taste gelegt wurde, dies trifft für Kontext definierte Tasten zu command: Befehl (mehrere Befehle werden durch ein Semikolon getrennt) unbind: hebt eine Tastenbelegung auf (für Kontext "default") @@ -529,7 +531,7 @@ disable: deaktiviert Maus toggle: umschalten der Mausunterstützung delay: Verzögerung (in Sekunden) nach welcher der ursprüngliche Status wiederhergestellt wird (sinnvoll um die Mausunterstützung zeitabhängig zu deaktivieren) -Die Mausunterstützung wird in der Option "weechat.look.mouse" gesichert. +Die Mausunterstützung wird in der Option "weechat.look.mouse" gesichert. Beispiele: Mausunterstützung aktivieren: @@ -874,7 +876,7 @@ Es ist möglich die WeeChat-Sitzung auf einem anderen Rechner wiederherzustellen h: Stunden command: Befehl der ausgeführt werden soll (ohne das führende '/') oder ein Text der in dem Buffer ausgegeben werden soll -Hinweis: Der Befehl der Zeit verzögert gestartet werden soll wird im selben Buffer ausgeführt in dem auch der /wait Befehl aufgerufen wurde. Falls der Buffer nicht gefunden werden kann, da er in der Zwischenzeit zum Beispiel geschlossen wurde, wird der Befehl im WeeChat Core-Buffer ausgeführt. +Hinweis: Der Befehl der Zeit verzögert gestartet werden soll wird im selben Buffer ausgeführt in dem auch der /wait Befehl aufgerufen wurde. Falls der Buffer nicht gefunden werden kann, da er in der Zwischenzeit zum Beispiel geschlossen wurde, wird der Befehl im WeeChat Core-Buffer ausgeführt. Beispiele: Betritt nach 10 Sekunden den Channel #test: @@ -927,7 +929,7 @@ Beispiele: scroll_up: scrollt ein paar Zeilen nach oben scroll_down: scrollt ein paar Zeilen nach unten scroll_top: scrollt zum Anfang des Buffers -scroll_bottom: scrollt zum Ende des Buffers +scroll_bottom: scrollt zum Ende des Buffers scroll_beyond_end: scrollt über das Ende des Buffers hinaus scroll_previous_highlight: scrollt zum vorherigen Hightlight scroll_next_highlight: scrollt zum nächsten Highlight diff --git a/doc/de/autogen/user/weechat_options.asciidoc b/doc/de/autogen/user/weechat_options.asciidoc index 75f307820..6e4e910fe 100644 --- a/doc/de/autogen/user/weechat_options.asciidoc +++ b/doc/de/autogen/user/weechat_options.asciidoc @@ -69,17 +69,17 @@ ** Werte: beliebige Zeichenkette (Standardwert: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) * [[option_weechat.color.chat_nick_offline]] *weechat.color.chat_nick_offline* -** Beschreibung: `Textfarbe für Nicks im Buffer die Offline sind (dies betrifft Nicks, die nicht in der Nickliste vorhanden sind!)` +** Beschreibung: `Textfarbe für Nicks die nicht angemeldet sind (nicht in der Benutzerliste aufgeführt sind); diese Farbeinstellung wird aber nur verwendet wenn die Option weechat.look.color_nick_offline aktiviert ist` ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `default`) * [[option_weechat.color.chat_nick_offline_highlight]] *weechat.color.chat_nick_offline_highlight* -** Beschreibung: `Textfarbe für Highlight Nachrichten von Nicks die nicht mehr Online sind` +** Beschreibung: `Textfarbe bei Highlights für Nicks die nicht angemeldet sind; diese Farbeinstellung wird aber nur verwendet wenn die Option weechat.look.color_nick_offline aktiviert ist` ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `default`) * [[option_weechat.color.chat_nick_offline_highlight_bg]] *weechat.color.chat_nick_offline_highlight_bg* -** Beschreibung: `Hintergrundfarbe für Highlight Nachrichten von Nicks die nicht mehr Online sind` +** Beschreibung: `Hintergrundfarbe bei Highlights für Nicks die nicht angemeldet sind, diese Farbeinstellung wird aber nur verwendet wenn die Option weechat.look.color_nick_offline aktiviert ist` ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `blue`) @@ -219,7 +219,7 @@ ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `cyan`) * [[option_weechat.color.nicklist_group]] *weechat.color.nicklist_group* -** Beschreibung: `Textfarbe für Gruppen in Nickliste` +** Beschreibung: `Textfarbe für Gruppen in Benutzerliste` ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `green`) @@ -283,6 +283,11 @@ ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `yellow`) +* [[option_weechat.color.status_mouse]] *weechat.color.status_mouse* +** Beschreibung: `Farbe des Zeichens welches den Status der Maus anzeigt` +** Typ: Farbe +** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `green`) + * [[option_weechat.color.status_name]] *weechat.color.status_name* ** Beschreibung: `Farbe des aktuellen Buffer-Namens in der Statuszeile` ** Typ: Farbe @@ -294,7 +299,7 @@ ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `lightgreen`) * [[option_weechat.color.status_nicklist_count]] *weechat.color.status_nicklist_count* -** Beschreibung: `Textfarbe für die Anzahl der Nicks in der Nickliste (Statusbar)` +** Beschreibung: `Textfarbe für die Anzahl der Nicks in der Benutzerliste (Statusbar)` ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `default`) @@ -313,6 +318,11 @@ ** Typ: boolesch ** Werte: on, off (Standardwert: `on`) +* [[option_weechat.completion.command_inline]] *weechat.completion.command_inline* +** Beschreibung: `ist diese Option aktiviert werden Befehle innerhalb der Eingabezeile vervollständigt (ein Befehl zu Beginn der Eingabezeile besitzt die höhere Priorität und wird zuerst verwendet). Hinweis: die Vervollständigung von Verzeichnissen, die mit '/' beginnen, funktioniert außerhalb von Befehlen nicht mehr` +** Typ: boolesch +** Werte: on, off (Standardwert: `on`) + * [[option_weechat.completion.default_template]] *weechat.completion.default_template* ** Beschreibung: `Standardvorlage für die automatische Vervollständigung (in der API-Dokumentation findet man die vorgegebenen Codes und Werte, Funktion "weechat_hook_command")` ** Typ: Zeichenkette @@ -499,7 +509,7 @@ ** Werte: on, off (Standardwert: `on`) * [[option_weechat.look.color_nick_offline]] *weechat.look.color_nick_offline* -** Beschreibung: `Nicks die Offline sind werden im Buffer in einer anderen Farbe dargestellt (dies betrifft Nicks, die nicht in der Nickliste vorhanden sind!)` +** Beschreibung: `Nicks die Offline sind werden im Buffer in einer anderen Farbe dargestellt (dies betrifft Nicks, die nicht in der Benutzerliste vorhanden sind!)` ** Typ: boolesch ** Werte: on, off (Standardwert: `off`) @@ -518,6 +528,11 @@ ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `""`) +* [[option_weechat.look.command_incomplete]] *weechat.look.command_incomplete* +** Beschreibung: `ist diese Option aktiviert werden unvollständige und eindeutige Befehle akzeptiert, zum Beispiel /he für /help` +** Typ: boolesch +** Werte: on, off (Standardwert: `off`) + * [[option_weechat.look.confirm_quit]] *weechat.look.confirm_quit* ** Beschreibung: `ist diese Option aktiviert, muss der "/quit" Befehl mit der Option "-yes" ausgeführt werden (siehe /help quit)` ** Typ: boolesch @@ -663,6 +678,11 @@ ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `"!"`) +* [[option_weechat.look.item_mouse_status]] *weechat.look.item_mouse_status* +** Beschreibung: `Zeichen mit welchem signalisiert wird ob die Mausfunktionalität eingeschaltet ist (durch Bar-Item "mouse_status")` +** Typ: Zeichenkette +** Werte: beliebige Zeichenkette (Standardwert: `"M"`) + * [[option_weechat.look.item_time_format]] *weechat.look.item_time_format* ** Beschreibung: `Format für die Zeitanzeige des Bar-Items, "time" (siehe man strftime, welche Platzhalter für das Datum und die Uhrzeit verwendet werden)` ** Typ: Zeichenkette diff --git a/doc/de/weechat.1.de.asciidoc b/doc/de/weechat.1.de.asciidoc index 2214d608e..9936c19aa 100644 --- a/doc/de/weechat.1.de.asciidoc +++ b/doc/de/weechat.1.de.asciidoc @@ -53,9 +53,8 @@ $HOME/.weechat/weechat.conf:: $HOME/.weechat/plugins.conf:: Konfigurationsdatei für Erweiterungen -// TRANSLATION MISSING $HOME/.weechat/sec.conf:: - configuration file with secured data + Konfigurationsdatei mit schutzwürdigen Daten $HOME/.weechat/alias.conf:: Konfigurationsdatei für 'alias' Erweiterung diff --git a/doc/de/weechat_faq.de.asciidoc b/doc/de/weechat_faq.de.asciidoc index 4fb681ec7..008a5740d 100644 --- a/doc/de/weechat_faq.de.asciidoc +++ b/doc/de/weechat_faq.de.asciidoc @@ -54,6 +54,22 @@ Beachte, dass dieses Paket nicht immer exakt mit dem git Repository übereinstim und daher auch weniger brauchbar sein kann. Im Gegensatz zu der Möglichkeit, dass man selbst das Repository klont und daraus Updates installiert. +[[compile_osx]] +=== Wie installiere ich WeeChat auf OS X? + +Wir empfehlen, dass zur Installation http://brew.sh/[Homebrew] genutzt wird. +Hilfe erhält man mittels: + +---- +brew info weechat +---- + +WeeChat kann durch folgenden Befehl installiert werden: + +---- +brew install weechat --with-python --with-perl +---- + [[lost]] === Ich habe WeeChat gestartet, komme aber nicht mehr weiter - was kann ich tun? @@ -225,7 +241,7 @@ werden sollte: ---- [[terminal_copy_paste]] -=== Wie kann ich einen Text kopieren und einfügen ohne das die Nickliste mit kopiert wird? +=== Wie kann ich einen Text kopieren und einfügen ohne das die Nickliste (Benutzerliste) mit kopiert wird? Ab WeeChat ≥ 1.0 kann ein einfacher Anzeigemodus genutzt werden (Standardtastenbelegung: key[alt-l]). @@ -233,7 +249,7 @@ Hierzu kannst Du ein Terminal nutzen welches Block-Auswahl erlaubt (wie z.B. rxv konsole, gnome-terminal, ...). Im Normalfall erfolgt die Markierung mittels der Tasten key[ctrl-]key[alt-] in Verbindung mit der Auswahl durch die Maus. -Eine weitere Möglichkeit besteht darin die Nickliste am oberen oder unteren +Eine weitere Möglichkeit besteht darin die Benutzerliste am oberen oder unteren Bildschirm zu positionieren: ---- @@ -247,7 +263,7 @@ Ab WeeChat ≥ 1.0 kann ein einfacher Anzeigemodus genutzt werden (Standardtaste WeeChat stellt standardmäßig die Uhrzeit als auch einen Präfix in jeder Zeile dar. Optional können zusätzlich auch Bars im Chatfenster dargestellt -werden. Man kann die Nickliste z.B. am oberen Rand darstellen lassen und +werden. Man kann die Benutzerliste z.B. am oberen Rand darstellen lassen und die Ausrichtung der Nicknamen entfernen: ---- @@ -658,7 +674,7 @@ der Voice Modus aufgeführt sein muss): ---- [[color_away_nicks]] -=== Wie kann ich Nicks in der Nickliste anzeigen lassen die abwesend sind? +=== Wie kann ich Nicks in der Benutzerliste anzeigen lassen die abwesend sind? Dazu weist man der Option 'irc.server_default.away_check' ein Zeitintervall zu, in welchen Abständen eine Überprüfung stattfinden soll. Die Angabe des @@ -683,11 +699,24 @@ Für Weechat ≤ 0.3.3, lauten die Optionen 'irc.network.away_check' und 'irc.network.away_check_max_nicks'. [[highlight_notification]] -=== Wie kann ich mich darüber informieren lassen falls mich jemand in einem Channel highlighted +=== Wie kann ich mich benachrichtigen lassen, falls mich jemand in einem Channel highlighted + +Seit WeeChat ≥ 1.0 gibt es standardmäßig einen Trigger, "beep", der an das Terminal +ein 'BEL' Signal schickt, sobald man eine highlight oder private Nachricht erhält. +Nun muss man lediglich im Terminalprogramm (oder einem Multiplexer wie screen/tmux) +einstellen welcher Befehl ausgeführt werden soll, sobald das Terminal das 'BEL' +Signal erhält. + +Oder man führt im Trigger "beep" direkt einen Befehl aus: + +---- +/set trigger.trigger.beep.command "/print -beep;/exec -bg /Pfad/zum/Befehl Argumente" +---- -Dazu kann man ein Skript nutzen wie z.B. 'beep.pl' oder 'launcher.pl'. +Nutzt man eine ältere Version von WeeChat, können z.B. die Skripten 'beep.pl' oder 'launcher.pl' +genutzt werden. -Beim Skript 'launcher.pl' müssen noch die Befehle angepasst werden: +Beim 'launcher.pl' Skript müssen noch die Befehle angepasst werden: ---- /set plugins.var.perl.launcher.signal.weechat_highlight "/Pfad/zum/Befehl Argumente" diff --git a/doc/de/weechat_user.de.asciidoc b/doc/de/weechat_user.de.asciidoc index 35f8bdfeb..9c172a5d9 100644 --- a/doc/de/weechat_user.de.asciidoc +++ b/doc/de/weechat_user.de.asciidoc @@ -43,10 +43,10 @@ Die WeeChat Homepage findet man unter: http://weechat.org/ Um WeeChat zu installieren wird folgendes benötigt: -* ein laufendes GNU/Linux System (mit Kompilierungswerkzeugen für Quellpakete), +* ein lauffähiges GNU/Linux System (mit Kompilierungswerkzeugen für Quellpakete), oder ein kompatibles OS -* 'root' Privilegien (um WeeChat im Systemverzeichnis zu installieren) -* ncurses Bibliothek +* 'root' Privilegien (um WeeChat in das Systemverzeichnis zu installieren) +* einige Bibliotheken (siehe <<dependencies,Abhängigkeiten>>). [[install]] == Installation @@ -75,28 +75,34 @@ wie Pakete installiert werden können. WeeChat kann mittels cmake oder autotools kompiliert werden (cmake sollte dabei die bevorzugte Methode sein). +[NOTE] +Unter OS X kann http://brew.sh/[Homebrew] verwendet werden: +`brew install weechat --with-python --with-perl` +(für Hilfe: `brew info weechat`). + [[dependencies]] ==== Abhängigkeiten -folgende Tabelle beschreibt welche Pakete zwingend notwendig sind um WeeChat zu kompilieren und +folgende Tabelle beschreibt, welche Pakete zwingend notwendig sind um WeeChat zu kompilieren und welche Pakete optional genutzt werden können. [width="100%",cols="5,^3,^3,.^13",options="header"] |=== | Paket ^(1)^ | Version | benötigt | Funktion | cmake | | *ja* | Zum kompilieren (autotools ist möglich. cmake wird aber empfohlen) +| pkg-config | | *ja* | entdeckt installierte Bibliotheken | libncursesw5-dev ^(2)^ | | *ja* | Ncurses Oberfläche | libcurl4-gnutls-dev | | *ja* | URL Transfer | zlib1g-dev | | *ja* | Kompression für Pakete, die mittels Relay- (WeeChat Protokoll), Script-Erweiterung übertragen werden -| libgcrypt11-dev | | *ja* | Geschützte Daten, IRC SASL Authentifikation (DH-BLOWFISH/DH-AES), Skript-Erweiterung -| libgnutls-dev | ≥ 2.2.0 | | SSL Verbindung zu einem IRC Server, Unterstützung von SSL in der Relay-Erweiterung +| libgcrypt20-dev | | *ja* | Geschützte Daten, IRC SASL Authentifikation (DH-BLOWFISH/DH-AES), Skript-Erweiterung +| libgnutls28-dev | ≥ 2.2.0 | | SSL Verbindung zu einem IRC Server, Unterstützung von SSL in der Relay-Erweiterung | gettext | | | Internationalisierung (Übersetzung der Mitteilungen; Hauptsprache ist englisch) | ca-certificates | | | Zertifikate für SSL Verbindungen | libaspell-dev oder libenchant-dev | | | Aspell Erweiterung | python-dev | ≥ 2.5 ^(3)^ | | Python Erweiterung | libperl-dev | | | Perl Erweiterung -| ruby1.9.1-dev | ≥ 1.8 | | Ruby Erweiterung -| liblua5.1-0-dev | | | Lua Erweiterung +| ruby2.1-dev | ≥ 1.8 | | Ruby Erweiterung +| liblua5.2-dev | | | Lua Erweiterung | tcl-dev | ≥ 8.5 | | Tcl Erweiterung | guile-2.0-dev | ≥ 2.0 | | Guile (scheme) Erweiterung | asciidoc | ≥ 8.5.0 | | Zum Erstellen der man page und der Dokumentation @@ -501,36 +507,51 @@ Der Bildschirm setzt sich aus folgenden Bereichen zusammen: Die 'status'-Bar besitzt als Standardeinträge: -[width="100%",cols="^3,^3,10",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Item | Beispiel | Beschreibung | time | `[12:55]` | Uhrzeit -| buffer_count | `[6]` | Anzahl der geöffneten Buffer +| buffer_last_number | `[6]` | Nummer des letzten Buffers | buffer_plugin | `[irc/freenode]` | Erweiterung des aktuellen Buffers (IRC Erweiterung setzt den IRC Servername für den Buffer) | buffer_number | `3` | Aktuelle Nummer des Buffers | buffer_name | `#test` | Name des aktuellen Buffers | buffer_modes | `+n` | IRC Channel-Modi -| buffer_nicklist_count | `{4}` | Anzahl der Nicks in Nickliste +| buffer_nicklist_count | `{4}` | Anzahl der Nicks in Benutzerliste | buffer_zoom | ! | `!` bedeutet, dass ein zusammengefügter Buffer gezoomed (nur dieser Buffer wird angezeigt) wird. | buffer_filter | `*` | Filteranzeige: `*` bedeutet das Zeilen gefiltert (unterdrückt) wurden. Ein leerer Eintrag zeigt an dass alle Zeilen dargestellt werden +| scroll | `-MORE(50)-` | Scroll Indikator, zeigt an wie viele Zeilen unterhalb der zur Zeit dargestellten Zeile vorhanden sind | lag | `[Lag: 2.5]` | Verzögerungsanzeige, in Sekunden (keine Anzeige falls Verzögerung gering) | hotlist | `[H: 4:#abc(2,5), 6]` | Liste der Buffer mit Aktivität (ungelesene Nachrichten) (für das Beispiel: 2 Highlights und 5 ungelesene Nachrichten im Channel '#abc', eine ungelesene Nachricht in Buffer #6) | completion | `abc(2) def(5)` | Liste von Wörtern für Vervollständigung, die Zahl zeigt an wie viele Varianten möglich sind -| scroll | `-MORE(50)-` | Scroll Indikator, zeigt an wie viele Zeilen unterhalb der zur Zeit dargestellten Zeile vorhanden sind |=== In der 'input' Bar lautet die Standardeinstellung: -[width="100%",cols="^3,^6,8",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Item | Beispiel | Beschreibung -| input_paste | `[Paste 7 lines ? [ctrl-Y] Ja [ctrl-N] Nein]` | Nachfrage ob sieben Zeilen eingefügt werden sollen | input_prompt | `[@Flashy(i)]` | Input prompt, für irc: Nick und Modi (Modus "+i" bedeutet auf freenode, unsichtbar) | away | `(away)` | Abwesenheitsanzeige | input_search | `[Search (~ str,msg)]` | Suchindikatoren ("`~`": Groß-und Kleinschreibung ignorieren, "`==`": Groß-und Kleinschreibung berücksichtigen, "`str`": einfache Textsuche, "`regex`": suche mit regulären Ausdrücken, "`msg`": Suche in Nachrichten, "`pre`": Suche in Präfix, "`pre\|msg`": Suche in Präfix und Nachrichten) +| input_paste | `[Paste 7 lines ? [ctrl-Y] Ja [ctrl-N] Nein]` | Nachfrage ob sieben Zeilen eingefügt werden sollen | input_text | `hi peter!` | Text der eingegeben wird |=== +andere Items die man nutzen kann (die aber nicht standardmäßig in einer Bar aktiviert sind): + +[width="100%",cols="^3,^4,10",options="header"] +|=== +| Item | Beispiel | Beschreibung +| aspell_dict | `de,en` | zeigt an welche Wörterbücher für die Rechtschreibung im aktuellen Buffer genutzt werden +| aspell_suggest | `Glück,Glocke,Block`| Vorschläge für ein falsch geschriebenes Wort +| buffer_count | `10` | absolute Anzahl an geöffneten Buffern +| buffer_short_name | `#test` | Kurzname des aktuellen Buffers +| irc_channel | `#test` | aktueller IRC Channelname +| irc_nick_modes | `@` | IRC Modi für den eigenen Nick +| mouse_status | `M` | Status der Maus (keine Anzeige, falls Maus deaktiviert) +| window_number | `2` | Nummer des aktuellen Fensters +|=== + [[buffers_and_windows]] === Buffer und Fenster @@ -750,7 +771,7 @@ Dies ist für root-Bars sinnvoll, um gezielt ein Item eines bestimmten Buffers anzuzeigen, welcher nicht im aktuellen Fenster oder überhaupt nicht sichtbar ist. -Beispiel: Nickliste von bitlbee permanent in einer root-Bar darstellen (die Bar +Beispiel: Benutzerliste von bitlbee permanent in einer root-Bar darstellen (die Bar heißt hierbei 'bitlist' und der Name des bitlbee Servers 'bitlbee'): ---- @@ -849,7 +870,7 @@ Folgende Zeichenketten sind möglich: * 'active' : das Fenster muss das aktive Fenster sein * 'inactive': das Fenster muss das inaktive Fenster sein * 'nicklist': der Buffer der in einem Fenster dargestellt wird, muss eine - Nickliste anzeigen. + Benutzerliste anzeigen. * ein Ausdruck: wird als boolescher Wert ausgewertet (siehe Befehl <<command_weechat_eval,/eval>>) @@ -871,7 +892,7 @@ darstellt, aber nur wenn das Fenster eine Mindestbreite von > 100 Pixeln aufweis /set weechat.bar.nicklist.conditions "${nicklist} && ${window.win_width} > 100" ---- -Gleiche Bedingungen, aber die Nickliste wird im Buffer '&bitlbee' immer angezeigt +Gleiche Bedingungen, aber die Benutzerliste wird im Buffer '&bitlbee' immer angezeigt (auch wenn das Fenster kleiner als 100 Pixel ist): ---- @@ -1093,10 +1114,10 @@ Befehl festgelegt werden: | key[F8] | zum nächsten Fenster wechseln | `/window +1` | key[F9] | Titel des Buffers nach links verschieben | `/bar scroll title * -30%` | key[F10] | Titel des Buffers nach rechts verschieben | `/bar scroll title * +30%` -| key[F11] | Nickliste um eine Seite nach oben blättern | `/bar scroll nicklist * -100%` -| key[F12] | Nickliste um eine Seite nach unten blättern | `/bar scroll nicklist * +100%` -| key[alt-F11] | springt zum Anfang der Nickliste | `/bar scroll nicklist * b` -| key[alt-F12] | springt zum Ende der Nickliste | `/bar scroll nicklist * e` +| key[F11] | Benutzerliste um eine Seite nach oben blättern | `/bar scroll nicklist * -100%` +| key[F12] | Benutzerliste um eine Seite nach unten blättern | `/bar scroll nicklist * +100%` +| key[alt-F11] | springt zum Anfang der Benutzerliste | `/bar scroll nicklist * b` +| key[alt-F12] | springt zum Ende der Benutzerliste | `/bar scroll nicklist * e` | key[alt-a] | wechselt zum nächsten Buffer mit Aktivität (nach Priorität: highlight, Nachricht, ...) | `/input jump_smart` | key[alt-h] | löscht Hotliste (Aktivitätsanzeige für die Buffer) | `/input hotlist_clear` | key[alt-j,alt-f] | wechselt zum ersten Buffer | `/buffer -` @@ -1162,11 +1183,11 @@ Diese Tasten werden im Kontext "cursor" verwendet (Cursor kann frei auf dem Bild | key[m] | Chat | quotet Nachricht | `hsignal:chat_quote_message;/cursor stop` | key[q] | Chat | quotet prefix + Nachricht | `hsignal:chat_quote_prefix_message;/cursor stop` | key[Q] | Chat | quotet Uhrzeit + prefix + Nachricht | `hsignal:chat_quote_time_prefix_message;/cursor stop` -| key[b] | Nickliste | verbannt nick (Ban) | `/window ${_window_number};/ban ${nick}` -| key[k] | Nickliste | kickt nick | `/window ${_window_number};/kick ${nick}` -| key[K] | Nickliste | kickt und verbannt nick | `/window ${_window_number};/kickban ${nick}` -| key[q] | Nickliste | öffnet privaten Chat mit Nick | `/window ${_window_number};/query ${nick};/cursor stop` -| key[w] | Nickliste | führt einen whois für Nick aus | `/window ${_window_number};/whois ${nick}` +| key[b] | Benutzerliste | verbannt nick (Ban) | `/window ${_window_number};/ban ${nick}` +| key[k] | Benutzerliste | kickt nick | `/window ${_window_number};/kick ${nick}` +| key[K] | Benutzerliste | kickt und verbannt nick | `/window ${_window_number};/kickban ${nick}` +| key[q] | Benutzerliste | öffnet privaten Chat mit Nick | `/window ${_window_number};/query ${nick};/cursor stop` +| key[w] | Benutzerliste | führt einen whois für Nick aus | `/window ${_window_number};/whois ${nick}` | key[Enter] .3+| - .3+| beendet den Cursor-Modus .3+| `/cursor stop` | key[ctrl-j] | key[ctrl-m] @@ -1193,15 +1214,15 @@ Diese Tasten werden im Kontext "mouse" verwendet, wenn eine Mausfunktion genutzt | ⇓ | - | chat (script buffer) | fünf Zeilen nach unten blättern, im Script-Buffer | `/script down 5` | key[ctrl-]⇑ | - | chat | horizontal, nach links scrollen | `/window scroll_horiz -window ${_window_number} -10%` | key[ctrl-]⇓ | - | chat | horizontal, nach rechts scrollen | `/window scroll_horiz -window ${_window_number} +10%` -| ◾◽◽ | hoch | Nickliste | Nickliste um eine Seite nach oben blättern | `/bar scroll nicklist ${_window_number} -100%` -| ◾◽◽ | runter | Nickliste | Nickliste um eine Seite nach unten blättern | `/bar scroll nicklist ${_window_number} +100%` -| ◾◽◽ | hoch(lang) | Nickliste | springt zum Anfang der Nickliste | `/bar scroll nicklist ${_window_number} b` -| ◾◽◽ | runter(lang) | Nickliste | springt zum Ende der Nickliste | `/bar scroll nicklist ${_window_number} e` -| ◾◽◽ | - | Nickliste | öffnet privaten Chat mit Nick | `/window ${_window_number};/query ${nick}` -| ◽◽◾ | - | Nickliste | führt einen whois für Nick aus | `/window ${_window_number};/whois ${nick}` -| ◾◽◽ | links | Nickliste | kickt Nick | `/window ${_window_number};/kick ${nick}` -| ◾◽◽ | links(lang) | Nickliste | kickt und verbannt Nick | `/window ${_window_number};/kickban ${nick}` -| ◽◽◾ | links | Nickliste | verbannt Nick | `/window ${_window_number};/ban ${nick}` +| ◾◽◽ | hoch | Benutzerliste | Benutzerliste um eine Seite nach oben blättern | `/bar scroll nicklist ${_window_number} -100%` +| ◾◽◽ | runter | Benutzerliste | Benutzerliste um eine Seite nach unten blättern | `/bar scroll nicklist ${_window_number} +100%` +| ◾◽◽ | hoch(lang) | Benutzerliste | springt zum Anfang der Benutzerliste | `/bar scroll nicklist ${_window_number} b` +| ◾◽◽ | runter(lang) | Benutzerliste | springt zum Ende der Benutzerliste | `/bar scroll nicklist ${_window_number} e` +| ◾◽◽ | - | Benutzerliste | öffnet privaten Chat mit Nick | `/window ${_window_number};/query ${nick}` +| ◽◽◾ | - | Benutzerliste | führt einen whois für Nick aus | `/window ${_window_number};/whois ${nick}` +| ◾◽◽ | links | Benutzerliste | kickt Nick | `/window ${_window_number};/kick ${nick}` +| ◾◽◽ | links(lang) | Benutzerliste | kickt und verbannt Nick | `/window ${_window_number};/kickban ${nick}` +| ◽◽◾ | links | Benutzerliste | verbannt Nick | `/window ${_window_number};/ban ${nick}` | ◽◽◾ | - | Input | fängt ein Mausereignis und fügt dieses in die Befehlszeile ein | `/input grab_mouse_area` | ⇑ | - | jede Bar | blättert Bar um 20% nach oben | `/bar scroll ${_bar_name} ${_window_number} -20%` | ⇓ | - | jede Bar | blättert Bar um 20% nach unten | `/bar scroll ${_bar_name} ${_window_number} +20%` @@ -1417,7 +1438,7 @@ Beispiel: Im Buffer wird "Hallo an alle!" ausgegeben. Dabei wird "Hallo" in fett und "an alle" rot und unterstrichen dargestellt. ---- -^Cc12^CbHallo ^Cb^Cc04^Cuan alle^Cu^Cc! +^Cc12^CbHallo ^Cb^Cc04^C_an alle^C_^Cc! ---- [NOTE] @@ -3128,15 +3149,17 @@ oder mehrere identische Zeichen). Matching groups können in "replace" genutzt werden: -* `$0` bis `$99`: `$0` um alles zu matchen, `$1` bis `$99` um Gruppen zu fangen -* `$+`: der letzte match (mit der höchsten Nummer) -* `$.cN`: match "N" mit allen Zeichen die durch "c" ersetzt wurden (Beispiel: `$.*2` ist die group - #2 mit allen Zeichen die durch `*` ersetzt wurden). +* `${re:0}` bis `${re:99}`: `${re:0}` um alles zu matchen, `${re:1}` bis + `${re:99}` um Gruppen zu fangen +* `${re:+}`: der letzte match (mit der höchsten Nummer) +* `${hide:c,${re:N}}`: match "N" mit allen Zeichen die durch "c" ersetzt wurden + (Beispiel: `${hide:*,${re:2}}` ist die group #2 mit allen Zeichen die durch + `*` ersetzt wurden). Beispiel: nutzte Fettschrift zwischen dem Zeichen "*": ---- -/\*(\S+)\*/*${color:bold}$1${color:-bold}*/ +/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/ ---- Beispiel: der Standard-Trigger 'server_pass' nutzt folgenden regulären Ausdruck @@ -3144,7 +3167,7 @@ um ein Passwort in den Befehlen `/server` und `/connect` zu verbergen (die einzelnen Zeichen des Passwortes werden durch `*` ersetzt): ---- -==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5 +==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5} ---- [NOTE] @@ -3402,7 +3425,7 @@ Die Bedingung `${info:term_width}` überprüft die Breite des Terminal (zusätzl auch `${info:term_height}` genutzt werden). In obigem Beispiel wird die Nicklist versteckt, sobald das Terminal verkleinert wird. -Die Nickliste wird wieder angezeigt, sobald die Breite des Terminals größer oder +Die Benutzerliste wird wieder angezeigt, sobald die Breite des Terminals größer oder gleich 100 Zeichen ist. [[trigger_example_config_save]] @@ -3459,18 +3482,15 @@ include::autogen/user/xfer_commands.asciidoc[] [[support]] == Unterstützung -// TRANSLATION MISSING -Before asking for support, be sure you've read documentation and FAQ provided -with WeeChat. +Bevor man nach Unterstützung fragt sollte man sicherstellen, dass man sowohl die +Dokumentation als auch die FAQ gelesen hat, welche mit WeeChat bereitgestellt wird. -// TRANSLATION MISSING -For support with IRC, on server 'chat.freenode.net': +Unterstützung im IRC findet man auf dem Server 'chat.freenode.net': -* official channels (with developers): -** '#weechat' (English) -** '#weechat-fr' (French) -* non-official channels: -** '#weechat-de' (German) +* offizielle Channel (Entwickler vertreten): +** '#weechat' (englisch) +** '#weechat-fr' (französisch) +* kein offizieller Channel: +** '#weechat-de' (deutsch) -// TRANSLATION MISSING -For other ways of support, see: http://weechat.org/dev/support +Weitere Möglichkeiten, um mit den Entwicklern in Kontakt zu treten, siehe: http://weechat.org/dev/support diff --git a/doc/en/autogen/plugin_api/completions.asciidoc b/doc/en/autogen/plugin_api/completions.asciidoc index a841c5e0d..d06f93f47 100644 --- a/doc/en/autogen/plugin_api/completions.asciidoc +++ b/doc/en/autogen/plugin_api/completions.asciidoc @@ -86,6 +86,8 @@ | trigger | trigger_names | triggers +| trigger | trigger_names_default | default triggers + | trigger | trigger_option_value | value of a trigger option | trigger | trigger_options | options for triggers diff --git a/doc/en/autogen/plugin_api/hdata.asciidoc b/doc/en/autogen/plugin_api/hdata.asciidoc index 410d7ee79..8b82d23f9 100644 --- a/doc/en/autogen/plugin_api/hdata.asciidoc +++ b/doc/en/autogen/plugin_api/hdata.asciidoc @@ -586,21 +586,13 @@ *** 'direction' (integer) *** 'add_space' (integer) *** 'force_partial_completion' (integer) -*** 'completion_list' (pointer) +*** 'list' (pointer) *** 'word_found' (string) *** 'word_found_is_nick' (integer) *** 'position_replace' (integer) *** 'diff_size' (integer) *** 'diff_length' (integer) -*** 'partial_completion_list' (pointer, hdata: "completion_partial") -*** 'last_partial_completion' (pointer, hdata: "completion_partial") -* 'completion_partial': structure with partial completion -** plugin: weechat -** variables: -*** 'word' (string) -*** 'count' (integer) -*** 'prev_item' (pointer, hdata: "completion_partial") -*** 'next_item' (pointer, hdata: "completion_partial") +*** 'partial_list' (pointer) * 'config_file': config file ** plugin: weechat ** variables: diff --git a/doc/en/autogen/user/irc_commands.asciidoc b/doc/en/autogen/user/irc_commands.asciidoc index 739ecd474..2c5e91026 100644 --- a/doc/en/autogen/user/irc_commands.asciidoc +++ b/doc/en/autogen/user/irc_commands.asciidoc @@ -89,8 +89,9 @@ Without argument, this command display ban list for current channel. server: server name, which can be: - internal server name (created by /server add, recommended usage) - - hostname/port or IP/port (this will create a TEMPORARY server), port is 6667 by default + - hostname/port or IP/port, port is 6667 by default - URL with format: irc[6][s]://[nickname[:password]@]irc.example.org[:port][/#channel1][,#channel2[...]] + Note: for an address/IP/URL, a temporary server is created (NOT SAVED), see /help irc.look.temporary_servers option: set option for server (for boolean option, value can be omitted) nooption: set boolean option to 'off' (for example: -nossl) -all: connect to all servers defined in configuration @@ -631,7 +632,7 @@ channel: channel name [command]*`samode`* change mode on channel, without having operator status:: ---- -/samode <channel> <mode> +/samode [<channel>] <mode> channel: channel name mode: mode for channel diff --git a/doc/en/autogen/user/irc_options.asciidoc b/doc/en/autogen/user/irc_options.asciidoc index f24513b6f..5db253cff 100644 --- a/doc/en/autogen/user/irc_options.asciidoc +++ b/doc/en/autogen/user/irc_options.asciidoc @@ -343,6 +343,11 @@ ** type: boolean ** values: on, off (default value: `on`) +* [[option_irc.look.temporary_servers]] *irc.look.temporary_servers* +** description: `enable creation of temporary servers with command /connect` +** type: boolean +** values: on, off (default value: `off`) + * [[option_irc.look.topic_strip_colors]] *irc.look.topic_strip_colors* ** description: `strip colors in topic (used only when displaying buffer title)` ** type: boolean @@ -479,7 +484,7 @@ ** values: 0 .. 1000000 (default value: `25`) * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** description: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, multi-prefix, server-time, userhost-in-names, (example: "away-notify,multi-prefix")` +** description: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, extended-join, multi-prefix, server-time, userhost-in-names (example: "away-notify,multi-prefix")` ** type: string ** values: any string (default value: `""`) @@ -591,7 +596,7 @@ * [[option_irc.server_default.ssl_priorities]] *irc.server_default.ssl_priorities* ** description: `string with priorities for gnutls (for syntax, see documentation of function gnutls_priority_init in gnutls manual, common strings are: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` ** type: string -** values: any string (default value: `"NORMAL"`) +** values: any string (default value: `"NORMAL:-VERS-SSL3.0"`) * [[option_irc.server_default.ssl_verify]] *irc.server_default.ssl_verify* ** description: `check that the SSL connection is fully trusted` diff --git a/doc/en/autogen/user/relay_commands.asciidoc b/doc/en/autogen/user/relay_commands.asciidoc index 645989442..da5b8215d 100644 --- a/doc/en/autogen/user/relay_commands.asciidoc +++ b/doc/en/autogen/user/relay_commands.asciidoc @@ -3,25 +3,33 @@ ---- /relay list|listfull|listrelay - add [ipv4.][ipv6.][ssl.]<protocol.name> <port> - del [ipv4.][ipv6.][ssl.]<protocol.name> + add <name> <port> + del|stop|restart <name> raw sslcertkey list: list relay clients (only active relays) listfull: list relay clients (verbose, all relays) listrelay: list relays (name and port) - add: add relay for a protocol + name - del: remove relay for a protocol + name + add: add a relay (listen on a port) + del: remove a relay (clients remain connected) + stop: close the server socket (clients remain connected) + restart: close the server socket and listen again on port (clients remain connected) + name: relay name (see format below) + port: port used for relay + raw: open buffer with raw Relay data + sslcertkey: set SSL certificate/key using path in option relay.network.ssl_cert_key + +Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name> ipv4: force use of IPv4 ipv6: force use of IPv6 ssl: enable SSL protocol.name: protocol and name to relay: - protocol "irc": name is the server to share (optional, if not given, the server name must be sent by client in command "PASS", with format: "PASS server:password") - protocol "weechat" (name is not used) - port: port used for relay - raw: open buffer with raw Relay data - sslcertkey: set SSL certificate/key using path in option relay.network.ssl_cert_key + +The "irc" protocol allows any IRC client (including WeeChat itself) to connect on the port. +The "weechat" protocol allows a remote interface to connect on the port, see the list here: http://weechat.org/download/ Without argument, this command opens buffer with list of relay clients. diff --git a/doc/en/autogen/user/relay_options.asciidoc b/doc/en/autogen/user/relay_options.asciidoc index 70bfe3d3f..75d37b3e5 100644 --- a/doc/en/autogen/user/relay_options.asciidoc +++ b/doc/en/autogen/user/relay_options.asciidoc @@ -59,7 +59,7 @@ ** values: on, off (default value: `on`) * [[option_relay.irc.backlog_tags]] *relay.irc.backlog_tags* -** description: `tags of messages which are displayed in backlog per IRC channel (supported tags: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = all supported tags` +** description: `comma-separated list of messages tags which are displayed in backlog per IRC channel (supported tags: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = all supported tags` ** type: string ** values: any string (default value: `"irc_privmsg"`) @@ -118,6 +118,11 @@ ** type: string ** values: any string (default value: `"%h/ssl/relay.pem"`) +* [[option_relay.network.ssl_priorities]] *relay.network.ssl_priorities* +** description: `string with priorities for gnutls (for syntax, see documentation of function gnutls_priority_init in gnutls manual, common strings are: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` +** type: string +** values: any string (default value: `"NORMAL:-VERS-SSL3.0"`) + * [[option_relay.network.websocket_allowed_origins]] *relay.network.websocket_allowed_origins* ** description: `POSIX extended regular expression with origins allowed in websockets (case insensitive, use "(?-i)" at beginning to make it case sensitive), example: "^http://(www\.)?example\.(com|org)"` ** type: string diff --git a/doc/en/autogen/user/trigger_commands.asciidoc b/doc/en/autogen/user/trigger_commands.asciidoc index 5f3c36ac2..8624d9843 100644 --- a/doc/en/autogen/user/trigger_commands.asciidoc +++ b/doc/en/autogen/user/trigger_commands.asciidoc @@ -12,6 +12,7 @@ restart <name>|-all [<name>...] show <name> del <name>|-all [<name>...] + restore <name> [<name>...] default -yes monitor [<filter>] @@ -54,7 +55,8 @@ return_code: return code in callback (ok (default), ok_eat, error) show: show detailed info on a trigger (with some stats) del: delete a trigger -all: do action on all triggers - default: restore default triggers + restore: restore trigger(s) with the default values (works only for default triggers) + default: delete all triggers and restore default ones monitor: open the trigger monitor buffer, with optional filter: filter: filter hooks/triggers to display (a hook must start with "@", for example "@signal"), many filters can be separated by commas; wildcard "*" is allowed in each trigger name @@ -66,7 +68,7 @@ When a trigger callback is called, following actions are performed, in this orde Examples (you can also look at default triggers with /trigger listdefault): add text attributes *bold*, _underline_ and /italic/ (only in user messages): - /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}/" + /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/" hide nicklist bar on small terminals: /trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist" /trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist" diff --git a/doc/en/autogen/user/weechat_commands.asciidoc b/doc/en/autogen/user/weechat_commands.asciidoc index b987f5dac..0cab07924 100644 --- a/doc/en/autogen/user/weechat_commands.asciidoc +++ b/doc/en/autogen/user/weechat_commands.asciidoc @@ -260,11 +260,12 @@ To force a string comparison, add double quotes around each expression, for exam Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: 1. a string with escaped chars (format: "esc:xxx" or "\xxx") - 2. a color (format: "color:xxx") - 3. an info (format: "info:name,arguments", arguments are optional) - 4. an option (format: "file.section.option") - 5. a local variable in buffer - 6. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. + 2. a string with chars to hide (format: "hide:char,string") + 3. a color (format: "color:xxx") + 4. an info (format: "info:name,arguments", arguments are optional) + 5. an option (format: "file.section.option") + 6. a local variable in buffer + 7. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. Format for hdata can be one of following: hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed) hdata[list].var1.var2...: start with a hdata using a list, for example: @@ -273,23 +274,24 @@ Format for hdata can be one of following: For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". Examples (simple strings): - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${\t} ==> <tab> + /eval -n ${hide:-,${relay.network.password}} ==> -------- Examples (conditions): - /eval -n -c ${window.buffer.number} > 2 ==> 0 - /eval -n -c ${window.win_width} > 100 ==> 1 - /eval -n -c (8 > 12) || (5 > 2) ==> 1 - /eval -n -c (8 > 12) && (5 > 2) ==> 0 - /eval -n -c abcd =~ ^ABC ==> 1 - /eval -n -c abcd =~ (?-i)^ABC ==> 0 - /eval -n -c abcd =~ (?-i)^abc ==> 1 - /eval -n -c abcd !~ abc ==> 0 + /eval -n -c ${window.buffer.number} > 2 ==> 0 + /eval -n -c ${window.win_width} > 100 ==> 1 + /eval -n -c (8 > 12) || (5 > 2) ==> 1 + /eval -n -c (8 > 12) && (5 > 2) ==> 0 + /eval -n -c abcd =~ ^ABC ==> 1 + /eval -n -c abcd =~ (?-i)^ABC ==> 0 + /eval -n -c abcd =~ (?-i)^abc ==> 1 + /eval -n -c abcd !~ abc ==> 0 ---- [[command_weechat_filter]] @@ -312,7 +314,7 @@ disable: disable filters del: delete a filter -all: delete all filters buffer: comma separated list of buffers where filter is active: - - this is full name including plugin (example: "irc.freenode.#weechat") + - this is full name including plugin (example: "irc.freenode.#weechat" or "irc.server.freenode") - "*" means all buffers - a name starting with '!' is excluded - wildcard "*" is allowed diff --git a/doc/en/autogen/user/weechat_options.asciidoc b/doc/en/autogen/user/weechat_options.asciidoc index fac7a0127..ff994a72d 100644 --- a/doc/en/autogen/user/weechat_options.asciidoc +++ b/doc/en/autogen/user/weechat_options.asciidoc @@ -69,17 +69,17 @@ ** values: any string (default value: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) * [[option_weechat.color.chat_nick_offline]] *weechat.color.chat_nick_offline* -** description: `text color for offline nick (not in nicklist any more)` +** description: `text color for offline nick (not in nicklist any more); this color is used only if option weechat.look.color_nick_offline is enabled` ** type: color ** values: 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 (default value: `default`) * [[option_weechat.color.chat_nick_offline_highlight]] *weechat.color.chat_nick_offline_highlight* -** description: `text color for offline nick with highlight` +** description: `text color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** type: color ** values: 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 (default value: `default`) * [[option_weechat.color.chat_nick_offline_highlight_bg]] *weechat.color.chat_nick_offline_highlight_bg* -** description: `background color for offline nick with highlight` +** description: `background color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** type: color ** values: 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 (default value: `blue`) @@ -283,6 +283,11 @@ ** type: color ** values: 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 (default value: `yellow`) +* [[option_weechat.color.status_mouse]] *weechat.color.status_mouse* +** description: `text color for mouse indicator in status bar` +** type: color +** values: 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 (default value: `green`) + * [[option_weechat.color.status_name]] *weechat.color.status_name* ** description: `text color for current buffer name in status bar` ** type: color @@ -313,6 +318,11 @@ ** type: boolean ** values: on, off (default value: `on`) +* [[option_weechat.completion.command_inline]] *weechat.completion.command_inline* +** description: `if enabled, the commands inside command line are completed (the command at beginning of line has higher priority and is used first); note: when this option is enabled, there is no more automatic completion of paths beginning with '/' (outside commands arguments)` +** type: boolean +** values: on, off (default value: `on`) + * [[option_weechat.completion.default_template]] *weechat.completion.default_template* ** description: `default completion template (please see documentation for template codes and values: plugin API reference, function "weechat_hook_command")` ** type: string @@ -518,6 +528,11 @@ ** type: string ** values: any string (default value: `""`) +* [[option_weechat.look.command_incomplete]] *weechat.look.command_incomplete* +** description: `if set, incomplete and unambiguous commands are allowed, for example /he for /help` +** type: boolean +** values: on, off (default value: `off`) + * [[option_weechat.look.confirm_quit]] *weechat.look.confirm_quit* ** description: `if set, /quit command must be confirmed with extra argument "-yes" (see /help quit)` ** type: boolean @@ -663,6 +678,11 @@ ** type: string ** values: any string (default value: `"!"`) +* [[option_weechat.look.item_mouse_status]] *weechat.look.item_mouse_status* +** description: `string used to show if mouse is enabled (bar item "mouse_status")` +** type: string +** values: any string (default value: `"M"`) + * [[option_weechat.look.item_time_format]] *weechat.look.item_time_format* ** description: `time format for "time" bar item (see man strftime for date/time specifiers)` ** type: string diff --git a/doc/en/weechat_dev.en.asciidoc b/doc/en/weechat_dev.en.asciidoc index 6494ba137..2422a9261 100644 --- a/doc/en/weechat_dev.en.asciidoc +++ b/doc/en/weechat_dev.en.asciidoc @@ -92,6 +92,7 @@ WeeChat "core" is located in following directories: | Path/file | Description | core/ | Core functions: entry point, internal structures | weechat.c | Main functions: command line options, startup +| wee-arraylist.c | Array lists | wee-backtrace.c | Display a backtrace after a crash | wee-command.c | WeeChat core commands | wee-completion.c | Default completions @@ -302,7 +303,7 @@ WeeChat "core" is located in following directories: | test-string.cpp | Tests: strings | test-url.cpp | Tests: URLs | test-utf8.cpp | Tests: UTF-8 -| test-util.cpp | Tests: util functions +| test-util.cpp | Tests: utility functions |=== [[documentation_translations]] @@ -944,7 +945,7 @@ server->hook_timer_sasl = weechat_hook_timer (timeout * 1000, Git repository is at this URL: https://github.com/weechat/weechat Any patch for bug or new feature must be done on master branch, preferred way is -a Github pull request. A patch can also be sent by e-mail (made with `git diff` +a GitHub pull request. A patch can also be sent by e-mail (made with `git diff` or `git format-patch`). Format of commit message is the following (to close a GitHub issue): diff --git a/doc/en/weechat_faq.en.asciidoc b/doc/en/weechat_faq.en.asciidoc index e5b9dbe2c..45a2c48e3 100644 --- a/doc/en/weechat_faq.en.asciidoc +++ b/doc/en/weechat_faq.en.asciidoc @@ -51,6 +51,21 @@ This package is built almost every day using git repository. Note that this package may not correspond exactly to git base and that it's less convenient than git cloning for installing updates. +[[compile_osx]] +=== How can I install WeeChat on OS X? + +It is recommended to use http://brew.sh/[Homebrew], you can get help with: + +---- +brew info weechat +---- + +You can install WeeChat with this command: + +---- +brew install weechat --with-python --with-perl +---- + [[lost]] === I've launched WeeChat, but I'm lost, what can I do? @@ -648,7 +663,18 @@ For WeeChat ≤ 0.3.3, options are 'irc.network.away_check' and [[highlight_notification]] === How can I be warned when someone highlights me on a channel? -You can use a script like 'beep.pl' or 'launcher.pl'. +With WeeChat ≥ 1.0, there is a default trigger "beep" which sends a 'BEL' to +the terminal on a highlight or private message. Thus you can configure your +terminal (or multiplexer like screen/tmux) to run a command or play a sound +when a 'BEL' occurs. + +Or you can add a command in "beep" trigger: + +---- +/set trigger.trigger.beep.command "/print -beep;/exec -bg /path/to/command arguments" +---- + +With an older WeeChat, you can use a script like 'beep.pl' or 'launcher.pl'. For 'launcher.pl', you have to setup command: diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc index 9bc9584d3..60f38f86b 100644 --- a/doc/en/weechat_plugin_api.en.asciidoc +++ b/doc/en/weechat_plugin_api.en.asciidoc @@ -1826,11 +1826,10 @@ str3 = weechat.string_input_for_buffer("//test") # "/test" ==== weechat_string_eval_expression -_WeeChat ≥ 0.4.0, updated in 0.4.2._ +_WeeChat ≥ 0.4.0, updated in 0.4.2 and 1.1._ Evaluate an expression and return result as a string. -Special variables with format `${variable}` are expanded (see command `/eval` in -'WeeChat User's guide'). +Special variables with format `${variable}` are expanded (see table below). [NOTE] Since version 1.0, nested variables are supported, for example: @@ -1848,10 +1847,14 @@ char *weechat_string_eval_expression (const char *expr, Arguments: -* 'expr': the expression to evaluate +* 'expr': the expression to evaluate (see table below) * 'pointers': hashtable with pointers (keys must be string, values must be pointer); pointers "window" and "buffer" are automatically added if they are - not in hashtable (with pointer to current window/buffer) (can be NULL) + not in hashtable (with pointer to current window/buffer) (can be NULL): +** 'regex': pointer to a regular expression ('regex_t' structure) compiled with + WeeChat function <<_weechat_string_regcomp,weechat_string_regcomp>> or + regcomp (see `man regcomp`); this option is similar to 'regex' in hashtable + 'options' (below), but is used for better performance * 'extra_vars': extra variables that will be expanded (can be NULL) * 'options': a hashtable with some options (keys and values must be string) (can be NULL): @@ -1861,26 +1864,118 @@ Arguments: parentheses are used, result is a boolean ("0" or "1") ** 'prefix': prefix before variables to replace (default: "${") ** 'suffix': suffix after variables to replace (default: "}") +** 'regex': a regex used to replace text in 'expr' (which is then not + evaluated) +** 'regex_replace': the replacement text to use with 'regex', to replace + text in 'expr' (the 'regex_replace' is evaluated on each match of 'regex' + against 'expr', until no match is found) Return value: * evaluated expression (must be freed by calling "free" after use), or NULL if problem (invalid expression or not enough memory) +List of variables expanded in expression (by order of priority, from first +expanded to last): + +[width="100%",cols="2,8,3,3",options="header"] +|=== +| Format | Description | Examples | Results + +| `${name}` | Variable `name` from hashtable 'extra_vars' | + `${name}` | `value` + +| `${esc:xxx}` + + `${\xxx}` | String with escaped chars | + `${esc:prefix\tmessage}` + + `${\ua9}` | + `prefix<TAB>message` + + `©` + +| `${hide:x,value}` | + String with hidden chars (all chars in `value` replaced `x`) | + `${hide:*,password}` | + `********` + +| `${re:N}` | + Regex captured group: 0 = whole string matching, 1 to 99 = group captured, + `+` = last group captured | + `${re:1}` | + `test` + +| `${color:name}` | + WeeChat color code (the name of color has optional attributes) | + `${color:red}red text` + + `${color:*214}bold orange text` | + `red text` (in red) + + `bold orange text` (in bold orange) + +| `${info:name}` + + `${indo:name,arguments}` | + Info from WeeChat or a plugin, see function + <<_weechat_info_get,weechat_info_get>> | + `${info:version}` + + `${info:irc_nick_color_name,foo}` | + `1.0` + + `lightblue` + +| `${sec.data.name}` | + Value of the secured data `name` | + `${sec.data.freenode_pass}` | + `my_password` + +| `${file.section.option}` | + Value of the option | + `${weechat.look.buffer_time_format}` | + `%H:%M:%S` + +| `${name}` | + Value of local variable `name` in buffer | + `${nick}` | + `FlashCode` + +| `${hdata.var1.var2...}` + + `${hdata[list].var1.var2...}` | + Hdata value (pointers `window` and `buffer` are set by default with current + window/buffer) | + `${buffer[gui_buffers].full_name}` + + `${window.buffer.number}` | + `core.weechat` + + `1` +|=== + C examples: [source,C] ---- -struct t_hashtable *options = weechat_hashtable_new (8, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); -if (options) - weechat_hashtable_set (options, "type", "condition"); -char *str1 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ -char *str2 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options); /* "1" */ -char *str3 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options); /* "0" */ +/* conditions */ +struct t_hashtable *options1 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options1, "type", "condition"); +char *str1 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options1); /* "1" */ +char *str2 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options1); /* "0" */ + +/* simple expression */ +char *str3 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ + +/* replace with regex */ +struct t_hashtable *options2 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +/* add brackets around URLs */ +weechat_hashtable_set (options2, "regex", "\\w+://\\S+"); +weechat_hashtable_set (options2, "regex_replace", "[ ${re:0} ]"); +char *str4 = weechat_string_eval_expression ("test: http://weechat.org", NULL, NULL, NULL); /* "test: [ http://weechat.org ]" */ + +/* hide passwords */ +weechat_hashtable_set (options2, "regex", "(password=)(\\S+)"); +weechat_hashtable_set (options2, "regex_replace", "${re:1}${hide:*,${re:2}}"); +char *str5 = weechat_string_eval_expression ("password=abc password=def", NULL, NULL, NULL); /* "password=*** password=***" */ ---- Script (Python): @@ -1891,9 +1986,27 @@ Script (Python): str = weechat.string_eval_expression(expr, pointers, extra_vars, options) # examples -str1 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" -str2 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" -str3 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" + +# conditions +str1 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" +str2 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" + +# simple expression +str3 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" + +# replace with regex: add brackets around URLs +options = { + "regex": "\\w+://\\S+", + "regex_replace": "[ ${re:0} ]", +} +str4 = weechat.string_eval_expression("test: http://weechat.org", {}, {}, options) # "test: [ http://weechat.org ]" + +# replace with regex: hide passwords +options = { + "regex": "(password=)(\\S+)", + "regex_replace": "${re:1}${hide:*,${re:2}}", +} +str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, options) # "password=*** password=***" ---- [[utf-8]] @@ -2668,13 +2781,15 @@ This function is not available in scripting API. ==== weechat_util_timeval_diff -Return difference (in milliseconds) between two "timeval" structures. +_Updated in 1.1._ + +Return difference (in microseconds) between two "timeval" structures. Prototype: [source,C] ---- -long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); +long long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); ---- Arguments: @@ -2684,13 +2799,16 @@ Arguments: Return value: -* difference in milliseconds +* difference in microseconds + +[NOTE] +With WeeChat ≤ 1.0, the returned value was in milliseconds. C example: [source,C] ---- -long diff = weechat_util_timeval_diff (&tv1, &tv2); +long long diff = weechat_util_timeval_diff (&tv1, &tv2); ---- [NOTE] @@ -2698,25 +2816,30 @@ This function is not available in scripting API. ==== weechat_util_timeval_add -Add interval (in milliseconds) to a timeval structure. +_Updated in 1.1._ + +Add interval (in microseconds) to a timeval structure. Prototype: [source,C] ---- -void weechat_util_timeval_add (struct timeval *tv, long interval); +void weechat_util_timeval_add (struct timeval *tv, long long interval); ---- Arguments: * 'tv': timeval structure -* 'interval': interval (in milliseconds) +* 'interval': interval (in microseconds) + +[NOTE] +With WeeChat ≤ 1.0, the interval was expressed in milliseconds. C example: [source,C] ---- -weechat_util_timeval_add (&tv, 2000); /* add 2 seconds */ +weechat_util_timeval_add (&tv, 2000000); /* add 2 seconds */ ---- [NOTE] @@ -8149,6 +8272,16 @@ List of signals sent by WeeChat and plugins: String: key combo | Key combo in 'cursor' context +| weechat | mouse_enabled + + _(WeeChat ≥ 1.1)_ | + - | + Mouse enabled + +| weechat | mouse_disabled + + _(WeeChat ≥ 1.1)_ | + - | + Mouse disabled + | weechat | nicklist_group_added + _(WeeChat ≥ 0.3.2)_ | String: buffer pointer + "," + group name | diff --git a/doc/en/weechat_user.en.asciidoc b/doc/en/weechat_user.en.asciidoc index 524ec25e6..ae4c0daec 100644 --- a/doc/en/weechat_user.en.asciidoc +++ b/doc/en/weechat_user.en.asciidoc @@ -43,9 +43,9 @@ WeeChat homepage is here: http://weechat.org/ In order to install WeeChat, you need: * a running GNU/Linux system (with compiler tools for source - package), or compatible OS + package), or a compatible OS * 'root' privileges (to install WeeChat in a system directory) -* ncurses library +* some libraries (see <<dependencies,dependencies>>). [[install]] == Installation @@ -74,6 +74,11 @@ instructions. WeeChat can be compiled with cmake or autotools (cmake is recommended way). +[NOTE] +On OS X, you can use http://brew.sh/[Homebrew]: +`brew install weechat --with-python --with-perl` +(for help: `brew info weechat`). + [[dependencies]] ==== Dependencies @@ -84,18 +89,19 @@ compile WeeChat. |=== | Package ^(1)^ | Version | Required | Feature | cmake | | *yes* | Build (autotools still possible, but cmake is recommended) +| pkg-config | | *yes* | Detect installed libraries | libncursesw5-dev ^(2)^ | | *yes* | Ncurses interface | libcurl4-gnutls-dev | | *yes* | URL transfer | zlib1g-dev | | *yes* | Compression of packets in relay plugin (weechat protocol), script plugin -| libgcrypt11-dev | | *yes* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin -| libgnutls-dev | ≥ 2.2.0 | | SSL connection to IRC server, support of SSL in relay plugin +| libgcrypt20-dev | | *yes* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin +| libgnutls28-dev | ≥ 2.2.0 | | SSL connection to IRC server, support of SSL in relay plugin | gettext | | | Internationalization (translation of messages; base language is English) | ca-certificates | | | Certificates for SSL connections | libaspell-dev or libenchant-dev | | | Aspell plugin | python-dev | ≥ 2.5 ^(3)^ | | Python plugin | libperl-dev | | | Perl plugin -| ruby1.9.1-dev | ≥ 1.8 | | Ruby plugin -| liblua5.1-0-dev | | | Lua plugin +| ruby2.1-dev | ≥ 1.8 | | Ruby plugin +| liblua5.2-dev | | | Lua plugin | tcl-dev | ≥ 8.5 | | Tcl plugin | guile-2.0-dev | ≥ 2.0 | | Guile (scheme) plugin | asciidoc | ≥ 8.5.0 | | Build man page and documentation @@ -500,11 +506,11 @@ Screen is composed by following areas: Bar 'status' has following default items: -[width="100%",cols="^3,^3,10",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Item | Example | Description | time | `[12:55]` | Time -| buffer_count | `[6]` | Number of opened buffers +| buffer_last_number | `[6]` | Number of last buffer in list | buffer_plugin | `[irc/freenode]` | Plugin of current buffer (irc plugin can add IRC server name used by buffer) | buffer_number | `3` | Current buffer number | buffer_name | `#test` | Current buffer name @@ -512,24 +518,39 @@ Bar 'status' has following default items: | buffer_nicklist_count | `{4}` | Number of nicks in nicklist | buffer_zoom | ! | `!` means the merged buffer is zoomed (only this one is displayed), empty value means all merged buffers are displayed | buffer_filter | `*` | Filtering indicator: `*` means some lines are filtered (hidden), empty value means all lines are displayed +| scroll | `-MORE(50)-` | Scroll indicator, with number of lines below last line displayed | lag | `[Lag: 2.5]` | Lag indicator, in seconds (hidden if lag is low) | hotlist | `[H: 4:#abc(2,5), 6]` | List of buffers with activity (unread messages) (in example, 2 highlights and 5 unread messages on '#abc', one unread message on buffer #6) | completion | `abc(2) def(5)` | List of words for completion, with number of possible completions for each word -| scroll | `-MORE(50)-` | Scroll indicator, with number of lines below last line displayed |=== Bar 'input' has following default items: -[width="100%",cols="^3,^6,8",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Item | Example | Description -| input_paste | `[Paste 7 lines ? [ctrl-Y] Yes [ctrl-N] No]` | Question to user for pasting lines | input_prompt | `[@Flashy(i)]` | Input prompt, for irc: nick and modes (mode "+i" means invisible on freenode) | away | `(away)` | Away indicator | input_search | `[Search (~ str,msg)]` | Search indicator ("`~`": case insensitive, "`==`": case sensitive, "`str`": search string, "`regex`": search regular expression, "`msg`": search in messages, "`pre`": search in prefixes, "`pre\|msg`": search in prefixes and messages) +| input_paste | `[Paste 7 lines ? [ctrl-Y] Yes [ctrl-N] No]` | Question to user for pasting lines | input_text | `hi peter!` | Input text |=== +Other items available (not used in bars by default): + +[width="100%",cols="^3,^4,10",options="header"] +|=== +| Item | Example | Description +| aspell_dict | `fr,en` | Spelling dictionaries used on current buffer +| aspell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled) +| buffer_count | `10` | Total number of buffers opened +| buffer_short_name | `#test` | Current buffer short name +| irc_channel | `#test` | Current IRC channel name +| irc_nick_modes | `@` | IRC modes for self nick +| mouse_status | `M` | Mouse status (empty if mouse is disabled) +| window_number | `2` | Current window number +|=== + [[buffers_and_windows]] === Buffers and windows @@ -1398,7 +1419,7 @@ Example: display of "hello everybody!" with "hello" in light blue bold and "everybody" in light red underlined: ---- -^Cc12^Cbhello ^Cb^Cc04^Cueverybody^Cu^Cc! +^Cc12^Cbhello ^Cb^Cc04^C_everybody^C_^Cc! ---- [NOTE] @@ -3056,15 +3077,17 @@ The char "/" can be replaced by any char (one or more identical chars). Matching groups can be used in "replace": -* `$0` to `$99`: `$0` is the whole match, `$1` to `$99` are groups captured -* `$+`: the last match (with highest number) -* `$.cN`: match "N" with all chars replaced by "c" (example: `$.*2` is the group - #2 with all chars replaced by `*`). +* `${re:0}` to `${re:99}`: `${re:0}` is the whole match, `${re:1}` to + `${re:99}` are groups captured +* `${re:+}`: the last match (with highest number) +* `${hide:c,${re:N}}`: match "N" with all chars replaced by "c" + (example: `${hide:*,${re:2}}` is the group #2 with all chars replaced by + `*`). Example: use bold for words between "*": ---- -/\*(\S+)\*/*${color:bold}$1${color:-bold}*/ +/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/ ---- Example: default trigger 'server_pass' uses this regular expression to hide @@ -3072,7 +3095,7 @@ password in commands `/server` and `/connect` (chars in passwords are replaced by `*`): ---- -==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5 +==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5} ---- [NOTE] diff --git a/doc/fr/autogen/plugin_api/completions.asciidoc b/doc/fr/autogen/plugin_api/completions.asciidoc index 08bf53b15..0c341bbcc 100644 --- a/doc/fr/autogen/plugin_api/completions.asciidoc +++ b/doc/fr/autogen/plugin_api/completions.asciidoc @@ -86,6 +86,8 @@ | trigger | trigger_names | triggers +| trigger | trigger_names_default | triggers par défaut + | trigger | trigger_option_value | valeur d'une option de trigger | trigger | trigger_options | options pour les triggers diff --git a/doc/fr/autogen/plugin_api/hdata.asciidoc b/doc/fr/autogen/plugin_api/hdata.asciidoc index 48b169472..2e8242b68 100644 --- a/doc/fr/autogen/plugin_api/hdata.asciidoc +++ b/doc/fr/autogen/plugin_api/hdata.asciidoc @@ -586,21 +586,13 @@ *** 'direction' (integer) *** 'add_space' (integer) *** 'force_partial_completion' (integer) -*** 'completion_list' (pointer) +*** 'list' (pointer) *** 'word_found' (string) *** 'word_found_is_nick' (integer) *** 'position_replace' (integer) *** 'diff_size' (integer) *** 'diff_length' (integer) -*** 'partial_completion_list' (pointer, hdata: "completion_partial") -*** 'last_partial_completion' (pointer, hdata: "completion_partial") -* 'completion_partial': structure avec une complétion partielle -** extension: weechat -** variables: -*** 'word' (string) -*** 'count' (integer) -*** 'prev_item' (pointer, hdata: "completion_partial") -*** 'next_item' (pointer, hdata: "completion_partial") +*** 'partial_list' (pointer) * 'config_file': fichier de configuration ** extension: weechat ** variables: diff --git a/doc/fr/autogen/user/irc_commands.asciidoc b/doc/fr/autogen/user/irc_commands.asciidoc index 0a8dcddba..aacfdbd09 100644 --- a/doc/fr/autogen/user/irc_commands.asciidoc +++ b/doc/fr/autogen/user/irc_commands.asciidoc @@ -89,8 +89,9 @@ Sans paramètre, cette commande affiche la liste des bannissements pour le canal serveur : nom du serveur, qui peut être : - nom interne de serveur (créé par /server add, usage recommandé) - - nom/port ou IP/port (ceci créera un serveur TEMPORAIRE), le port par défaut est 6667 + - nom/port ou IP/port, le port par défaut est 6667 - URL avec le format : irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port][/#canal1][,#canal2[...]] + Note : pour une adresse/IP/URL, un serveur temporaire est créé (NON SAUVÉ), voir /help irc.look.temporary_servers option : définir l'option pour le serveur (pour une option booléenne, la valeur peut être omise) nooption : définir l'option booléenne à 'off' (par exemple : -nossl) -all : se connecter à tous les serveurs définis dans la configuration @@ -631,7 +632,7 @@ pseudo : pseudo [command]*`samode`* changer le mode du canal, sans avoir le statut d'opérateur:: ---- -/samode <canal> <mode> +/samode [<canal>] <mode> canal : nom du canal mode : mode pour le canal diff --git a/doc/fr/autogen/user/irc_options.asciidoc b/doc/fr/autogen/user/irc_options.asciidoc index 5cba09543..66a773c93 100644 --- a/doc/fr/autogen/user/irc_options.asciidoc +++ b/doc/fr/autogen/user/irc_options.asciidoc @@ -343,6 +343,11 @@ ** type: booléen ** valeurs: on, off (valeur par défaut: `on`) +* [[option_irc.look.temporary_servers]] *irc.look.temporary_servers* +** description: `activer la création des serveurs temporaires avec la commande /connect` +** type: booléen +** valeurs: on, off (valeur par défaut: `off`) + * [[option_irc.look.topic_strip_colors]] *irc.look.topic_strip_colors* ** description: `supprimer les couleurs dans le titre (utilisé seulement lors de l'affichage du titre du tampon)` ** type: booléen @@ -479,7 +484,7 @@ ** valeurs: 0 .. 1000000 (valeur par défaut: `25`) * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** description: `liste séparée par des virgules de capacités client ("client capabilities") à activer sur le serveur si elles sont disponibles ; les capacités supportées par WeeChat sont : away-notify, multi-prefix, server-time, userhost-in-names (exemple : "away-notify,multi-prefix")` +** description: `liste séparée par des virgules de capacités client ("client capabilities") à activer sur le serveur si elles sont disponibles ; les capacités supportées par WeeChat sont : away-notify, extended-join, multi-prefix, server-time, userhost-in-names (exemple : "away-notify,multi-prefix")` ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `""`) @@ -591,7 +596,7 @@ * [[option_irc.server_default.ssl_priorities]] *irc.server_default.ssl_priorities* ** description: `chaîne avec les priorités pour gnutls (pour la syntaxe, voir la documentation de la fonction gnutls_priority_init du manuel gnutls, les chaînes courantes sont : "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` ** type: chaîne -** valeurs: toute chaîne (valeur par défaut: `"NORMAL"`) +** valeurs: toute chaîne (valeur par défaut: `"NORMAL:-VERS-SSL3.0"`) * [[option_irc.server_default.ssl_verify]] *irc.server_default.ssl_verify* ** description: `vérifier que la connexion SSL est entièrement de confiance` diff --git a/doc/fr/autogen/user/relay_commands.asciidoc b/doc/fr/autogen/user/relay_commands.asciidoc index 229e4861c..ea1262336 100644 --- a/doc/fr/autogen/user/relay_commands.asciidoc +++ b/doc/fr/autogen/user/relay_commands.asciidoc @@ -3,25 +3,33 @@ ---- /relay list|listfull|listrelay - add [ipv4.][ipv6.][ssl.]<protocole.nom> <port> - del [ipv4.][ipv6.][ssl.]<protocole.nom> + add <nom> <port> + del|stop|restart <nom> raw sslcertkey - list : lister les clients pour le relai - listfull : lister les clients pour le relai (verbeux) - listrelay : lister les relais (nom et port) - add : ajouter un relai pour un protocole + nom - del : supprimer un relai pour un protocole + nom + list : lister les clients pour le relai + listfull : lister les clients pour le relai (verbeux) + listrelay : lister les relais (nom et port) + add : ajouter un relai (écouter sur un port) + del : supprimer un relai (les clients restent connectés) + stop : fermer le socket serveur (les clients restent connectés) + restart : fermer le socket serveur et écouter à nouveau sur le port (les clients restent connectés) + nom : nom du relai (voir le format ci-dessous) + port : port utilisé pour le relai + raw : ouvrir le tampon avec les données brutes Relay +sslcertkey : définir le certificat/clé SSL en utilisant le chemin de l'option relay.network.ssl_cert_key + +Le nom du relai est : [ipv4.][ipv6.][ssl.]<protocole.nom> ipv4 : forcer l'utilisation d'IPv4 ipv6 : forcer l'utilisation d'IPv6 ssl : activer SSL protocole.nom : protocole et nom à relayer : - protocole "irc" : le nom est le serveur à partager (optionnel, si non donné, le nom de serveur doit être envoyé par le client dans la commande "PASS", avec le format : "PASS serveur:motdepasse") - protocole "weechat" (le nom n'est pas utilisé) - port : port utilisé pour le relai - raw : ouvrir le tampon avec les données brutes Relay - sslcertkey : définir le certificat/clé SSL en utilisant le chemin de l'option relay.network.ssl_cert_key + +Le protocole "irc" permet à n'importe quel client IRC (incluant WeeChat lui-même) de se connecter sur le port. +Le protocole "weechat" permet à une interface distante de se connecter sur le port, voir la liste ici : http://weechat.org/download/ Sans paramètre, cette commande ouvre le tampon avec la liste des clients pour le relai. diff --git a/doc/fr/autogen/user/relay_options.asciidoc b/doc/fr/autogen/user/relay_options.asciidoc index 26278c002..301ca03f7 100644 --- a/doc/fr/autogen/user/relay_options.asciidoc +++ b/doc/fr/autogen/user/relay_options.asciidoc @@ -59,7 +59,7 @@ ** valeurs: on, off (valeur par défaut: `on`) * [[option_relay.irc.backlog_tags]] *relay.irc.backlog_tags* -** description: `étiquettes des messages qui sont affichés dans l'historique par canal IRC (étiquettes supportées : "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = toutes les étiquettes supportées` +** description: `liste d'étiquettes de messages (séparées par des virgules) qui sont affichés dans l'historique par canal IRC (étiquettes supportées : "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = toutes les étiquettes supportées` ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `"irc_privmsg"`) @@ -118,6 +118,11 @@ ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `"%h/ssl/relay.pem"`) +* [[option_relay.network.ssl_priorities]] *relay.network.ssl_priorities* +** description: `chaîne avec les priorités pour gnutls (pour la syntaxe, voir la documentation de la fonction gnutls_priority_init du manuel gnutls, les chaînes courantes sont : "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` +** type: chaîne +** valeurs: toute chaîne (valeur par défaut: `"NORMAL:-VERS-SSL3.0"`) + * [[option_relay.network.websocket_allowed_origins]] *relay.network.websocket_allowed_origins* ** description: `expression régulière POSIX étendue avec les origines autorisées dans les websockets (insensible à la casse, utilisez "(?-i)" en début de chaîne pour la rendre insensible à la casse), exemple : "^http://(www\.)?example\.(com|org)"` ** type: chaîne diff --git a/doc/fr/autogen/user/trigger_commands.asciidoc b/doc/fr/autogen/user/trigger_commands.asciidoc index e8e68987f..5cdd7e603 100644 --- a/doc/fr/autogen/user/trigger_commands.asciidoc +++ b/doc/fr/autogen/user/trigger_commands.asciidoc @@ -12,6 +12,7 @@ restart <nom>|-all [<nom>...] show <nom> del <nom>|-all [<nom>...] + restore <nom> [<nom>...] default -yes monitor [<filtre>] @@ -54,6 +55,7 @@ code_retour : code retour dans le callback (ok (par défaut), ok_eat, error) show : afficher des informations détaillées sur un trigger (avec quelques statistiques) del : supprimer un trigger -all : effectuer l'action sur tous les triggers + restore : restaurer un/des trigger(s) avec les valeurs par défaut (fonctionne seulement pour les triggers par défaut) default : restaurer les triggers par défaut monitor : ouvrir le tampon moniteur des triggers filtre : filtrer les hooks/triggers à afficher (un hook doit commencer par "@", par exemple "@signal"), plusieurs filtres peuvent être séparés par des virgules ; le caractère joker "*" est autorisé dans chaque nom de trigger @@ -66,7 +68,7 @@ Lorsqu'un callback de trigger est appelé, les actions suivantes sont exécutée Exemples (vous pouvez aussi regarder les triggers par défaut avec /trigger listdefault) : ajouter des attributs *gras*, _souligné_ et /italique/ (seulement dans les messages d'utilisateurs) : - /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}/" + /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/" cacher la barre de pseudos sur les petits terminaux : /trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist" /trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist" diff --git a/doc/fr/autogen/user/weechat_commands.asciidoc b/doc/fr/autogen/user/weechat_commands.asciidoc index 2e9575d28..d43f2443a 100644 --- a/doc/fr/autogen/user/weechat_commands.asciidoc +++ b/doc/fr/autogen/user/weechat_commands.asciidoc @@ -260,11 +260,12 @@ Pour forcer une comparaison de chaînes, ajoutez des guillemets autour de chaque Des variables sont remplacées dans l'expression, en utilisant le format ${variable}, la variable pouvant être, par ordre de priorité : 1. une chaîne avec les caractères échappés (format : "esc:xxx" ou "\xxx") - 2. une couleur (format : "color:xxx") - 3. une info (format : "info:nom,paramètres", les paramètres sont optionnels) - 4. une option (format : "fichier.section.option") - 5. une variable locale du tampon - 6. un hdata/variable (la valeur est automatiquement convertie en chaîne), par défaut "window" et "buffer" pointent vers la fenêtre et le tampon courants. + 2. une chaîne avec des caractères à cacher (format : "hide:caractère,chaîne") + 3. une couleur (format : "color:xxx") + 4. une info (format : "info:nom,paramètres", les paramètres sont optionnels) + 5. une option (format : "fichier.section.option") + 6. une variable locale du tampon + 7. un hdata/variable (la valeur est automatiquement convertie en chaîne), par défaut "window" et "buffer" pointent vers la fenêtre et le tampon courants. Le format du hdata peut être le suivant : hdata.var1.var2... : démarrer avec un hdata (le pointeur doit être connu), et demander les variables l'une après l'autre (d'autres hdata peuvent être suivis) hdata[list].var1.var2... : démarrer avec un hdata en utilisant une liste, par exemple : @@ -273,23 +274,24 @@ Le format du hdata peut être le suivant : Pour le nom du hdata et des variables, voir la "Référence API extension", fonction "weechat_hdata_get". Exemples (chaînes simples) : - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${\t} ==> <tab> + /eval -n ${hide:-,${relay.network.password}} ==> -------- Exemples (conditions) : - /eval -n -c ${window.buffer.number} > 2 ==> 0 - /eval -n -c ${window.win_width} > 100 ==> 1 - /eval -n -c (8 > 12) || (5 > 2) ==> 1 - /eval -n -c (8 > 12) && (5 > 2) ==> 0 - /eval -n -c abcd =~ ^ABC ==> 1 - /eval -n -c abcd =~ (?-i)^ABC ==> 0 - /eval -n -c abcd =~ (?-i)^abc ==> 1 - /eval -n -c abcd !~ abc ==> 0 + /eval -n -c ${window.buffer.number} > 2 ==> 0 + /eval -n -c ${window.win_width} > 100 ==> 1 + /eval -n -c (8 > 12) || (5 > 2) ==> 1 + /eval -n -c (8 > 12) && (5 > 2) ==> 0 + /eval -n -c abcd =~ ^ABC ==> 1 + /eval -n -c abcd =~ (?-i)^ABC ==> 0 + /eval -n -c abcd =~ (?-i)^abc ==> 1 + /eval -n -c abcd !~ abc ==> 0 ---- [[command_weechat_filter]] @@ -312,7 +314,7 @@ Exemples (conditions) : del : supprimer un filtre -all : supprimer tous les filtres tampon : liste des tampons, séparés par des virgules, où le filtre est actif : - - il s'agit du nom complet incluant l'extension (exemple : "irc.freenode.#weechat") + - il s'agit du nom complet incluant l'extension (exemple : "irc.freenode.#weechat" ou "irc.server.freenode") - "*" signifie tous les tampons - un nom commençant par '!' est exclu - le caractère joker "*" est autorisé @@ -784,7 +786,7 @@ Exemples : afficher la valeur de la variable d'environnement LANG : /set env LANG modifier la variable d'environnement LANG et l'utiliser : - /set env LANG=fr_FR.UTF-8 + /set env LANG fr_FR.UTF-8 /upgrade réinitialiser la variable d'environnement ABC : /set env ABC "" diff --git a/doc/fr/autogen/user/weechat_options.asciidoc b/doc/fr/autogen/user/weechat_options.asciidoc index 1a05c4267..2e409a294 100644 --- a/doc/fr/autogen/user/weechat_options.asciidoc +++ b/doc/fr/autogen/user/weechat_options.asciidoc @@ -69,17 +69,17 @@ ** valeurs: toute chaîne (valeur par défaut: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) * [[option_weechat.color.chat_nick_offline]] *weechat.color.chat_nick_offline* -** description: `couleur du texte pour un pseudo déconnecté (qui n'est plus dans la liste de pseudos)` +** description: `couleur du texte pour un pseudo déconnecté (qui n'est plus dans la liste de pseudos) ; cette couleur est utilisée seulement si l'option weechat.look.color_nick_offline est activée` ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné (valeur par défaut: `default`) * [[option_weechat.color.chat_nick_offline_highlight]] *weechat.color.chat_nick_offline_highlight* -** description: `couleur du texte pour un pseudo déconnecté avec highlight` +** description: `couleur du texte pour un pseudo déconnecté avec highlight ; cette couleur est utilisée seulement si l'option weechat.look.color_nick_offline est activée` ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné (valeur par défaut: `default`) * [[option_weechat.color.chat_nick_offline_highlight_bg]] *weechat.color.chat_nick_offline_highlight_bg* -** description: `couleur du fond pour un pseudo déconnecté avec highlight` +** description: `couleur du fond pour un pseudo déconnecté avec highlight ; cette couleur est utilisée seulement si l'option weechat.look.color_nick_offline est activée` ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné (valeur par défaut: `blue`) @@ -283,6 +283,11 @@ ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné (valeur par défaut: `yellow`) +* [[option_weechat.color.status_mouse]] *weechat.color.status_mouse* +** description: `couleur du texte pour l'indicateur de la souris dans la barre de statut` +** type: couleur +** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné (valeur par défaut: `green`) + * [[option_weechat.color.status_name]] *weechat.color.status_name* ** description: `couleur du texte pour le nom du tampon courant dans la barre de statut` ** type: couleur @@ -313,6 +318,11 @@ ** type: booléen ** valeurs: on, off (valeur par défaut: `on`) +* [[option_weechat.completion.command_inline]] *weechat.completion.command_inline* +** description: `si activé, les commandes à l'intérieur de la ligne de commande sont complétées (la commande en début de ligne a une priorité plus élevée et est utilisée en premier) ; note : lorsque cette option est activée, il n'y a plus de complétion automatique des chemins commençant par '/' (en dehors des paramètres de commandes)` +** type: booléen +** valeurs: on, off (valeur par défaut: `on`) + * [[option_weechat.completion.default_template]] *weechat.completion.default_template* ** description: `modèle de complétion par défaut (merci de consulter la documentation pour les codes et valeurs du modèle : Référence API extension, fonction "weechat_hook_command")` ** type: chaîne @@ -518,6 +528,11 @@ ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `""`) +* [[option_weechat.look.command_incomplete]] *weechat.look.command_incomplete* +** description: `si activé, les commandes incomplètes et non ambiguës sont autorisées, par exemple /he pour /help` +** type: booléen +** valeurs: on, off (valeur par défaut: `off`) + * [[option_weechat.look.confirm_quit]] *weechat.look.confirm_quit* ** description: `si activé, la commande /quit doit être confirmée par le paramètre supplémentaire "-yes" (voir /help quit)` ** type: booléen @@ -663,6 +678,11 @@ ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `"!"`) +* [[option_weechat.look.item_mouse_status]] *weechat.look.item_mouse_status* +** description: `chaîne utilisée pour montrer si la souris est activée (objet de barre "mouse_status")` +** type: chaîne +** valeurs: toute chaîne (valeur par défaut: `"M"`) + * [[option_weechat.look.item_time_format]] *weechat.look.item_time_format* ** description: `format de date/heure pour l'objet de barre "time" (voir man strftime pour le format de date/heure)` ** type: chaîne diff --git a/doc/fr/weechat.1.fr.asciidoc b/doc/fr/weechat.1.fr.asciidoc index d4ef5aedb..157122c7a 100644 --- a/doc/fr/weechat.1.fr.asciidoc +++ b/doc/fr/weechat.1.fr.asciidoc @@ -55,7 +55,7 @@ $HOME/.weechat/plugins.conf:: fichier de configuration des extensions $HOME/.weechat/sec.conf:: - configuration file with secured data + fichier de configuration avec les données sécurisées $HOME/.weechat/alias.conf:: fichier de configuration pour l'extension 'alias' diff --git a/doc/fr/weechat_dev.fr.asciidoc b/doc/fr/weechat_dev.fr.asciidoc index ea17e1c28..f9a5cae59 100644 --- a/doc/fr/weechat_dev.fr.asciidoc +++ b/doc/fr/weechat_dev.fr.asciidoc @@ -93,6 +93,7 @@ Le cœur de WeeChat est situé dans les répertoires suivants : | Chemin/fichier | Description | core/ | Fonctions du cœur : point d'entrée, structures internes | weechat.c | Fonctions principales : options de ligne de commande, démarrage +| wee-arraylist.c | Listes avec tableau (« arraylists ») | wee-backtrace.c | Afficher une trace après un plantage | wee-command.c | Commandes du cœur de WeeChat | wee-completion.c | Complétions par défaut @@ -115,7 +116,7 @@ Le cœur de WeeChat est situé dans les répertoires suivants : | wee-upgrade.c | Mise à jour du cœur de WeeChat (tampons, lignes, historique, ...) | wee-url.c | Transfert d'URL (en utilisant libcurl) | wee-utf8.c | Fonctions UTF-8 -| wee-util.c | Quelques autres fonctions +| wee-util.c | Quelques autres fonctions utilitaires | wee-version.c | Fonctions pour la version de WeeChat | gui/ | Fonctions pour les tampons, fenêtres, ... (utilisées par toutes les interfaces) | gui-bar-item.c | Objets de barre @@ -673,7 +674,7 @@ struct t_gui_window *gui_current_window = NULL; /* current window */ ---- Il n'y a pas de convention pour les variables locales (dans les fonctions). -La seule recommendation est que le nom soit explicite (et pas trop court). + +La seule recommandation est que le nom soit explicite (et pas trop court). + Cependant, les pointeurs vers les structures sont souvent nommés 'ptr_xxxx', par exemple un pointeur sur 'struct t_gui_buffer *' sera : '*ptr_buffer'. @@ -960,7 +961,7 @@ server->hook_timer_sasl = weechat_hook_timer (timeout * 1000, Le dépôt Git est à cette URL : https://github.com/weechat/weechat Tout patch pour un bug ou une nouvelle fonctionnalité doit être effectué sur la -branche master, le format préféré étant une "pull request" sur Github. Un patch +branche master, le format préféré étant une "pull request" sur GitHub. Un patch peut aussi être envoyé par e-mail (fait avec `git diff` ou `git format-patch`). Le format du message de commit est le suivant (pour fermer un bug GitHub) : diff --git a/doc/fr/weechat_faq.fr.asciidoc b/doc/fr/weechat_faq.fr.asciidoc index 99fc8f3bf..897be9288 100644 --- a/doc/fr/weechat_faq.fr.asciidoc +++ b/doc/fr/weechat_faq.fr.asciidoc @@ -51,6 +51,22 @@ base git. Notez que ce paquet peut ne pas correspondre exactement à la base git et qu'il est moins pratique que de cloner la base git pour installer des mises à jour. +[[compile_osx]] +=== Comment puis-je installer WeeChat sous OS X ? + +Il est recommandé d'utiliser http://brew.sh/[Homebrew], vous pouvez avoir de +l'aide avec : + +---- +brew info weechat +---- + +Vous pouvez installer WeeChat avec cette commande : + +---- +brew install weechat --with-python --with-perl +---- + [[lost]] === J'ai lancé WeeChat, mais je suis perdu, que puis-je faire ? @@ -609,7 +625,7 @@ Pour l'aide : `/help filter` et `/help irc.look.smart_filter` [[filter_irc_join_channel_messages]] === Comment puis-je filtrer certains messages affichés quand je rejoins un canal IRC ? -Avec WeeChat ≥ 0.4.1, vous pouvez choisir les messages affichés ou non lorque +Avec WeeChat ≥ 0.4.1, vous pouvez choisir les messages affichés ou non lorsque vous rejoignez un canal avec l'option 'irc.look.display_join_message' (voir `/help irc.look.display_join_message` pour plus d'informations). @@ -675,7 +691,19 @@ Pour WeeChat ≤ 0.3.3, les options sont 'irc.network.away_check' et [[highlight_notification]] === Comment être averti lorsque quelqu'un prononce mon pseudo sur un canal ? -Vous pouvez utiliser un script comme 'beep.pl' ou 'launcher.pl'. +Avec WeeChat ≥ 1.0, il y a un trigger "beep" qui envoie 'BEL' au terminal sur +un highlight ou un message privé. Par conséquent vous pouvez configurer votre +terminal (ou multiplexeur comme screen/tmux) pour lancer une commande ou jouer +un son lorsque le 'BEL' se produit. + +Ou vous pouvez ajouter une commande dans le trigger "beep" : + +---- +/set trigger.trigger.beep.command "/print -beep;/exec -bg /chemin/vers/commande paramètres" +---- + +Avec un WeeChat plus ancien, vous pouvez utiliser un script comme 'beep.pl' or +'launcher.pl'. Pour 'launcher.pl', vous devez configurer la commande : diff --git a/doc/fr/weechat_plugin_api.fr.asciidoc b/doc/fr/weechat_plugin_api.fr.asciidoc index 1a6052238..cb073f653 100644 --- a/doc/fr/weechat_plugin_api.fr.asciidoc +++ b/doc/fr/weechat_plugin_api.fr.asciidoc @@ -959,7 +959,7 @@ Paramètres : * 'string' : chaîne * 'left' : supprime les caractères en début de chaîne si différent de 0 -* 'right' : supprime les caractères en fin de chaîne si different de 0 +* 'right' : supprime les caractères en fin de chaîne si différent de 0 * 'chars' : chaîne avec les caractères à supprimer Valeur de retour : @@ -1858,11 +1858,11 @@ str3 = weechat.string_input_for_buffer("//test") # "/test" ==== weechat_string_eval_expression -_WeeChat ≥ 0.4.0, mis à jour dans la 0.4.2._ +_WeeChat ≥ 0.4.0, mis à jour dans la 0.4.2 et 1.1._ Évaluer l'expression et retourner le résultat sous forme de chaîne. -Les variables spéciales avec le format `${variable}` sont étendues (voir la -commande `/eval` dans le 'Guide utilisateur WeeChat'). +Les variables spéciales avec le format `${variable}` sont étendues (voir le +tableau ci-dessous). [NOTE] Depuis la version 1.0, les variables imbriquées sont supportées, par exemple : @@ -1880,11 +1880,17 @@ char *weechat_string_eval_expression (const char *expr, Paramètres : -* 'expr' : l'expression à évaluer +* 'expr' : l'expression à évaluer (voir le tableau ci-dessous) * 'pointers' : table de hachage avec les pointeurs (les clés doivent être des chaînes, les valeurs doivent être des pointeurs); les pointeurs "window" et "buffer" sont automatiquement ajoutés s'ils ne sont pas dans la table de - hachage (avec le pointer vers fenêtre/tampon courants) (peut être NULL) + hachage (avec le pointer vers fenêtre/tampon courants) (peut être NULL) : +** 'regex' : pointeur vers une expression régulière (structure 'regex_t') + compilée avec la fonction WeeChat + <<_weechat_string_regcomp,weechat_string_regcomp>> ou regcomp (voir + `man regcomp`) ; cette option est similaire à 'regex' dans la table de + hachage 'options' (ci-dessous), mais est utilisée pour de meilleures + performances * 'extra_vars' : variables additionnelles qui seront étendues (peut être NULL) * 'options' : table de hachage avec des options (les clés et valeurs doivent être des chaînes) (peut être NULL) : @@ -1894,6 +1900,12 @@ Paramètres : et parenthèses sont utilisés, le résultat est un booléen ("0" ou "1") ** 'prefix' : préfixe avant les variables à remplacer (par défaut : "${") ** 'suffix' : suffixe après les variables à remplacer (par défaut : "}") +** 'regex' : une expression regulière pour remplacer du texte dans 'expr' (qui + n'est alors pas évalué) +** 'regex_replace' : le texte de remplacement à utiliser avec 'regex', pour + remplacer du texte dans 'expr' ('regex_replace' est évalué sur chaque + correspondance de 'regex' sur 'expr', jusqu'à ce que plus aucune + correspondance ne soit trouvée) Valeur de retour : @@ -1901,20 +1913,108 @@ Valeur de retour : utilisation), ou NULL si problème (expression invalide ou pas assez de mémoire) +Liste des variables étendues dans l'expression (par ordre de priorité, de la +première étendue à la dernière) : + +[width="100%",cols="2,8,3,3",options="header"] +|=== +| Format | Description | Exemples | Résultats + +| `${nom}` | Variable `nom` de la table de hachage 'extra_vars' | + `${nom}` | `valeur` + +| `${esc:xxx}` + + `${\xxx}` | Chaîne avec caractères échappés | + `${esc:préfixe\tmessage}` + + `${\ua9}` | + `préfixe<TAB>message` + + `©` + +| `${hide:x,valeur}` | + Chaîne avec les caractères masqués (tous les caractères dans `valeur` + remplacés par `x` | + `${hide:*,mot_de_passe}` | + `************` + +| `${re:N}` | + Groupe regex capturé : 0 = toute la chaîne correspondante, 1 à 99 = groupe + capturé, `+` = dernier groupe capturé | + `${re:1}` | + `test` + +| `${color:nom}` | + Code couleur WeeChat (le nom de couleur a des attributs facultatifs) | + `${color:red}texte rouge` + + `${color:*214}texte orange gras` | + `texte rouge` (en rouge) + + `texte orange gras` (en orange gras) + +| `${info:name}` + + `${indo:name,arguments}` | + Info de WeeChat ou d'une extension, voir la fonction + <<_weechat_info_get,weechat_info_get>> | + `${info:version}` + + `${info:irc_nick_color_name,foo}` | + `1.0` + + `lightblue` + +| `${sec.data.nom}` | + Valeur de la donnée sécurisée `nom` | + `${sec.data.freenode_pass}` | + `mon_mot_de_passe` + +| `${file.section.option}` | + Valeur de l'option | + `${weechat.look.buffer_time_format}` | + `%H:%M:%S` + +| `${nom}` | + Valeur de la variable locale `nom` dans le tampon | + `${nick}` | + `FlashCode` + +| `${hdata.var1.var2...}` + + `${hdata[list].var1.var2...}` | + Valeur d'un hdata (les pointeurs `window` et `buffer` sont définis par défaut + avec la fenêtre et tampon courants) | + `${buffer[gui_buffers].full_name}` + + `${window.buffer.number}` | + `core.weechat` + + `1` +|=== + Exemples en C : [source,C] ---- -struct t_hashtable *options = weechat_hashtable_new (8, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); -if (options) - weechat_hashtable_set (options, "type", "condition"); -char *str1 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ -char *str2 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options); /* "1" */ -char *str3 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options); /* "0" */ +/* conditions */ +struct t_hashtable *options1 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options1, "type", "condition"); +char *str1 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options1); /* "1" */ +char *str2 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options1); /* "0" */ + +/* expression simple */ +char *str3 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ + +/* remplacement avec regex */ +struct t_hashtable *options2 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +/* ajout de crochets autour des URLs */ +weechat_hashtable_set (options2, "regex", "\\w+://\\S+"); +weechat_hashtable_set (options2, "regex_replace", "[ ${re:0} ]"); +char *str4 = weechat_string_eval_expression ("test: http://weechat.org", NULL, NULL, NULL); /* "test: [ http://weechat.org ]" */ + +/* masquage des mots de passe */ +weechat_hashtable_set (options2, "regex", "(password=)(\\S+)"); +weechat_hashtable_set (options2, "regex_replace", "${re:1}${hide:*,${re:2}}"); +char *str5 = weechat_string_eval_expression ("password=abc password=def", NULL, NULL, NULL); /* "password=*** password=***" */ ---- Script (Python) : @@ -1925,9 +2025,27 @@ Script (Python) : str = weechat.string_eval_expression(expr, pointers, extra_vars, options) # exemples -str1 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" -str2 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" -str3 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" + +# conditions +str1 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" +str2 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" + +# expression simple +str3 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" + +# remplacement avec regex : ajout de crochets autour des URLs +options = { + "regex": "\\w+://\\S+", + "regex_replace": "[ ${re:0} ]", +} +str4 = weechat.string_eval_expression("test: http://weechat.org", {}, {}, options) # "test: [ http://weechat.org ]" + +# replace with regex : masquage des mots de passe +options = { + "regex": "(password=)(\\S+)", + "regex_replace": "${re:1}${hide:*,${re:2}}", +} +str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, options) # "password=*** password=***" ---- [[utf-8]] @@ -2713,13 +2831,15 @@ Cette fonction n'est pas disponible dans l'API script. ==== weechat_util_timeval_diff -Retourner la différence (en millisecondes) entre deux structures "timeval". +_Mis à jour dans la 1.1._ + +Retourner la différence (en microsecondes) entre deux structures "timeval". Prototype : [source,C] ---- -long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); +long long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); ---- Paramètres : @@ -2729,13 +2849,16 @@ Paramètres : Valeur de retour : -* différence en millisecondes +* différence en microsecondes + +[NOTE] +Avec WeeChat ≤ 1.0, la valeur retournée était en millisecondes. Exemple en C : [source,C] ---- -long diff = weechat_util_timeval_diff (&tv1, &tv2); +long long diff = weechat_util_timeval_diff (&tv1, &tv2); ---- [NOTE] @@ -2743,25 +2866,30 @@ Cette fonction n'est pas disponible dans l'API script. ==== weechat_util_timeval_add -Ajouter un intervalle (en millisecondes) à une structure "timeval". +_Mis à jour dans la 1.1._ + +Ajouter un intervalle (en microsecondes) à une structure "timeval". Prototype : [source,C] ---- -void weechat_util_timeval_add (struct timeval *tv, long interval); +void weechat_util_timeval_add (struct timeval *tv, long long interval); ---- Paramètres : * 'tv' : structure "timeval" -* 'interval' : intervalle (en millisecondes) +* 'interval' : intervalle (en microsecondes) + +[NOTE] +Avec WeeChat ≤ 1.0, l'intervalle était exprimé en millisecondes. Exemple en C : [source,C] ---- -weechat_util_timeval_add (&tv, 2000); /* ajoute 2 secondes */ +weechat_util_timeval_add (&tv, 2000000); /* ajouter 2 secondes */ ---- [NOTE] @@ -3148,7 +3276,7 @@ weechat.list_set(item, "nouvelle donnée") ==== weechat_list_next -Retourner l'éléement suivant dans la liste. +Retourner l'élément suivant dans la liste. Prototype : @@ -7577,8 +7705,8 @@ Paramètres : * 'callback' : fonction appelée lorsque la connexion est ok ou a échoué, paramètres et valeur de retour : ** 'void *data' : pointeur -** 'int status' : connection status : -*** 'WEECHAT_HOOK_CONNECT_OK' : connextion ok +** 'int status' : statut de connexion : +*** 'WEECHAT_HOOK_CONNECT_OK' : connexion ok *** 'WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND' : adresse non trouvée *** 'WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND' : adresse IP non trouvée *** 'WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED' : connexion refusée @@ -8228,7 +8356,7 @@ Liste des signaux envoyés par WeeChat et les extensions : Filtre ajouté | weechat | filter_removing | - Pointre : filtre | + Pointeur : filtre | Suppression de filtre en cours | weechat | filter_removed | @@ -8290,6 +8418,16 @@ Liste des signaux envoyés par WeeChat et les extensions : Chaîne : combinaison de touches | Combinaison de touches dans le contexte 'cursor' +| weechat | mouse_enabled + + _(WeeChat ≥ 1.1)_ | + - | + Souris activée + +| weechat | mouse_disabled + + _(WeeChat ≥ 1.1)_ | + - | + Souris désactivée + | weechat | nicklist_group_added + _(WeeChat ≥ 0.3.2)_ | Chaîne : pointeur tampon + "," + nom du groupe | @@ -9282,7 +9420,7 @@ Paramètres : * 'completion' : pointeur vers la complétion * 'word' : mot à ajouter * 'nick_completion' : 1 si le mot est un pseudo, sinon 0 -* 'where' : pposition où sera inséré le mot dans la liste : +* 'where' : position où sera inséré le mot dans la liste : ** 'WEECHAT_LIST_POS_SORT' : n'importe où, pour maintenir la liste triée ** 'WEECHAT_LIST_POS_BEGINNING' : au début de la liste ** 'WEECHAT_LIST_POS_END' : à la fin de la liste @@ -9729,7 +9867,7 @@ Paramètres : ** 'void *data' : pointeur ** 'const char *infolist_name' : nom de l'infolist ** 'void *pointer' : pointeur vers un objet que l'infolist doit retourner (pour - obtenir unituqment cet objet dans l'infolist) + obtenir uniquement cet objet dans l'infolist) ** 'const char *arguments' : paramètres additionnels, dépendant de l'infolist ** valeur de retour : infolist demandée * 'callback_data' : pointeur donné au "callback" lorsqu'il est appelé par @@ -12643,7 +12781,7 @@ Paramètres : * 'proxy' : nom du proxy à utiliser * 'sock' : socket à utiliser -* 'address' : addresse (nom de machine ou adresse IP) +* 'address' : adresse (nom de machine ou adresse IP) * 'port' : port Valeur de retour : diff --git a/doc/fr/weechat_user.fr.asciidoc b/doc/fr/weechat_user.fr.asciidoc index 3ecebad2d..97d44d5c6 100644 --- a/doc/fr/weechat_user.fr.asciidoc +++ b/doc/fr/weechat_user.fr.asciidoc @@ -46,7 +46,7 @@ Pour installer WeeChat, vous devez avoir : * un système GNU/Linux (avec le compilateur et les outils associés pour le paquet des sources), ou un système compatible * droits "root" (pour installer WeeChat dans un répertoire système) -* la bibliothèque ncurses +* quelques bibliothèques (voir les <<dependencies,dépendances>>). [[install]] == Installation @@ -76,6 +76,11 @@ la distribution pour la méthode d'installation. WeeChat peut être compilé avec cmake ou les autotools (cmake est la méthode recommandée). +[NOTE] +Sous OS X, vous pouvez utiliser http://brew.sh/[Homebrew] : +`brew install weechat --with-python --with-perl` +(pour l'aide : `brew info weechat`). + [[dependencies]] ==== Dépendances @@ -86,18 +91,19 @@ compiler WeeChat. |=== | Paquet ^(1)^ | Version | Requis | Fonctionnalité | cmake | | *oui* | Construction (autotools toujours possible, mais cmake est recommandé) +| pkg-config | | *oui* | Détection des bibliothèques installées | libncursesw5-dev ^(2)^ | | *oui* | Interface ncurses | libcurl4-gnutls-dev | | *oui* | Transfert d'URL | zlib1g-dev | | *oui* | Compression des paquets dans l'extension relay (protocole weechat), extension script -| libgcrypt11-dev | | *oui* | Données sécurisées, authentification IRC SASL (DH-BLOWFISH/DH-AES), extension script -| libgnutls-dev | ≥ 2.2.0 | | Connexion SSL au serveur IRC, support SSL dans l'extension relay +| libgcrypt20-dev | | *oui* | Données sécurisées, authentification IRC SASL (DH-BLOWFISH/DH-AES), extension script +| libgnutls28-dev | ≥ 2.2.0 | | Connexion SSL au serveur IRC, support SSL dans l'extension relay | gettext | | | Internationalisation (traduction des messages; la langue de base est l'anglais) | ca-certificates | | | Certificats pour les connexions SSL | libaspell-dev ou libenchant-dev | | | Extension aspell | python-dev | ≥ 2.5 ^(3)^ | | Extension python | libperl-dev | | | Extension perl -| ruby1.9.1-dev | ≥ 1.8 | | Extension ruby -| liblua5.1-0-dev | | | Extension lua +| ruby2.1-dev | ≥ 1.8 | | Extension ruby +| liblua5.2-dev | | | Extension lua | tcl-dev | ≥ 8.5 | | Extension tcl | guile-2.0-dev | ≥ 2.0 | | Extension guile (scheme) | asciidoc | ≥ 8.5.0 | | Construction de la page man et de la documentation @@ -510,11 +516,11 @@ L'écran est composé des zones suivantes : La barre 'status' contient les objets (items) suivants par défaut : -[width="100%",cols="^3,^3,10",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Objet (item) | Exemple | Description | time | `[12:55]` | Heure -| buffer_count | `[6]` | Nombre de tampons ouverts +| buffer_last_number | `[6]` | Numéro du dernier tampon de la liste | buffer_plugin | `[irc/freenode]` | Extension du tampon courant (l'extension irc peut afficher le nom du serveur IRC auquel est rattaché ce tampon) | buffer_number | `3` | Numéro du tampon courant | buffer_name | `#test` | Nom du tampon courant @@ -522,24 +528,39 @@ La barre 'status' contient les objets (items) suivants par défaut : | buffer_nicklist_count | `{4}` | Nombre de pseudos dans la liste des pseudos | buffer_zoom | ! | `!` signifie que le tampon mélangé est zoomé, une valeur vide signifie que tous les tampons mélangés sont affichés | buffer_filter | `*` | Indicateur de filtrage : `*` signifie que des lignes sont filtrées (cachées), une valeur vide signifie que toutes les lignes sont affichées +| scroll | `-PLUS(50)-` | Indicateur de scroll, avec le nombre de lignes sous la dernière ligne affichée | lag | `[Lag: 2.5]` | Indicateur de "lag" (ralentissements réseau), en secondes (caché si le lag est faible) | hotlist | `[H: 4:#abc(2,5), 6]` | Liste des tampons où il y a de l'activité (messages non lus) (dans cet exemple, 2 highlights et 5 messages non lus sur '#abc', un message non lu sur le tampon numéro 6) | completion | `abc(2) def(5)` | Liste des mots pour la complétion, avec le nombre de complétions possibles pour chaque mot -| scroll | `-PLUS(50)-` | Indicateur de scroll, avec le nombre de lignes sous la dernière ligne affichée |=== La barre 'input' contient les objets (items) suivants par défaut : -[width="100%",cols="^3,^6,8",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Objet (item) | Exemple | Description -| input_paste | `[Coller 7 lignes ? [ctrl-Y] Oui [ctrl-N] Non]` | Question à l'utilisateur pour coller des lignes | input_prompt | `[@Flashy(i)]` | Prompt, pour irc: pseudo et modes (le mode "+i" signifie invisible sur freenode) | away | `(absent)` | Indicateur d'absence | input_search | `[Recherche (~ str,msg)]` | Indicateur de recherche de texte ("`~`" : insensible à la casse, "`==`" : sensible à la casse, "`str`" : recherche de chaîne, "`regex`" : recherche d'expression régulière, "`msg`" : recherche dans les messages, "`pre`" : recherche dans les préfixes, "`pre\|msg`" : recherche dans les préfixes et messages) +| input_paste | `[Coller 7 lignes ? [ctrl-Y] Oui [ctrl-N] Non]` | Question à l'utilisateur pour coller des lignes | input_text | `salut peter !` | Texte entré |=== +Autres objets (non utilisés dans des barres par défaut) : + +[width="100%",cols="^3,^4,10",options="header"] +|=== +| Objet (item) | Exemple | Description +| aspell_dict | `fr,en` | Dictionnaires utilisés pour la vérification de l'orthographe sur le tampon courant +| aspell_suggest | `print,prone,prune` | Suggestions pour le mot sous le curseur (si mal orthographié) +| buffer_count | `10` | Nombre total de tampons ouverts +| buffer_short_name | `#test` | Nom court du tampon courant +| irc_channel | `#test` | Nom de canal IRC courant +| irc_nick_modes | `@` | Modes IRC pour le pseudo +| mouse_status | `M` | Statut de la souris (vide si la souris est désactivée) +| window_number | `2` | Numéro de la fenêtre courante +|=== + [[buffers_and_windows]] === Tampons et fenêtres @@ -1438,7 +1459,7 @@ Exemple : affichage de "bonjour tout le monde !" avec "bonjour" en bleu clair gras, et "tout le monde" en rouge clair souligné : ---- -^Cc12^Cbbonjour ^Cb^Cc04^Cutout le monde^Cu^Cc ! +^Cc12^Cbbonjour ^Cb^Cc04^C_tout le monde^C_^Cc ! ---- [NOTE] @@ -1630,7 +1651,7 @@ Le chiffrement des données se fait en 3 étapes : . Dériver une clé de la phrase secrète (avec du salage en option). . Calculer la somme de contrôle des données à chiffrer. -. Chiffrer la seomme de contrôle + les données (la sortie est : sel + somme de +. Chiffrer la somme de contrôle + les données (la sortie est : sel + somme de contrôle et données chiffrées). [NOTE] @@ -2026,8 +2047,8 @@ Sections : [width="100%",cols="3m,6m,16",options="header"] |=== | Section | Commande de contrôle | Description -| command | /set exec.command.* | Options for commands -| color | /set exec.color.* | Colors +| command | /set exec.command.* | Options pour les commandes +| color | /set exec.color.* | Couleurs |=== Options : @@ -3155,17 +3176,17 @@ caractères identiques). Les groupes de correspondance peuvent être utilisés dans le "remplacement" : -* `$0` à `$99` : `$0` est la correspondance complète, `$1` à `$99` sont les - groupes capturés -* `$+` : la dernière correspondance (avec le numéro le plus élevé) -* `$.cN` : la correspondance "N" avec tous les caractères remplacés par "c" - (exemple : `$.*2` est le groupe n°2 avec tous les caractères remplacés par - `*`). +* `${re:0}` à `${re:99}` : `${re:0}` est la correspondance complète, `${re:1}` + à `${re:99}` sont les groupes capturés +* `${re:+}` : la dernière correspondance (avec le numéro le plus élevé) +* `${hide:c,${re:N}}` : la correspondance "N" avec tous les caractères + remplacés par "c" (exemple : `${hide:*,${re:2}}` est le groupe n°2 avec tous + les caractères remplacés par `*`). Exemple : utiliser du gras pour les mots entre "*" : ---- -/\*(\S+)\*/*${color:bold}$1${color:-bold}*/ +/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/ ---- Exemple : le trigger par défaut 'server_pass' utilise cette expression régulière @@ -3173,7 +3194,7 @@ pour cacher le mot de passe dans les commandes `/server` et `/connect` (les caractères des mots de passe sont remplacés par `*`) : ---- -==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5 +==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5} ---- [NOTE] @@ -3239,7 +3260,7 @@ suivantes sont ajoutées dans la table de hachage : | message_without_tags | chaîne | Message sans les étiquettes | nick | chaîne | Pseudo | host | chaîne | Nom d'hôte -| command | chaîne | Commane IRC (exemple : "PRIVMSG", "NOTICE", ...) +| command | chaîne | Commande IRC (exemple : "PRIVMSG", "NOTICE", ...) | channel | chaîne | Canal IRC | arguments | chaîne | Paramètres de la commande (inclut la valeur de 'channel') |=== @@ -3300,7 +3321,7 @@ Le callback "print" définit les variables suivantes dans la table de hachage : [width="100%",cols="3m,2,14",options="header"] |=== | Variable | Type | Description -| buffer | pointeur | Buffer +| buffer | pointeur | Tampon | tg_date | chaîne | Date/heure du message (format : `YYYY-MM-DD hh:mm:ss`) | tg_displayed | chaîne | "1" si affiché, "0" si ligne filtrée | tg_highlight | chaîne | "1" si highlight, sinon "0" diff --git a/doc/it/autogen/plugin_api/completions.asciidoc b/doc/it/autogen/plugin_api/completions.asciidoc index 1921b0889..623f9182b 100644 --- a/doc/it/autogen/plugin_api/completions.asciidoc +++ b/doc/it/autogen/plugin_api/completions.asciidoc @@ -86,6 +86,8 @@ | trigger | trigger_names | triggers +| trigger | trigger_names_default | default triggers + | trigger | trigger_option_value | value of a trigger option | trigger | trigger_options | options for triggers diff --git a/doc/it/autogen/plugin_api/hdata.asciidoc b/doc/it/autogen/plugin_api/hdata.asciidoc index e5eda92e4..5c70d6c63 100644 --- a/doc/it/autogen/plugin_api/hdata.asciidoc +++ b/doc/it/autogen/plugin_api/hdata.asciidoc @@ -586,21 +586,13 @@ *** 'direction' (integer) *** 'add_space' (integer) *** 'force_partial_completion' (integer) -*** 'completion_list' (pointer) +*** 'list' (pointer) *** 'word_found' (string) *** 'word_found_is_nick' (integer) *** 'position_replace' (integer) *** 'diff_size' (integer) *** 'diff_length' (integer) -*** 'partial_completion_list' (pointer, hdata: "completion_partial") -*** 'last_partial_completion' (pointer, hdata: "completion_partial") -* 'completion_partial': struttura con completamento parziale -** plugin: weechat -** variables: -*** 'word' (string) -*** 'count' (integer) -*** 'prev_item' (pointer, hdata: "completion_partial") -*** 'next_item' (pointer, hdata: "completion_partial") +*** 'partial_list' (pointer) * 'config_file': file di configurazione ** plugin: weechat ** variables: diff --git a/doc/it/autogen/user/irc_commands.asciidoc b/doc/it/autogen/user/irc_commands.asciidoc index b4ddb59d5..6e7837b30 100644 --- a/doc/it/autogen/user/irc_commands.asciidoc +++ b/doc/it/autogen/user/irc_commands.asciidoc @@ -89,8 +89,9 @@ Without argument, this command display ban list for current channel. server: server name, which can be: - internal server name (created by /server add, recommended usage) - - hostname/port or IP/port (this will create a TEMPORARY server), port is 6667 by default + - hostname/port or IP/port, port is 6667 by default - URL with format: irc[6][s]://[nickname[:password]@]irc.example.org[:port][/#channel1][,#channel2[...]] + Note: for an address/IP/URL, a temporary server is created (NOT SAVED), see /help irc.look.temporary_servers option: set option for server (for boolean option, value can be omitted) nooption: set boolean option to 'off' (for example: -nossl) -all: connect to all servers defined in configuration @@ -631,7 +632,7 @@ canale: nome del canale [command]*`samode`* cambia modalità sul canale, senza avere lo status di operatore:: ---- -/samode <canale> <modalità> +/samode [<channel>] <mode> canale: nome del canale modalità: modalità per il canale diff --git a/doc/it/autogen/user/irc_options.asciidoc b/doc/it/autogen/user/irc_options.asciidoc index 6dd8c870b..6667c34f9 100644 --- a/doc/it/autogen/user/irc_options.asciidoc +++ b/doc/it/autogen/user/irc_options.asciidoc @@ -343,6 +343,11 @@ ** tipo: bool ** valori: on, off (valore predefinito: `on`) +* [[option_irc.look.temporary_servers]] *irc.look.temporary_servers* +** descrizione: `enable creation of temporary servers with command /connect` +** tipo: bool +** valori: on, off (valore predefinito: `off`) + * [[option_irc.look.topic_strip_colors]] *irc.look.topic_strip_colors* ** descrizione: `elimina colori nell'argomento (usato solo quando mostrato il titolo del buffer)` ** tipo: bool @@ -479,7 +484,7 @@ ** valori: 0 .. 1000000 (valore predefinito: `25`) * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** descrizione: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, multi-prefix, server-time, userhost-in-names, (example: "away-notify,multi-prefix")` +** descrizione: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, extended-join, multi-prefix, server-time, userhost-in-names (example: "away-notify,multi-prefix")` ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `""`) @@ -591,7 +596,7 @@ * [[option_irc.server_default.ssl_priorities]] *irc.server_default.ssl_priorities* ** descrizione: `stringa con le priorità per gnutls (per la sintassi, consultare la documentazione per la funzione gnutls_priority_init nel manuale di gnutls, stringhe comuni sono: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` ** tipo: stringa -** valori: qualsiasi stringa (valore predefinito: `"NORMAL"`) +** valori: qualsiasi stringa (valore predefinito: `"NORMAL:-VERS-SSL3.0"`) * [[option_irc.server_default.ssl_verify]] *irc.server_default.ssl_verify* ** descrizione: `verifica che la connessione SSL sia totalmente fidata` diff --git a/doc/it/autogen/user/relay_commands.asciidoc b/doc/it/autogen/user/relay_commands.asciidoc index 76179fb76..c34d7fd82 100644 --- a/doc/it/autogen/user/relay_commands.asciidoc +++ b/doc/it/autogen/user/relay_commands.asciidoc @@ -3,44 +3,52 @@ ---- /relay list|listfull|listrelay - add [ipv4.][ipv6.][ssl.]<protocollo.nome> <porta> - del [ipv4.][ipv6.][ssl.]<protocollo.nome> + add <name> <port> + del|stop|restart <name> raw sslcertkey - list: elenca i client relay (solo quelli attivi) - listfull: elenca i client relay (dettagliato, tutti i relay) - listrelay: elenca i relay (nome e porta) - add: aggiunge relay per un protocollo + nome - del: rimuove relay per un protocollo + nome - ipv4: forza l'uso del protocollo IPv4 - ipv6: forza l'uso del protocollo IPv6 - ssl: abilita SSL -protocollo.nome: protocollo e nome con cui effettuare il relay - - protocollo "irc": il nome è il server da condividere - (opzionale, -se non fornito, il nome del server deve essere inviato dal client nel comando "PASS", con il formato: "PASS server:password") - - protocollo "weechat" (il nome non viene usato) - porta: porta usata per il relay - raw: apre il buffer con dati raw Relay - sslcertkey: imposta chiave/certificato SSl usando un path nell'opzione relay.network.ssl_cert_key + list: list relay clients (only active relays) + listfull: list relay clients (verbose, all relays) + listrelay: list relays (name and port) + add: add a relay (listen on a port) + del: remove a relay (clients remain connected) + stop: close the server socket (clients remain connected) + restart: close the server socket and listen again on port (clients remain connected) + name: relay name (see format below) + port: port used for relay + raw: open buffer with raw Relay data + sslcertkey: set SSL certificate/key using path in option relay.network.ssl_cert_key -Senza argomento, il comando apre i buffer con l'elenco dei client relay. +Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name> + ipv4: force use of IPv4 + ipv6: force use of IPv6 + ssl: enable SSL +protocol.name: protocol and name to relay: + - protocol "irc": name is the server to share (optional, if not given, the server name must be sent by client in command "PASS", with format: "PASS server:password") + - protocol "weechat" (name is not used) -Esempi: - proxy irc, per il server "freenode": +The "irc" protocol allows any IRC client (including WeeChat itself) to connect on the port. +The "weechat" protocol allows a remote interface to connect on the port, see the list here: http://weechat.org/download/ + +Without argument, this command opens buffer with list of relay clients. + +Examples: + irc proxy, for server "freenode": /relay add irc.freenode 8000 - irc proxy, per il server "freenode", con SSL: + irc proxy, for server "freenode", with SSL: /relay add ssl.irc.freenode 8001 - protocollo weechat: + irc proxy, for all servers (client will choose), with SSL: + /relay add ssl.irc 8002 + weechat protocol: /relay add weechat 9000 - protocollo weechat con SSL: + weechat protocol with SSL: /relay add ssl.weechat 9001 - protocollo weechat con SSL, usando solo IPv4: + weechat protocol with SSL, using only IPv4: /relay add ipv4.ssl.weechat 9001 - protocollo weechat con SSL, usando solo IPv6: + weechat protocol with SSL, using only IPv6: /relay add ipv6.ssl.weechat 9001 - protocollo weechat con SSL, usando IPv4 + IPv6: + weechat protocol with SSL, using IPv4 + IPv6: /relay add ipv4.ipv6.ssl.weechat 9001 ---- diff --git a/doc/it/autogen/user/relay_options.asciidoc b/doc/it/autogen/user/relay_options.asciidoc index 22b29063d..4b357066c 100644 --- a/doc/it/autogen/user/relay_options.asciidoc +++ b/doc/it/autogen/user/relay_options.asciidoc @@ -59,7 +59,7 @@ ** valori: on, off (valore predefinito: `on`) * [[option_relay.irc.backlog_tags]] *relay.irc.backlog_tags* -** descrizione: `tags of messages which are displayed in backlog per IRC channel (supported tags: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = all supported tags` +** descrizione: `comma-separated list of messages tags which are displayed in backlog per IRC channel (supported tags: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = all supported tags` ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `"irc_privmsg"`) @@ -118,6 +118,11 @@ ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `"%h/ssl/relay.pem"`) +* [[option_relay.network.ssl_priorities]] *relay.network.ssl_priorities* +** descrizione: `stringa con le priorità per gnutls (per la sintassi, consultare la documentazione per la funzione gnutls_priority_init nel manuale di gnutls, stringhe comuni sono: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` +** tipo: stringa +** valori: qualsiasi stringa (valore predefinito: `"NORMAL:-VERS-SSL3.0"`) + * [[option_relay.network.websocket_allowed_origins]] *relay.network.websocket_allowed_origins* ** descrizione: `POSIX extended regular expression with origins allowed in websockets (case insensitive, use "(?-i)" at beginning to make it case sensitive), example: "^http://(www\.)?example\.(com|org)"` ** tipo: stringa diff --git a/doc/it/autogen/user/trigger_commands.asciidoc b/doc/it/autogen/user/trigger_commands.asciidoc index 5f3c36ac2..8624d9843 100644 --- a/doc/it/autogen/user/trigger_commands.asciidoc +++ b/doc/it/autogen/user/trigger_commands.asciidoc @@ -12,6 +12,7 @@ restart <name>|-all [<name>...] show <name> del <name>|-all [<name>...] + restore <name> [<name>...] default -yes monitor [<filter>] @@ -54,7 +55,8 @@ return_code: return code in callback (ok (default), ok_eat, error) show: show detailed info on a trigger (with some stats) del: delete a trigger -all: do action on all triggers - default: restore default triggers + restore: restore trigger(s) with the default values (works only for default triggers) + default: delete all triggers and restore default ones monitor: open the trigger monitor buffer, with optional filter: filter: filter hooks/triggers to display (a hook must start with "@", for example "@signal"), many filters can be separated by commas; wildcard "*" is allowed in each trigger name @@ -66,7 +68,7 @@ When a trigger callback is called, following actions are performed, in this orde Examples (you can also look at default triggers with /trigger listdefault): add text attributes *bold*, _underline_ and /italic/ (only in user messages): - /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}/" + /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/" hide nicklist bar on small terminals: /trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist" /trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist" diff --git a/doc/it/autogen/user/weechat_commands.asciidoc b/doc/it/autogen/user/weechat_commands.asciidoc index 53de0792e..0fd27d73c 100644 --- a/doc/it/autogen/user/weechat_commands.asciidoc +++ b/doc/it/autogen/user/weechat_commands.asciidoc @@ -260,11 +260,12 @@ To force a string comparison, add double quotes around each expression, for exam Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: 1. a string with escaped chars (format: "esc:xxx" or "\xxx") - 2. a color (format: "color:xxx") - 3. an info (format: "info:name,arguments", arguments are optional) - 4. an option (format: "file.section.option") - 5. a local variable in buffer - 6. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. + 2. a string with chars to hide (format: "hide:char,string") + 3. a color (format: "color:xxx") + 4. an info (format: "info:name,arguments", arguments are optional) + 5. an option (format: "file.section.option") + 6. a local variable in buffer + 7. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. Format for hdata can be one of following: hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed) hdata[list].var1.var2...: start with a hdata using a list, for example: @@ -273,23 +274,24 @@ Format for hdata can be one of following: For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". Examples (simple strings): - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${\t} ==> <tab> + /eval -n ${hide:-,${relay.network.password}} ==> -------- Examples (conditions): - /eval -n -c ${window.buffer.number} > 2 ==> 0 - /eval -n -c ${window.win_width} > 100 ==> 1 - /eval -n -c (8 > 12) || (5 > 2) ==> 1 - /eval -n -c (8 > 12) && (5 > 2) ==> 0 - /eval -n -c abcd =~ ^ABC ==> 1 - /eval -n -c abcd =~ (?-i)^ABC ==> 0 - /eval -n -c abcd =~ (?-i)^abc ==> 1 - /eval -n -c abcd !~ abc ==> 0 + /eval -n -c ${window.buffer.number} > 2 ==> 0 + /eval -n -c ${window.win_width} > 100 ==> 1 + /eval -n -c (8 > 12) || (5 > 2) ==> 1 + /eval -n -c (8 > 12) && (5 > 2) ==> 0 + /eval -n -c abcd =~ ^ABC ==> 1 + /eval -n -c abcd =~ (?-i)^ABC ==> 0 + /eval -n -c abcd =~ (?-i)^abc ==> 1 + /eval -n -c abcd !~ abc ==> 0 ---- [[command_weechat_filter]] @@ -312,7 +314,7 @@ disable: disable filters del: delete a filter -all: delete all filters buffer: comma separated list of buffers where filter is active: - - this is full name including plugin (example: "irc.freenode.#weechat") + - this is full name including plugin (example: "irc.freenode.#weechat" or "irc.server.freenode") - "*" means all buffers - a name starting with '!' is excluded - wildcard "*" is allowed diff --git a/doc/it/autogen/user/weechat_options.asciidoc b/doc/it/autogen/user/weechat_options.asciidoc index 582ee9b38..fdaf40bf9 100644 --- a/doc/it/autogen/user/weechat_options.asciidoc +++ b/doc/it/autogen/user/weechat_options.asciidoc @@ -69,17 +69,17 @@ ** valori: qualsiasi stringa (valore predefinito: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) * [[option_weechat.color.chat_nick_offline]] *weechat.color.chat_nick_offline* -** descrizione: `colore del testo per i nick non in linea (non più in lista nick)` +** descrizione: `text color for offline nick (not in nicklist any more); this color is used only if option weechat.look.color_nick_offline is enabled` ** tipo: colore ** valori: 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 (valore predefinito: `default`) * [[option_weechat.color.chat_nick_offline_highlight]] *weechat.color.chat_nick_offline_highlight* -** descrizione: `colore del testo per i nick non in linea con highlight` +** descrizione: `text color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** tipo: colore ** valori: 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 (valore predefinito: `default`) * [[option_weechat.color.chat_nick_offline_highlight_bg]] *weechat.color.chat_nick_offline_highlight_bg* -** descrizione: `colore di sfondo per i nick non in linea con highlight` +** descrizione: `background color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** tipo: colore ** valori: 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 (valore predefinito: `blue`) @@ -283,6 +283,11 @@ ** tipo: colore ** valori: 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 (valore predefinito: `yellow`) +* [[option_weechat.color.status_mouse]] *weechat.color.status_mouse* +** descrizione: `text color for mouse indicator in status bar` +** tipo: colore +** valori: 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 (valore predefinito: `green`) + * [[option_weechat.color.status_name]] *weechat.color.status_name* ** descrizione: `colore del testo per il nome del buffer corrente nella barra di stato` ** tipo: colore @@ -313,6 +318,11 @@ ** tipo: bool ** valori: on, off (valore predefinito: `on`) +* [[option_weechat.completion.command_inline]] *weechat.completion.command_inline* +** descrizione: `if enabled, the commands inside command line are completed (the command at beginning of line has higher priority and is used first); note: when this option is enabled, there is no more automatic completion of paths beginning with '/' (outside commands arguments)` +** tipo: bool +** valori: on, off (valore predefinito: `on`) + * [[option_weechat.completion.default_template]] *weechat.completion.default_template* ** descrizione: `modello di completamento predefinito (per favore, consulta la documentazione per codici e valori del template: Referenze API per Plugin, funzione "weechat_hook_command")` ** tipo: stringa @@ -518,6 +528,11 @@ ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `""`) +* [[option_weechat.look.command_incomplete]] *weechat.look.command_incomplete* +** descrizione: `if set, incomplete and unambiguous commands are allowed, for example /he for /help` +** tipo: bool +** valori: on, off (valore predefinito: `off`) + * [[option_weechat.look.confirm_quit]] *weechat.look.confirm_quit* ** descrizione: `se impostata, il comando /quit deve essere confermato con l'argomento extra "-yes" (consultare /help quit)` ** tipo: bool @@ -663,6 +678,11 @@ ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `"!"`) +* [[option_weechat.look.item_mouse_status]] *weechat.look.item_mouse_status* +** descrizione: `string used to show if mouse is enabled (bar item "mouse_status")` +** tipo: stringa +** valori: qualsiasi stringa (valore predefinito: `"M"`) + * [[option_weechat.look.item_time_format]] *weechat.look.item_time_format* ** descrizione: `formato dell'ora per l'elemento barra "time" (consultare man strftime per gli specificatori data/ora)` ** tipo: stringa diff --git a/doc/it/weechat_faq.it.asciidoc b/doc/it/weechat_faq.it.asciidoc index 2255dfd81..1cea14fbc 100644 --- a/doc/it/weechat_faq.it.asciidoc +++ b/doc/it/weechat_faq.it.asciidoc @@ -54,6 +54,24 @@ il repository git. È bene notare che potrebbe non corrispondere esattamente alla base git ed è meno conveniente rispetto al clone di git per l'installazione degli aggiornamenti. +// TRANSLATION MISSING +[[compile_osx]] +=== How can I install WeeChat on OS X? + +// TRANSLATION MISSING +It is recommended to use http://brew.sh/[Homebrew], you can get help with: + +---- +brew info weechat +---- + +// TRANSLATION MISSING +You can install WeeChat with this command: + +---- +brew install weechat --with-python --with-perl +---- + [[lost]] === Ho avviato WeeChat, ma mi sono perso, cosa posso fare? @@ -679,7 +697,21 @@ Per WeeChat ≤ 0.3.3, le opzioni sono 'irc.network.away_check' e [[highlight_notification]] === Come posso essere avvisato quando qualcuno mi cerca in un canale? -È possibile usare script come 'beep.pl" o 'launcher.pl'. +// TRANSLATION MISSING +With WeeChat ≥ 1.0, there is a default trigger "beep" which sends a 'BEL' to +the terminal on a highlight or private message. Thus you can configure your +terminal (or multiplexer like screen/tmux) to run a command or play a sound +when a 'BEL' occurs. + +// TRANSLATION MISSING +Or you can add a command in "beep" trigger: + +---- +/set trigger.trigger.beep.command "/print -beep;/exec -bg /path/del/comando argomenti" +---- + +// TRANSLATION MISSING +With an older WeeChat, you can use a script like 'beep.pl' or 'launcher.pl'. Per 'launcher.pl', bisogna impostare il comando: diff --git a/doc/it/weechat_plugin_api.it.asciidoc b/doc/it/weechat_plugin_api.it.asciidoc index 1d05a074e..01318a8a2 100644 --- a/doc/it/weechat_plugin_api.it.asciidoc +++ b/doc/it/weechat_plugin_api.it.asciidoc @@ -1879,12 +1879,11 @@ str3 = weechat.string_input_for_buffer("//test") # "/test" ==== weechat_string_eval_expression // TRANSLATION MISSING -_WeeChat ≥ 0.4.0, updated in 0.4.2._ +_WeeChat ≥ 0.4.0, updated in 0.4.2 and 1.1._ // TRANSLATION MISSING Evaluate an expression and return result as a string. -Special variables with format `${variable}` are expanded (see command `/eval` in -'WeeChat User's guide'). +Special variables with format `${variable}` are expanded (see table below). // TRANSLATION MISSING [NOTE] @@ -1904,10 +1903,14 @@ char *weechat_string_eval_expression (const char *expr, Argomenti: // TRANSLATION MISSING -* 'expr': the expression to evaluate +* 'expr': the expression to evaluate (see table below) * 'pointers': hashtable with pointers (keys must be string, values must be pointer); pointers "window" and "buffer" are automatically added if they are - not in hashtable (with pointer to current window/buffer) (can be NULL) + not in hashtable (with pointer to current window/buffer) (can be NULL): +** 'regex': pointer to a regular expression ('regex_t' structure) compiled with + WeeChat function <<_weechat_string_regcomp,weechat_string_regcomp>> or + regcomp (see `man regcomp`); this option is similar to 'regex' in hashtable + 'options' (below), but is used for better performance * 'extra_vars': extra variables that will be expanded (can be NULL) * 'options': a hashtable with some options (keys and values must be string) (can be NULL): @@ -1917,6 +1920,11 @@ Argomenti: parentheses are used, result is a boolean ("0" or "1") ** 'prefix': prefix before variables to replace (default: "${") ** 'suffix': suffix after variables to replace (default: "}") +** 'regex': a regex used to replace text in 'expr' (which is then not + evaluated) +** 'regex_replace': the replacement text to use with 'regex', to replace + text in 'expr' (the 'regex_replace' is evaluated on each match of 'regex' + against 'expr', until no match is found) Valore restituito: @@ -1924,20 +1932,109 @@ Valore restituito: * evaluated expression (must be freed by calling "free" after use), or NULL if problem (invalid expression or not enough memory) +// TRANSLATION MISSING +List of variables expanded in expression (by order of priority, from first +expanded to last): + +// TRANSLATION MISSING +[width="100%",cols="2,8,3,3",options="header"] +|=== +| Format | Description | Examples | Results + +| `${name}` | Variable `name` from hashtable 'extra_vars' | + `${name}` | `value` + +| `${esc:xxx}` + + `${\xxx}` | String with escaped chars | + `${esc:prefix\tmessage}` + + `${\ua9}` | + `prefix<TAB>message` + + `©` + +| `${hide:x,value}` | + String with hidden chars (all chars in `value` replaced `x`) | + `${hide:*,password}` | + `********` + +| `${re:N}` | + Regex captured group: 0 = whole string matching, 1 to 99 = group captured, + `+` = last group captured | + `${re:1}` | + `test` + +| `${color:name}` | + WeeChat color code (the name of color has optional attributes) | + `${color:red}red text` + + `${color:*214}bold orange text` | + `red text` (in red) + + `bold orange text` (in bold orange) + +| `${info:name}` + + `${indo:name,arguments}` | + Info from WeeChat or a plugin, see function + <<_weechat_info_get,weechat_info_get>> | + `${info:version}` + + `${info:irc_nick_color_name,foo}` | + `1.0` + + `lightblue` + +| `${sec.data.name}` | + Value of the secured data `name` | + `${sec.data.freenode_pass}` | + `my_password` + +| `${file.section.option}` | + Value of the option | + `${weechat.look.buffer_time_format}` | + `%H:%M:%S` + +| `${name}` | + Value of local variable `name` in buffer | + `${nick}` | + `FlashCode` + +| `${hdata.var1.var2...}` + + `${hdata[list].var1.var2...}` | + Hdata value (pointers `window` and `buffer` are set by default with current + window/buffer) | + `${buffer[gui_buffers].full_name}` + + `${window.buffer.number}` | + `core.weechat` + + `1` +|=== + Esempi in C: [source,C] ---- -struct t_hashtable *options = weechat_hashtable_new (8, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); -if (options) - weechat_hashtable_set (options, "type", "condition"); -char *str1 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ -char *str2 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options); /* "1" */ -char *str3 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options); /* "0" */ +/* conditions */ +struct t_hashtable *options1 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options1, "type", "condition"); +char *str1 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options1); /* "1" */ +char *str2 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options1); /* "0" */ + +/* simple expression */ +char *str3 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ + +/* replace with regex */ +struct t_hashtable *options2 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +/* add brackets around URLs */ +weechat_hashtable_set (options2, "regex", "\\w+://\\S+"); +weechat_hashtable_set (options2, "regex_replace", "[ ${re:0} ]"); +char *str4 = weechat_string_eval_expression ("test: http://weechat.org", NULL, NULL, NULL); /* "test: [ http://weechat.org ]" */ + +/* hide passwords */ +weechat_hashtable_set (options2, "regex", "(password=)(\\S+)"); +weechat_hashtable_set (options2, "regex_replace", "${re:1}${hide:*,${re:2}}"); +char *str5 = weechat_string_eval_expression ("password=abc password=def", NULL, NULL, NULL); /* "password=*** password=***" */ ---- Script (Python): @@ -1948,9 +2045,27 @@ Script (Python): str = weechat.string_eval_expression(expr, pointers, extra_vars, options) # esempi -str1 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" -str2 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" -str3 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" + +# conditions +str1 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" +str2 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" + +# simple expression +str3 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" + +# replace with regex: add brackets around URLs +options = { + "regex": "\\w+://\\S+", + "regex_replace": "[ ${re:0} ]", +} +str4 = weechat.string_eval_expression("test: http://weechat.org", {}, {}, options) # "test: [ http://weechat.org ]" + +# replace with regex: hide passwords +options = { + "regex": "(password=)(\\S+)", + "regex_replace": "${re:1}${hide:*,${re:2}}", +} +str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, options) # "password=*** password=***" ---- [[utf-8]] @@ -2736,13 +2851,17 @@ Questa funzione non è disponibile nelle API per lo scripting. ==== weechat_util_timeval_diff -Restituisce la differenza (in millisecondi) tra due strutture "timeval". +// TRANSLATION MISSING +_Updated in 1.1._ + +// TRANSLATION MISSING +Return difference (in microseconds) between two "timeval" structures. Prototipo: [source,C] ---- -long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); +long long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); ---- Argomenti: @@ -2752,13 +2871,18 @@ Argomenti: Valore restituito: -* differenza in millisecondi +// TRANSLATION MISSING +* difference in microseconds + +// TRANSLATION MISSING +[NOTE] +With WeeChat ≤ 1.0, the returned value was in milliseconds. Esempio in C: [source,C] ---- -long diff = weechat_util_timeval_diff (&tv1, &tv2); +long long diff = weechat_util_timeval_diff (&tv1, &tv2); ---- [NOTE] @@ -2766,25 +2890,34 @@ Questa funzione non è disponibile nelle API per lo scripting. ==== weechat_util_timeval_add -Aggiungi intervallo (in millisecondi) ad una struttura timeval. +// TRANSLATION MISSING +_Updated in 1.1._ + +// TRANSLATION MISSING +Add interval (in microseconds) to a timeval structure. Prototipo: [source,C] ---- -void weechat_util_timeval_add (struct timeval *tv, long interval); +void weechat_util_timeval_add (struct timeval *tv, long long interval); ---- Argomenti: * 'tv': struttura timeval -* 'interval': intervallo (in millisecondi) +// TRANSLATION MISSING +* 'interval': interval (in microseconds) + +// TRANSLATION MISSING +[NOTE] +With WeeChat ≤ 1.0, the interval was expressed in milliseconds. Esempio in C: [source,C] ---- -weechat_util_timeval_add (&tv, 2000); /* aggiunge 2 secondi */ +weechat_util_timeval_add (&tv, 2000000); /* aggiunge 2 secondi */ ---- [NOTE] @@ -8350,6 +8483,18 @@ List of signals sent by WeeChat and plugins: Key combo in 'cursor' context // TRANSLATION MISSING +| weechat | mouse_enabled + + _(WeeChat ≥ 1.1)_ | + - | + Mouse enabled + +// TRANSLATION MISSING +| weechat | mouse_disabled + + _(WeeChat ≥ 1.1)_ | + - | + Mouse disabled + +// TRANSLATION MISSING | weechat | nicklist_group_added + _(WeeChat ≥ 0.3.2)_ | String: buffer pointer + "," + group name | diff --git a/doc/it/weechat_user.it.asciidoc b/doc/it/weechat_user.it.asciidoc index 422d0bff2..bc5c8762f 100644 --- a/doc/it/weechat_user.it.asciidoc +++ b/doc/it/weechat_user.it.asciidoc @@ -48,7 +48,8 @@ Per poter installare WeeChat, è necessario: compilazione per i sorgenti), oppure OS compatibile * privilegi di 'root' (per installare WeeChat in una directory di sistema) -* librerie ncurses +// TRANSLATION MISSING +* some libraries (see <<dependencies,dependencies>>). [[install]] == Installazione @@ -79,6 +80,12 @@ installazione. WeeChat può essere compilato con cmake oppure autotools (tuttavia si raccomanda cmake). +// TRANSLATION MISSING +[NOTE] +On OS X, you can use http://brew.sh/[Homebrew]: +`brew install weechat --with-python --with-perl` +(for help: `brew info weechat`). + [[dependencies]] ==== Dipendenze @@ -89,21 +96,23 @@ compilare WeeChat. |=== | Pacchetto ^(1)^ | Versione | Richiesto | Caratteristica | cmake | | *sì* | Compilazione (ancora possibile con autotools, ma si raccomanda cmake) +// TRANSLATION MISSING +| pkg-config | | *sì* | Detect installed libraries | libncursesw5-dev ^(2)^ | | *sì* | Interfaccia ncurses | libcurl4-gnutls-dev | | *sì* | Trasferimento URL // TRANSLATION MISSING | zlib1g-dev | | *sì* | Compression of packets in relay plugin (weechat protocol), script plugin // TRANSLATION MISSING -| libgcrypt11-dev | | *sì* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin +| libgcrypt20-dev | | *sì* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin // TRANSLATION MISSING -| libgnutls-dev | ≥ 2.2.0 | | Connessione SSL al server IRC, support of SSL in relay plugin +| libgnutls28-dev | ≥ 2.2.0 | | Connessione SSL al server IRC, support of SSL in relay plugin | gettext | | | Internazionalizzazione (traduzione dei messaggi; la lingua base è l'inglese) | ca-certificates | | | Certificati per le connessioni SSL | libaspell-dev o libenchant-dev | | | Plugin aspell | python-dev | ≥ 2.5 ^(3)^ | | Plugin python | libperl-dev | | | Plugin perl -| ruby1.9.1-dev | ≥ 1.8 | | Plugin ruby -| liblua5.1-0-dev | | | Plugin lua +| ruby2.1-dev | ≥ 1.8 | | Plugin ruby +| liblua5.2-dev | | | Plugin lua | tcl-dev | ≥ 8.5 | | Plugin tcl | guile-2.0-dev | ≥ 2.0 | | Plugin guile (scheme) // TRANSLATION MISSING @@ -524,11 +533,12 @@ Lo schermo è composto dalle seguenti aree: La barra 'stato' ha i seguenti elementi predefiniti: -[width="100%",cols="^3,^3,10",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Elemento | Esempio | Descrizione | time | `[12:55]` | Ora -| buffer_count | `[6]` | Numero di buffer aperti +// TRANSLATION MISSING +| buffer_last_number | `[6]` | Number of last buffer in list | buffer_plugin | `[irc/freenode]` | Plugin del buffer attivo (il plugin irc può aggiungere il nome del server irc usato dal buffer) | buffer_number | `3` | Numero del buffer corrente | buffer_name | `#test` | Nome del buffer attivo @@ -537,26 +547,43 @@ La barra 'stato' ha i seguenti elementi predefiniti: // TRANSLATION MISSING | buffer_zoom | ! | `!` means the merged buffer is zoomed (only this one is displayed), empty value means all merged buffers are displayed | buffer_filter | `*` | Indicatore filtraggio: `*` significa che alcune righe sono filtrate (nascoste), valori vuoti indicano che tutte le righe sono visualizzate +| scroll | `-ANCORA(50)-` | Indicatore di scorrimento, con il numero di righe sotto l'ultima riga visualizzata | lag | `[Ritardo: 2.5]` | Indicatore ritardo, in secondi (nascosto se il ritardo è basso) | hotlist | `[H: 4:#abc(2,5), 6]` | Elenco dei buffer con attività (messaggi non letti) (nell'esempio, 2 notifiche e 5 messaggi non letti su #abc, un messaggio non letto sul buffer #6) | completion | `abc(2) def(5)` | Elenco di parole per il completamento, con il numero di completamenti possibili per ogni parola -| scroll | `-ANCORA(50)-` | Indicatore di scorrimento, con il numero di righe sotto l'ultima riga visualizzata |=== La barra 'input' ha i seguenti elementi predefiniti: -[width="100%",cols="^3,^6,8",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Elemento | Esempio | Descrizione -| input_paste | `[Incollare 7 righe ? [ctrl-Y] Sì [ctrl-N] No]` | Chiede all'utente se incollare le righe // TRANSLATION MISSING | input_prompt | `[@Flashy(i)]` | Prompt per l'input, for irc: nick and modes (mode "+i" means invisible on freenode) | away | `(assente)` | Indicatore di assenza // TRANSLATION MISSING | input_search | `[Search (~ str,msg)]` | Search indicator ("`~`": case insensitive, "`==`": case sensitive, "`str`": search string, "`regex`": search regular expression, "`msg`": search in messages, "`pre`": search in prefixes, "`pre\|msg`": search in prefixes and messages) +| input_paste | `[Incollare 7 righe ? [ctrl-Y] Sì [ctrl-N] No]` | Chiede all'utente se incollare le righe | input_text | `ciao peter!` | Testo in input |=== +// TRANSLATION MISSING +Other items available (not used in bars by default): + +// TRANSLATION MISSING +[width="100%",cols="^3,^4,10",options="header"] +|=== +| Item | Example | Description +| aspell_dict | `fr,en` | Spelling dictionaries used on current buffer +| aspell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled) +| buffer_count | `10` | Total number of buffers opened +| buffer_short_name | `#test` | Current buffer short name +| irc_channel | `#test` | Current IRC channel name +| irc_nick_modes | `@` | IRC modes for self nick +| mouse_status | `M` | Mouse status (empty if mouse is disabled) +| window_number | `2` | Current window number +|=== + [[buffers_and_windows]] === Buffer e finestre @@ -1454,7 +1481,7 @@ Esempio: visualizza "ciao a tutti!" con "ciao" scritto in blu chiaro grassetto e "a tutti" in rosso chiaro sottolineato: ---- -^Cc12^Cbciao ^Cb^Cc04^Cua tutti^Cu^Cc ! +^Cc12^Cbciao ^Cb^Cc04^C_a tutti^C_^Cc ! ---- [NOTE] @@ -3194,15 +3221,17 @@ The char "/" can be replaced by any char (one or more identical chars). Matching groups can be used in "replace": -* `$0` to `$99`: `$0` is the whole match, `$1` to `$99` are groups captured -* `$+`: the last match (with highest number) -* `$.cN`: match "N" with all chars replaced by "c" (example: `$.*2` is the group - #2 with all chars replaced by `*`). +* `${re:0}` to `${re:99}`: `${re:0}` is the whole match, `${re:1}` to + `${re:99}` are groups captured +* `${re:+}`: the last match (with highest number) +* `${hide:c,${re:N}}`: match "N" with all chars replaced by "c" + (example: `${hide:*,${re:2}}` is the group #2 with all chars replaced by + `*`). Example: use bold for words between "*": ---- -/\*(\S+)\*/*${color:bold}$1${color:-bold}*/ +/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/ ---- Example: default trigger 'server_pass' uses this regular expression to hide @@ -3210,7 +3239,7 @@ password in commands `/server` and `/connect` (chars in passwords are replaced by `*`): ---- -==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5 +==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5} ---- [NOTE] diff --git a/doc/ja/autogen/plugin_api/completions.asciidoc b/doc/ja/autogen/plugin_api/completions.asciidoc index 42b06a73b..9873fe98a 100644 --- a/doc/ja/autogen/plugin_api/completions.asciidoc +++ b/doc/ja/autogen/plugin_api/completions.asciidoc @@ -86,6 +86,8 @@ | trigger | trigger_names | トリガ +| trigger | trigger_names_default | デフォルトトリガ + | trigger | trigger_option_value | トリガオプションの値 | trigger | trigger_options | トリガに対するオプション diff --git a/doc/ja/autogen/plugin_api/hdata.asciidoc b/doc/ja/autogen/plugin_api/hdata.asciidoc index 938caadc6..65e1f906e 100644 --- a/doc/ja/autogen/plugin_api/hdata.asciidoc +++ b/doc/ja/autogen/plugin_api/hdata.asciidoc @@ -586,21 +586,13 @@ *** 'direction' (integer) *** 'add_space' (integer) *** 'force_partial_completion' (integer) -*** 'completion_list' (pointer) +*** 'list' (pointer) *** 'word_found' (string) *** 'word_found_is_nick' (integer) *** 'position_replace' (integer) *** 'diff_size' (integer) *** 'diff_length' (integer) -*** 'partial_completion_list' (pointer, hdata: "completion_partial") -*** 'last_partial_completion' (pointer, hdata: "completion_partial") -* 'completion_partial': 部分補完する構造 -** プラグイン: weechat -** 変数: -*** 'word' (string) -*** 'count' (integer) -*** 'prev_item' (pointer, hdata: "completion_partial") -*** 'next_item' (pointer, hdata: "completion_partial") +*** 'partial_list' (pointer) * 'config_file': 設定ファイル ** プラグイン: weechat ** 変数: diff --git a/doc/ja/autogen/user/aspell_commands.asciidoc b/doc/ja/autogen/user/aspell_commands.asciidoc index fa9f8528f..7c47e19ab 100644 --- a/doc/ja/autogen/user/aspell_commands.asciidoc +++ b/doc/ja/autogen/user/aspell_commands.asciidoc @@ -18,7 +18,7 @@ listdict: インストール済み辞書を表示 いくつかのコマンドを除いて '/' で始まる入力行はチェックされません (/set aspell.check.commands を参照)。 -全てのバッファで aspell を有効化するには、"default_dict" オプションを設定した後に、aspell を有効化してください。例えば: +全てのバッファで aspell を有効化するには、"default_dict" オプションを設定した後に、aspell を有効化してください。例: /set aspell.check.default_dict "en" /aspell enable diff --git a/doc/ja/autogen/user/irc_commands.asciidoc b/doc/ja/autogen/user/irc_commands.asciidoc index a593a32c9..2db5f664d 100644 --- a/doc/ja/autogen/user/irc_commands.asciidoc +++ b/doc/ja/autogen/user/irc_commands.asciidoc @@ -89,8 +89,9 @@ channel: チャンネル名 server: サーバ名、これは: - 内部サーバ名 (/server add で作成されたもの、利用推奨) - - ホスト名/ポート番号、又は IP アドレス/ポート番号 (これは一時的サーバを作る)、デフォルトのポート番号は 6667 + - ホスト名/ポート番号又は IP アドレス/ポート番号、デフォルトのポート番号は 6667 - 次のフォーマットに従う URL: irc[6][s]://[nickname[:password]@]irc.example.org[:port][/#channel1][,#channel2[...]] + 注意: アドレス/IP/URL を指定した場合、サーバを一時的に作ります (保存しません)、/help irc.look.temporary_servers を参照してください。 option: サーバに関するオプション (ブール型オプションでは、value は無視される) nooption: ブール型オプションを 'off' にする (例: -nossl) -all: 設定された全てのサーバに接続 @@ -631,7 +632,7 @@ channel: チャンネル名 [command]*`samode`* チャンネルモードを変更、オペレータ権無しに:: ---- -/samode <channel> <mode> +/samode [<channel>] <mode> channel: チャンネル名 mode: チャンネルモード @@ -684,7 +685,7 @@ listfull: 詳細情報を含めてサーバをリストアップ hostname: サーバのホスト名か IP アドレス、ポート番号は任意 (デフォルト: 6667)、複数のアドレスはコンマで区切る temp: 一時的なサーバを作成 (保存されない) option: サーバのオプションを設定 (ブールオプションでは値が無視される) -nooption: ブールオプションを 'off' に設定 (例えば: -nossl) +nooption: ブールオプションを 'off' に設定 (例: -nossl) copy: サーバを複製 rename: サーバをリネーム keep: 設定ファイルにサーバを保存 (一時的なサーバ用) diff --git a/doc/ja/autogen/user/irc_options.asciidoc b/doc/ja/autogen/user/irc_options.asciidoc index 9061ebd7e..b29b62026 100644 --- a/doc/ja/autogen/user/irc_options.asciidoc +++ b/doc/ja/autogen/user/irc_options.asciidoc @@ -269,7 +269,7 @@ ** 値: on, off (デフォルト値: `on`) * [[option_irc.look.notice_welcome_tags]] *irc.look.notice_welcome_tags* -** 説明: `ようこそ通知に使われ、チャンネルに転送するタグのコンマ区切りリスト、例えば: "notify_private"` +** 説明: `ようこそ通知に使われ、チャンネルに転送するタグのコンマ区切りリスト、例: "notify_private"` ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `""`) @@ -279,7 +279,7 @@ ** 値: 未制約文字列 (デフォルト値: `"notify_message"`) * [[option_irc.look.notify_tags_whois]] *irc.look.notify_tags_whois* -** 説明: `ニックネームの離席状態に変化があった場合の (whois コマンドの結果)、notify によって表示されたメッセージに使われたタグのコンマ区切りリスト、例えば: "notify_message"、"notify_private"、"notify_highlight"` +** 説明: `ニックネームの離席状態に変化があった場合の (whois コマンドの結果)、notify によって表示されたメッセージに使われたタグのコンマ区切りリスト、例: "notify_message"、"notify_private"、"notify_highlight"` ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `"notify_message"`) @@ -294,7 +294,7 @@ ** 値: independent, merge_by_server, merge_all (デフォルト値: `independent`) * [[option_irc.look.pv_tags]] *irc.look.pv_tags* -** 説明: `プライベートメッセージに使われたタグのコンマ区切りリスト、例えば: "notify_message"、"notify_private"、"notify_highlight"` +** 説明: `プライベートメッセージに使われたタグのコンマ区切りリスト、例: "notify_message"、"notify_private"、"notify_highlight"` ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `"notify_private"`) @@ -343,6 +343,11 @@ ** タイプ: ブール ** 値: on, off (デフォルト値: `on`) +* [[option_irc.look.temporary_servers]] *irc.look.temporary_servers* +** 説明: `/connect コマンドによるサーバの一時的な作成を有効化する` +** タイプ: ブール +** 値: on, off (デフォルト値: `off`) + * [[option_irc.look.topic_strip_colors]] *irc.look.topic_strip_colors* ** 説明: `トピックにつけられた色を無効化 (バッファタイルに表示される場合のみ利用)` ** タイプ: ブール @@ -479,7 +484,7 @@ ** 値: 0 .. 1000000 (デフォルト値: `25`) * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** 説明: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, multi-prefix, server-time, userhost-in-names, (example: "away-notify,multi-prefix")` +** 説明: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, extended-join, multi-prefix, server-time, userhost-in-names (example: "away-notify,multi-prefix")` ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `""`) @@ -591,7 +596,7 @@ * [[option_irc.server_default.ssl_priorities]] *irc.server_default.ssl_priorities* ** 説明: `gnutls の優先度を示した文字列 (構文は、gnutls マニュアルの gnutls_priority_init 関数のドキュメントを参照、通例: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` ** タイプ: 文字列 -** 値: 未制約文字列 (デフォルト値: `"NORMAL"`) +** 値: 未制約文字列 (デフォルト値: `"NORMAL:-VERS-SSL3.0"`) * [[option_irc.server_default.ssl_verify]] *irc.server_default.ssl_verify* ** 説明: `SSL 接続が完全に信頼できることを確認` diff --git a/doc/ja/autogen/user/relay_commands.asciidoc b/doc/ja/autogen/user/relay_commands.asciidoc index 6c03dab56..c7f6c2887 100644 --- a/doc/ja/autogen/user/relay_commands.asciidoc +++ b/doc/ja/autogen/user/relay_commands.asciidoc @@ -3,44 +3,52 @@ ---- /relay list|listfull|listrelay - add [ipv4.][ipv6.][ssl.]<protocol.name> <port> - del [ipv4.][ipv6.][ssl.]<protocol.name> + add <name> <port> + del|stop|restart <name> raw sslcertkey - list: リレーするクライアントをリストアップ (アクティブなもののみ) - listfull: リレーするクライアントをリストアップ (詳細、全てのリレー) - listrelay: リレーをリストアップ (名前とポート番号) - add: プロトコル + 名前のリレーを追加 - del: プロトコル + 名前のリレーを削除 - ipv4: IPv4 を強制的に利用 - ipv6: IPv6 を強制的に利用 - ssl: SSL を有効化 -protocol.name: リレーするプロトコルと名前: - - protocol "irc": name は共有するサーバ名 (任意指定、指定しない場合、サーバ名は "PASS" コマンドでクライアントが送信するものと同じでなければいけません、"PASS" コマンドのフォーマットは "PASS server:password") - - protocol "weechat" (name は使われません) - port: リレーに使うポート番号 - raw: 生 Relay データバッファを開く - sslcertkey: オプション relay.network.ssl_cert_key のパスを使って SSL 証明書/鍵を設定 + list: list relay clients (only active relays) + listfull: list relay clients (verbose, all relays) + listrelay: list relays (name and port) + add: add a relay (listen on a port) + del: remove a relay (clients remain connected) + stop: close the server socket (clients remain connected) + restart: close the server socket and listen again on port (clients remain connected) + name: relay name (see format below) + port: port used for relay + raw: open buffer with raw Relay data + sslcertkey: set SSL certificate/key using path in option relay.network.ssl_cert_key -引数無しの場合、リレークライアントのリストを含むバッファを開く +Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name> + ipv4: force use of IPv4 + ipv6: force use of IPv6 + ssl: enable SSL +protocol.name: protocol and name to relay: + - protocol "irc": name is the server to share (optional, if not given, the server name must be sent by client in command "PASS", with format: "PASS server:password") + - protocol "weechat" (name is not used) -例: - サーバ "freenode" に対する irc プロキシを設定: +The "irc" protocol allows any IRC client (including WeeChat itself) to connect on the port. +The "weechat" protocol allows a remote interface to connect on the port, see the list here: http://weechat.org/download/ + +Without argument, this command opens buffer with list of relay clients. + +Examples: + irc proxy, for server "freenode": /relay add irc.freenode 8000 - サーバ "freenode" に対する SSL を有効化した irc プロキシを設定: + irc proxy, for server "freenode", with SSL: /relay add ssl.irc.freenode 8001 - SSL を有効化してすべてのサーバに対する irc プロキシを設定 (クライアントがサーバを選ぶ): + irc proxy, for all servers (client will choose), with SSL: /relay add ssl.irc 8002 - weechat プロトコル: + weechat protocol: /relay add weechat 9000 - SSL を有効化した weechat プロトコル: + weechat protocol with SSL: /relay add ssl.weechat 9001 - SSL を有効にした weechat プロトコル、IPv4 だけを利用: + weechat protocol with SSL, using only IPv4: /relay add ipv4.ssl.weechat 9001 - SSL を有効にした weechat プロトコル、IPv6 だけを利用: + weechat protocol with SSL, using only IPv6: /relay add ipv6.ssl.weechat 9001 - SSL を有効にした weechat プロトコル、IPv4 と IPv6 を利用: + weechat protocol with SSL, using IPv4 + IPv6: /relay add ipv4.ipv6.ssl.weechat 9001 ---- diff --git a/doc/ja/autogen/user/relay_options.asciidoc b/doc/ja/autogen/user/relay_options.asciidoc index fb000e404..15b8e9fe0 100644 --- a/doc/ja/autogen/user/relay_options.asciidoc +++ b/doc/ja/autogen/user/relay_options.asciidoc @@ -59,7 +59,7 @@ ** 値: on, off (デフォルト値: `on`) * [[option_relay.irc.backlog_tags]] *relay.irc.backlog_tags* -** 説明: `IRC チャンネルごとのバックログに表示するメッセージのタグ (利用可能なタグ: "irc_join"、"irc_part"、"irc_quit"、"irc_nick"、"irc_privmsg")、"*" = 利用可能な全てのタグ` +** 説明: `IRC チャンネルごとのバックログに表示するメッセージタグのコンマ区切りリスト (利用可能なタグ: "irc_join"、"irc_part"、"irc_quit"、"irc_nick"、"irc_privmsg")、"*" = 利用可能な全てのタグ` ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `"irc_privmsg"`) @@ -118,6 +118,11 @@ ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `"%h/ssl/relay.pem"`) +* [[option_relay.network.ssl_priorities]] *relay.network.ssl_priorities* +** 説明: `gnutls の優先度を示した文字列 (構文は、gnutls マニュアルの gnutls_priority_init 関数のドキュメントを参照、通例: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` +** タイプ: 文字列 +** 値: 未制約文字列 (デフォルト値: `"NORMAL:-VERS-SSL3.0"`) + * [[option_relay.network.websocket_allowed_origins]] *relay.network.websocket_allowed_origins* ** 説明: `ウェブソケットに使うことを許可する origin の "POSIX 拡張正規表現 (大文字小文字を区別しない、"(?-i)" を先頭に置くと大文字小文字を区別する)、例: "^http://(www\.)?example\.(com|org)"` ** タイプ: 文字列 diff --git a/doc/ja/autogen/user/trigger_commands.asciidoc b/doc/ja/autogen/user/trigger_commands.asciidoc index a0d8e79dc..a3ce86ced 100644 --- a/doc/ja/autogen/user/trigger_commands.asciidoc +++ b/doc/ja/autogen/user/trigger_commands.asciidoc @@ -12,67 +12,69 @@ restart <name>|-all [<name>...] show <name> del <name>|-all [<name>...] + restore <name> [<name>...] default -yes monitor [<filter>] - list: トリガをリストアップ (引数なしの場合、このリストを表示します) - listfull: 各トリガに関する詳細な情報を付けてトリガをリストアップ -listdefault: デフォルトトリガをリストアップ - add: トリガを追加 - addoff: トリガを追加 (無効状態で) - addreplace: 追加または存在するトリガを置換 - name: トリガの名前 - hook: signal、hsignal、modifier、print、command、command_run、timer、config、focus - arguments: フックの引数、フックの種類に依存 (セミコロンで区切る): - signal: シグナルの名前 (必須) - hsignal: hsignal の名前 (必須) - modifier: modifier の名前 (必須) - print: バッファ、タグ、メッセージ、色の削除 - command: コマンド (必須)、説明、引数、引数の説明、補完 - command_run: コマンド (必須) - timer: インターバル (必須)、秒の調節、最大呼び出し回数 - config: オプションの名前 (必須) - focus: エリアの名前 (必須) - conditions: トリガの実行条件 - regex: 変数内の文字列を置換する 1 つ以上の正規表現 - command: 実行するコマンド (複数のコマンドは ";" で区切ってください) -return_code: コールバック内のリターンコード (ok (デフォルト)、ok_eat、error) - addinput: 入力にトリガを作る際のデフォルト引数を設定 - input: 入力にトリガを作る際に使われるコマンドを設定 - output: バッファでトリガを作る際のコマンドを送信 - recreate: "add" の代わりに "addreplace" オプションを使うことを除いて "input" と同じ - set: トリガにオプションを設定 - option: オプションの名前: name、hook、arguments、conditions、regex、command、return_code - (オプションに関するヘルプを見るには: /help trigger.trigger.<name>.<option>) - value: オプションの新しい値 - rename: トリガの名前を変更 - copy: トリガをコピー - enable: トリガを有効化 (引数なしの場合: 大域的にトリガを有効化) - disable: トリガを無効化 (引数なしの場合: 大域的にトリガを無効化) - toggle: トリガの有効無効を切り替え (引数なしの場合: 大域的にトリガの有効無効を切り替え) - restart: トリガの再開 (フックを再作成) - show: トリガに関する情報を表示 (状態を含めて) - del: トリガを削除 - -all: 全てのトリガに関するアクションを実行 - default: デフォルトトリガを復元 - monitor: 任意でフィルタを付けてトリガ監視バッファを開く: - filter: フックおよびトリガをフィルタして表示 (フックは必ず "@" で始めてください、たとえば "@signal")、複数のフィルタをかける場合はそれぞれをコンマで区切ってください; 各トリガ名にワイルドカード "*" を使うことができます。 + list: list triggers (without argument, this list is displayed) + listfull: list triggers with detailed info for each trigger +listdefault: list default triggers + add: add a trigger + addoff: add a trigger (disabled) + addreplace: add or replace an existing trigger + name: name of trigger + hook: signal, hsignal, modifier, print, command, command_run, timer, config, focus + arguments: arguments for the hook, depending on hook (separated by semicolons): + signal: name(s) of signal (required) + hsignal: name(s) of hsignal (required) + modifier: name(s) of modifier (required) + print: buffer, tags, message, strip colors + command: command (required), description, arguments, description of arguments, completion + command_run: command(s) (required) + timer: interval (required), align on second, max calls + config: name(s) of option (required) + focus: name(s) of area (required) + conditions: evaluated conditions for the trigger + regex: one or more regular expressions to replace strings in variables + command: command to execute (many commands can be separated by ";" +return_code: return code in callback (ok (default), ok_eat, error) + addinput: set input with default arguments to create a trigger + input: set input with the command used to create the trigger + output: send the command to create the trigger on the buffer + recreate: same as "input", with option "addreplace" instead of "add" + set: set an option in a trigger + option: name of option: name, hook, arguments, conditions, regex, command, return_code + (for help on option, you can type: /help trigger.trigger.<name>.<option>) + value: new value for the option + rename: rename a trigger + copy: copy a trigger + enable: enable trigger(s) (without arguments: enable triggers globally) + disable: disable trigger(s) (without arguments: disable triggers globally) + toggle: toggle trigger(s) (without arguments: toggle triggers globally) + restart: restart trigger(s) (recreate the hooks) + show: show detailed info on a trigger (with some stats) + del: delete a trigger + -all: do action on all triggers + restore: restore trigger(s) with the default values (works only for default triggers) + default: delete all triggers and restore default ones + monitor: open the trigger monitor buffer, with optional filter: + filter: filter hooks/triggers to display (a hook must start with "@", for example "@signal"), many filters can be separated by commas; wildcard "*" is allowed in each trigger name -トリガコールバックを呼び出す際には、以下の順番通りにアクションを実行します: - 1. 条件を確認; 偽の場合、終了 - 2. POSIX 拡張正規表現を使ってテキストを置換 (トリガに定義されている場合) - 3. コマンドを実行 (トリガに定義されている場合) - 4. リターンコードを返して終了 (modifier と focus を除く) +When a trigger callback is called, following actions are performed, in this order: + 1. check conditions; if false, exit + 2. replace text using POSIX extended regular expression(s) (if defined in trigger) + 3. execute command(s) (if defined in trigger) + 4. exit with a return code (except for modifiers and focus) -例 (/trigger listdefault でデフォルトトリガを見ることができます): - テキスト属性 *太字*、_下線_、/イタリック/ を追加 (ユーザメッセージのみ): - /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}/" - 狭い端末ではニックネームリストバーを隠す: +Examples (you can also look at default triggers with /trigger listdefault): + add text attributes *bold*, _underline_ and /italic/ (only in user messages): + /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/" + hide nicklist bar on small terminals: /trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist" /trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist" - 設定を 1 時間毎に黙々と保存: + silently save config each hour: /trigger add cfgsave timer 3600000;0;0 "" "" "/mute /save" - トリガモニタを開き、修飾子と名前が "resize" から始まるトリガだけを表示: + open trigger monitor and show only modifiers and triggers whose name starts with "resize": /trigger monitor @modifier,resize* ---- diff --git a/doc/ja/autogen/user/weechat_commands.asciidoc b/doc/ja/autogen/user/weechat_commands.asciidoc index 4e033527e..361d59e42 100644 --- a/doc/ja/autogen/user/weechat_commands.asciidoc +++ b/doc/ja/autogen/user/weechat_commands.asciidoc @@ -147,7 +147,7 @@ localvar: 現在のバッファのローカル変数を表示 alias: ある色に別名を追加 unalias: 別名の削除 color: カラー番号 (0 以上、最大値はターミナル依存、多くの場合 63 か 255) - name: カラーの別名 (例えば: "orange") + name: カラーの別名 (例: "orange") reset: 全てのカラーペアをリセット (自動的なリセットが無効化されており、これ以上のカラーペアが利用できない場合に必要、オプション weechat.look.color_pairs_auto_reset を参照) term2rgb: ターミナル色 (0-255) を RGB 色に変換 rgb2term: RGB 色をターミナル色 (0-255) に変換 @@ -254,17 +254,18 @@ expression: 評価する式、フォーマット、${variable} 型のフォー 式が NULL でない場合、空でない場合、"0" でない場合、式は "真" と評価されます。 両方の式が有効な整数である場合、比較は整数を使って行われます。 -文字列比較を強制するには、それぞれの式をダブルクォートで囲みます、例えば: +文字列比較を強制するには、それぞれの式をダブルクォートで囲みます、例: 50 > 100 ==> 0 "50" > "100" ==> 1 式中の ${variable} 型のフォーマットの変数は置換されます。変数は以下の優先順位に従います: 1. エスケープ文字を含む文字列 (フォーマット: "esc:xxx" または "\xxx") - 2. 色 (フォーマット: "color:xxx") - 3. 情報 (フォーマット: "info:name,arguments"、arguments は任意) - 4. オプション (フォーマット: "file.section.option") - 5. バッファのローカル変数 - 6. hdata の名前/変数 (値は自動的に文字列に変換されます)、デフォルトでは "window" と "buffer" は現在のウィンドウ/バッファを指します。 + 2. 隠す文字を含む文字列 (フォーマット: "hide:char,string") + 3. 色 (フォーマット: "color:xxx") + 4. 情報 (フォーマット: "info:name,arguments"、arguments は任意) + 5. オプション (フォーマット: "file.section.option") + 6. バッファのローカル変数 + 7. hdata の名前/変数 (値は自動的に文字列に変換されます)、デフォルトでは "window" と "buffer" は現在のウィンドウ/バッファを指します。 hdata のフォーマットは以下の 1 つです: hdata.var1.var2...: hdata (ポインタは既知) で始まり、1 個ずつ変数を続ける (他の hdata を続けることも可能) hdata(list).var1.var2...: リストを使って hdata を始める、例: @@ -273,23 +274,24 @@ hdata のフォーマットは以下の 1 つです: hdata と変数の名前については、"プラグイン API リファレンス" の "weechat_hdata_get" 関数を参照してください。 例 (単純な文字列): - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${\t} ==> <tab> + /eval -n ${hide:-,${relay.network.password}} ==> -------- 例 (条件): - /eval -n -c ${window.buffer.number} > 2 ==> 0 - /eval -n -c ${window.win_width} > 100 ==> 1 - /eval -n -c (8 > 12) || (5 > 2) ==> 1 - /eval -n -c (8 > 12) && (5 > 2) ==> 0 - /eval -n -c abcd =~ ^ABC ==> 1 - /eval -n -c abcd =~ (?-i)^ABC ==> 0 - /eval -n -c abcd =~ (?-i)^abc ==> 1 - /eval -n -c abcd !~ abc ==> 0 + /eval -n -c ${window.buffer.number} > 2 ==> 0 + /eval -n -c ${window.win_width} > 100 ==> 1 + /eval -n -c (8 > 12) || (5 > 2) ==> 1 + /eval -n -c (8 > 12) && (5 > 2) ==> 0 + /eval -n -c abcd =~ ^ABC ==> 1 + /eval -n -c abcd =~ (?-i)^ABC ==> 0 + /eval -n -c abcd =~ (?-i)^abc ==> 1 + /eval -n -c abcd !~ abc ==> 0 ---- [[command_weechat_filter]] @@ -312,12 +314,12 @@ disable: フィルタを無効化 del: フィルタを削除 -all: 全てのフィルタを削除 buffer: フィルタが有効化されているバッファのコンマ区切りリスト: - - これはプラグイン名を含む完全な名前です (例えば: "irc.freenode.#weechat") + - これはプラグイン名を含む完全な名前です (例: "irc.freenode.#weechat" または "irc.server.freenode") - "*" は全てのバッファを意味します - 名前が '!' から始まるものは除外されます - ワイルドカード '*' を使うことができます tags: タグのコンマ区切りリスト、例えば "irc_join,irc_part,irc_quit" - - 論理積 "and": タグ同士を "+" でつなげてください (例えば: "nick_toto+irc_action") + - 論理積 "and": タグ同士を "+" でつなげてください (例: "nick_toto+irc_action") - ワイルドカード '*' を使うことができます - タグを '!' で始めると、そのタグが付けられたメッセージとそのタグを含むメッセージはフィルタされません regex: 行単位検索の正規表現 @@ -936,7 +938,7 @@ scroll_unread: 未読マーカにスクロール zoom: ウィンドウを拡大 bare: 最小限表示を切り替える (自動的に標準表示モードに戻るまでの時間を秒単位で任意指定) -splith と splitv に関しては、pct は新しいウィンドウのパーセンテージで、現在のウィンドウサイズに対する割合で計算されます。例えば、25 は size = current_size / 4 の新しいウィンドウを作成します。 +splith と splitv に関しては、pct は新しいウィンドウのパーセンテージで、現在のウィンドウサイズに対する割合で計算されます。例えば 25 は size = current_size / 4 の新しいウィンドウを作成します。 例: バッファ #1 を表示しているウィンドウに移動: diff --git a/doc/ja/autogen/user/weechat_options.asciidoc b/doc/ja/autogen/user/weechat_options.asciidoc index f73166b6b..21ff9dbb8 100644 --- a/doc/ja/autogen/user/weechat_options.asciidoc +++ b/doc/ja/autogen/user/weechat_options.asciidoc @@ -69,17 +69,17 @@ ** 値: 未制約文字列 (デフォルト値: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) * [[option_weechat.color.chat_nick_offline]] *weechat.color.chat_nick_offline* -** 説明: `オフラインのニックネームのテキスト色 (ニックネームリストにも表示されない)` +** 説明: `text color for offline nick (not in nicklist any more); this color is used only if option weechat.look.color_nick_offline is enabled` ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" (デフォルト値: `default`) * [[option_weechat.color.chat_nick_offline_highlight]] *weechat.color.chat_nick_offline_highlight* -** 説明: `ハイライトされたオフラインのニックネームのテキスト色` +** 説明: `text color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" (デフォルト値: `default`) * [[option_weechat.color.chat_nick_offline_highlight_bg]] *weechat.color.chat_nick_offline_highlight_bg* -** 説明: `ハイライトされたオフラインのニックネームの背景色` +** 説明: `background color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" (デフォルト値: `blue`) @@ -283,6 +283,11 @@ ** タイプ: 色 ** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" (デフォルト値: `yellow`) +* [[option_weechat.color.status_mouse]] *weechat.color.status_mouse* +** 説明: `text color for mouse indicator in status bar` +** タイプ: 色 +** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" (デフォルト値: `green`) + * [[option_weechat.color.status_name]] *weechat.color.status_name* ** 説明: `ステータスバーの現在のバッファ名のテキスト色` ** タイプ: 色 @@ -313,6 +318,11 @@ ** タイプ: ブール ** 値: on, off (デフォルト値: `on`) +* [[option_weechat.completion.command_inline]] *weechat.completion.command_inline* +** 説明: `if enabled, the commands inside command line are completed (the command at beginning of line has higher priority and is used first); note: when this option is enabled, there is no more automatic completion of paths beginning with '/' (outside commands arguments)` +** タイプ: ブール +** 値: on, off (デフォルト値: `on`) + * [[option_weechat.completion.default_template]] *weechat.completion.default_template* ** 説明: `デフォルトの補完テンプレート (テンプレートコードと値のドキュメントを参照: プラグイン API リファレンス、"weechat_hook_command" 関数)` ** タイプ: 文字列 @@ -518,6 +528,11 @@ ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `""`) +* [[option_weechat.look.command_incomplete]] *weechat.look.command_incomplete* +** 説明: `セットされた場合、不完全なコマンドと完全なコマンドを両方使えるようになります、例えば /he は /help の意味で使うことができます` +** タイプ: ブール +** 値: on, off (デフォルト値: `off`) + * [[option_weechat.look.confirm_quit]] *weechat.look.confirm_quit* ** 説明: `セットされた場合、/quit コマンドは "-yes" 引数と共に使われなければいけない (help quit を参照)` ** タイプ: ブール @@ -663,6 +678,11 @@ ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `"!"`) +* [[option_weechat.look.item_mouse_status]] *weechat.look.item_mouse_status* +** 説明: `string used to show if mouse is enabled (bar item "mouse_status")` +** タイプ: 文字列 +** 値: 未制約文字列 (デフォルト値: `"M"`) + * [[option_weechat.look.item_time_format]] *weechat.look.item_time_format* ** 説明: `"time" バーアイテムの時間フォーマット (日付/時間指定子は strftime の man を参照)` ** タイプ: 文字列 diff --git a/doc/ja/autogen/user/xfer_options.asciidoc b/doc/ja/autogen/user/xfer_options.asciidoc index 2c125e155..1c25c3cfb 100644 --- a/doc/ja/autogen/user/xfer_options.asciidoc +++ b/doc/ja/autogen/user/xfer_options.asciidoc @@ -104,7 +104,7 @@ ** 値: 0 .. 256 (デフォルト値: `20`) * [[option_xfer.look.pv_tags]] *xfer.look.pv_tags* -** 説明: `プライベートメッセージに使われたタグのコンマ区切りリスト、例えば: "notify_message"、"notify_private"、"notify_highlight"` +** 説明: `プライベートメッセージに使われたタグのコンマ区切りリスト、例: "notify_message"、"notify_private"、"notify_highlight"` ** タイプ: 文字列 ** 値: 未制約文字列 (デフォルト値: `"notify_private"`) diff --git a/doc/ja/weechat.1.ja.asciidoc b/doc/ja/weechat.1.ja.asciidoc index 14a4aaa48..26e81de9d 100644 --- a/doc/ja/weechat.1.ja.asciidoc +++ b/doc/ja/weechat.1.ja.asciidoc @@ -51,9 +51,8 @@ $HOME/.weechat/weechat.conf:: $HOME/.weechat/plugins.conf:: プラグイン設定ファイル -// TRANSLATION MISSING $HOME/.weechat/sec.conf:: - configuration file with secured data + 保護されたデータを含む設定ファイル $HOME/.weechat/alias.conf:: 'alias' プラグイン用の設定ファイル diff --git a/doc/ja/weechat_dev.ja.asciidoc b/doc/ja/weechat_dev.ja.asciidoc index a5454b7e9..cb315625f 100644 --- a/doc/ja/weechat_dev.ja.asciidoc +++ b/doc/ja/weechat_dev.ja.asciidoc @@ -92,6 +92,7 @@ WeeChat "core" は以下のディレクトリに配置されています: | パス/ファイル名 | 説明 | core/ | コア関数: エントリポイント、内部構造体 | weechat.c | 主要関数: コマンドラインオプション、起動 +| wee-arraylist.c | 配列リスト | wee-backtrace.c | クラッシュした際にバックトレースを表示 | wee-command.c | WeeChat コアコマンド | wee-completion.c | デフォルト補完 @@ -937,7 +938,7 @@ server->hook_timer_sasl = weechat_hook_timer (timeout * 1000, Git リポジトリはこの URL にあります: https://github.com/weechat/weechat -バグや新機能のパッチは必ず master ブランチに対して適用できるものを作成し、Github の pull +バグや新機能のパッチは必ず master ブランチに対して適用できるものを作成し、GitHub の pull リクエストを使って提出することを推奨します。パッチは電子メールで送信することも可能です (`git diff` または `git format-patch` で作成してください)。 diff --git a/doc/ja/weechat_faq.ja.asciidoc b/doc/ja/weechat_faq.ja.asciidoc index 761e3bb38..3a7694c57 100644 --- a/doc/ja/weechat_faq.ja.asciidoc +++ b/doc/ja/weechat_faq.ja.asciidoc @@ -51,6 +51,21 @@ autotools を使って (cmake を使わずに) コンパイルする場合、 リポジトリからほぼ毎日ビルドされます。このパッケージは厳密には git ベースではなく、 アップデートをインストールする場合には git をクローンする方法よりも不便であることに注意してください。 +[[compile_osx]] +=== どうすれば OS X に WeeChat をインストールできますか? + +http://brew.sh/[Homebrew] を使うことをお勧めします、ヘルプを見るには: + +---- +brew info weechat +---- + +以下のコマンドで WeeChat をインストールします: + +---- +brew install weechat --with-python --with-perl +---- + [[lost]] === WeeChat を起動しました。でも何をすればいいかわかりません。 @@ -646,7 +661,21 @@ WeeChat 0.3.3 以下では、オプション名が 'irc.network.away_check' と [[highlight_notification]] === どうすればあるチャンネルで自分が呼ばれたら警告できますか。 -'beep.pl' や 'launcher.pl' 等のスクリプトを使ってください。 +// TRANSLATION MISSING +With WeeChat ≥ 1.0, there is a default trigger "beep" which sends a 'BEL' to +the terminal on a highlight or private message. Thus you can configure your +terminal (or multiplexer like screen/tmux) to run a command or play a sound +when a 'BEL' occurs. + +// TRANSLATION MISSING +Or you can add a command in "beep" trigger: + +---- +/set trigger.trigger.beep.command "/print -beep;/exec -bg /path/to/command arguments" +---- + +// TRANSLATION MISSING +With an older WeeChat, you can use a script like 'beep.pl' or 'launcher.pl'. 'launcher.pl' の場合、コマンドの設定が必要です: diff --git a/doc/ja/weechat_plugin_api.ja.asciidoc b/doc/ja/weechat_plugin_api.ja.asciidoc index 0b14d93d6..66b1294dd 100644 --- a/doc/ja/weechat_plugin_api.ja.asciidoc +++ b/doc/ja/weechat_plugin_api.ja.asciidoc @@ -854,7 +854,7 @@ int match5 = weechat_string_match ("abcdef", "*b*d*", 0); /* == 1 */ # プロトタイプ match = weechat.string_match(string, mask, case_sensitive) -# 例s +# 例 match1 = weechat.string_match("abcdef", "abc*", 0) # 1 match2 = weechat.string_match("abcdef", "*dd*", 0) # 0 match3 = weechat.string_match("abcdef", "*def", 0) # 1 @@ -1771,7 +1771,7 @@ int command_char2 = weechat_string_is_command_char ("test"); /* == 0 */ # プロトタイプ is_cmdchar = weechat.string_is_command_char(string) -# 例s +# 例 command_char1 = weechat.string_is_command_char("/test") # == 1 command_char2 = weechat.string_is_command_char("test") # == 0 ---- @@ -1814,7 +1814,7 @@ const char *str3 = weechat_string_input_for_buffer ("//test"); /* "/test" */ # プロトタイプ str = weechat.string_input_for_buffer(string) -# 例s +# 例 str1 = weechat.string_input_for_buffer("test") # "test" str2 = weechat.string_input_for_buffer("/test") # "" str3 = weechat.string_input_for_buffer("//test") # "/test" @@ -1822,11 +1822,10 @@ str3 = weechat.string_input_for_buffer("//test") # "/test" ==== weechat_string_eval_expression -_WeeChat バージョン 0.4.0 以上で利用可、バージョン 0.4.2 で更新。_ +_WeeChat バージョン 0.4.0 以上で利用可、バージョン 0.4.2 と 1.1 で更新。_ 式を評価して文字列として返す。`${variable}` -という書式で書かれた特殊変数は展開される -('WeeChat ユーザガイド' のコマンド `/eval` を参照)。 +という書式で書かれた特殊変数は展開されます (以下の表を参照)。 [NOTE] バージョン 1.0 以降、入れ子変数を使えるようになりました、例: @@ -1844,10 +1843,14 @@ char *weechat_string_eval_expression (const char *expr, 引数: -* 'expr': 評価する式 +* 'expr': 評価する式 (以下の表を参照) * 'pointers': ポインタを含むハッシュテーブル (キーは文字列、値はポインタ); (現在のウィンドウやバッファへのポインタを持つ) ハッシュテーブルが "window" と - "buffer" ポインタを持たない場合はこれらは自動的に追加される (NULL でも可) + "buffer" ポインタを持たない場合はこれらは自動的に追加される (NULL でも可): +** 'regex': WeeChat 関数 <<_weechat_string_regcomp,weechat_string_regcomp>> + または regcomp (`man regcomp` を参照) でコンパイル済みの正規表現へのポインタ + ('regex_t' 構造体); このオプションは (以下の) ハッシュテーブル構造体 'options' + メンバの 'regex' とよく似ていますが、より高速に動作します * 'extra_vars': 展開される追加変数 (NULL でも可) * 'options': いくつかのオプションを含むハッシュテーブル (キーと値は必ず文字列) (NULL でも可): @@ -1857,26 +1860,118 @@ char *weechat_string_eval_expression (const char *expr, 演算子と括弧が使われます、結果はブール値 ("0" または "1") です ** 'prefix': 置換する変数のプレフィックス (デフォルト: "${") ** 'suffix': 置換する変数のサフィックス (デフォルト: "}") +** 'regex': 'expr' のテキストを置換する正規表現 + (この場合 'expr' は評価されません) +** 'regex_replace': 'regex' と一緒に使われる置換テキスト、'expr' + に含まれるテキストを置換する ('regex_replace' は、'expr' 内で + 'regex' 引数にマッチする部分が見つからなくなるまで、毎回評価されます) 戻り値: * 評価された式 (使用後には必ず "free" を呼び出して領域を開放してください)、失敗した場合は NULL (式が不正な場合やメモリが不足している場合) +式中で展開される変数のリスト +(優先度の高い順、展開順の早いものを上に遅いものを下に): + +[width="100%",cols="2,8,3,3",options="header"] +|=== +| フォーマット | 説明 | 例 | 結果 + +| `${name}` | 'extra_vars' の変数 `name` の値に展開 | + `${name}` | `value` + +| `${esc:xxx}` + + `${\xxx}` | エスケープ文字を含む文字列 | + `${esc:prefix\tmessage}` + + `${\ua9}` | + `prefix<TAB>message` + + `©` + +| `${hide:x,value}` | + 隠す文字を含むテキスト (`value` に含まれる文字をすべて `x` で置換) | + `${hide:*,password}` | + `********` + +| `${re:N}` | + 正規表現のキャプチャグループ: 0 = マッチするすべての文字列、1 から 99 = + キャプチャされたグループ、`+` = 最後にキャプチャされたグループ | + `${re:1}` | + `test` + +| `${color:name}` | + WeeChat 色コード (色名部分はオプション属性をとることも可能です) | + `${color:red}red text` + + `${color:*214}bold orange text` | + `red text` (赤色で) + + `bold orange text` (太字オレンジ色で) + +| `${info:name}` + + `${indo:name,arguments}` | + WeeChat またはプラグインのインフォ、<<_weechat_info_get,weechat_info_get>> + を参照 | + `${info:version}` + + `${info:irc_nick_color_name,foo}` | + `1.0` + + `lightblue` + +| `${sec.data.name}` | + セキュアデータ `name` の値 | + `${sec.data.freenode_pass}` | + `my_password` + +| `${file.section.option}` | + オプションの値 | + `${weechat.look.buffer_time_format}` | + `%H:%M:%S` + +| `${name}` | + バッファに対するローカル変数 `name` の値 | + `${nick}` | + `FlashCode` + +| `${hdata.var1.var2...}` + + `${hdata[list].var1.var2...}` | + hdata の値 (`window` と `buffer` + ポインタはデフォルトで現在のウィンドウ/バッファに設定されます) | + `${buffer[gui_buffers].full_name}` + + `${window.buffer.number}` | + `core.weechat` + + `1` +|=== + C 言語での使用例: [source,C] ---- -struct t_hashtable *options = weechat_hashtable_new (8, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); -if (options) - weechat_hashtable_set (options, "type", "condition"); -char *str1 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ -char *str2 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options); /* "1" */ -char *str3 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options); /* "0" */ +/* 条件式の評価 */ +struct t_hashtable *options1 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options1, "type", "condition"); +char *str1 = weechat_string_eval_expression ("${window.win_width} > 100", NULL, NULL, options1); /* "1" */ +char *str2 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options1); /* "0" */ + +/* 単純な展開 */ +char *str3 = weechat_string_eval_expression ("${buffer.full_name}", NULL, NULL, NULL); /* "core.weechat" */ + +/* 正規表現を用いた置換 */ +struct t_hashtable *options2 = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +/* URL に関するブラックリストを追加 */ +weechat_hashtable_set (options2, "regex", "\\w+://\\S+"); +weechat_hashtable_set (options2, "regex_replace", "[ ${re:0} ]"); +char *str4 = weechat_string_eval_expression ("test: http://weechat.org", NULL, NULL, NULL); /* "test: [ http://weechat.org ]" */ + +/* パスワードを隠す */ +weechat_hashtable_set (options2, "regex", "(password=)(\\S+)"); +weechat_hashtable_set (options2, "regex_replace", "${re:1}${hide:*,${re:2}}"); +char *str5 = weechat_string_eval_expression ("password=abc password=def", NULL, NULL, NULL); /* "password=*** password=***" */ ---- スクリプト (Python) での使用例: @@ -1886,10 +1981,28 @@ char *str3 = weechat_string_eval_expression ("abc =~ def", NULL, NULL, options); # プロトタイプ str = weechat.string_eval_expression(expr, pointers, extra_vars, options) -# 例s -str1 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" -str2 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" -str3 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" +# 例 + +# 条件式の評価 +str1 = weechat.string_eval_expression("${window.win_width} > 100", {}, {}, {"type": "condition"}) # "1" +str2 = weechat.string_eval_expression("abc =~ def", {}, {}, {"type": "condition"}) # "0" + +# 単純な展開 +str3 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core.weechat" + +# 正規表現を用いた置換: URL に関するブラックリストを追加 +options = { + "regex": "\\w+://\\S+", + "regex_replace": "[ ${re:0} ]", +} +str4 = weechat.string_eval_expression("test: http://weechat.org", {}, {}, options) # "test: [ http://weechat.org ]" + +# 正規表現を用いた置換: パスワードを隠す +options = { + "regex": "(password=)(\\S+)", + "regex_replace": "${re:1}${hide:*,${re:2}}", +} +str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, options) # "password=*** password=***" ---- [[utf-8]] @@ -2664,13 +2777,15 @@ if (weechat_util_timeval_cmp (&tv1, &tv2) > 0) ==== weechat_util_timeval_diff -2 つの "timeval" 構造体の差を (ミリ秒単位で) 返す。 +_バージョン 1.1 で更新。_ + +2 つの "timeval" 構造体の差を返す (マイクロ秒単位)。 プロトタイプ: [source,C] ---- -long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); +long long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); ---- 引数: @@ -2680,13 +2795,16 @@ long weechat_util_timeval_diff (struct timeval *tv1, struct timeval *tv2); 戻り値: -* ミリ秒単位の差 +* マイクロ秒単位の差 + +[NOTE] +WeeChat バージョン 1.0 以前の場合、戻り値の単位はミリ秒でした。 C 言語での使用例: [source,C] ---- -long diff = weechat_util_timeval_diff (&tv1, &tv2); +long long diff = weechat_util_timeval_diff (&tv1, &tv2); ---- [NOTE] @@ -2694,25 +2812,30 @@ long diff = weechat_util_timeval_diff (&tv1, &tv2); ==== weechat_util_timeval_add -timeval 構造体に時間間隔 (ミリ秒単位) を追加 +_バージョン 1.1 で更新。_ + +timeval 構造体に時間間隔を追加 (マイクロ秒単位)。 プロトタイプ: [source,C] ---- -void weechat_util_timeval_add (struct timeval *tv, long interval); +void weechat_util_timeval_add (struct timeval *tv, long long interval); ---- 引数: * 'tv': timeval 構造体 -* 'interval': 時間間隔 (ミリ秒単位) +* 'interval': 時間間隔 (マイクロ秒単位) + +[NOTE] +WeeChat バージョン 1.0 以前の場合、時間間隔の単位はミリ秒でした。 C 言語での使用例: [source,C] ---- -weechat_util_timeval_add (&tv, 2000); /* add 2 seconds */ +weechat_util_timeval_add (&tv, 2000000); /* add 2 seconds */ ---- [NOTE] @@ -6265,7 +6388,7 @@ weechat_key_unbind ("mouse", "area:chat(plugin.buffer)"); # プロトタイプ num_keys = weechat.key_unbind(context, key) -# 例s +# 例 # remove a single key weechat.key_unbind("mouse", "@chat(plugin.buffer):button1") @@ -8143,6 +8266,18 @@ WeeChat とプラグインが送信するシグナルのリスト: String: キーの組み合わせ | 'cursor' コンテキスト内のキーの組み合わせ +// TRANSLATION MISSING +| weechat | mouse_enabled + + _(WeeChat ≥ 1.1)_ | + - | + Mouse enabled + +// TRANSLATION MISSING +| weechat | mouse_disabled + + _(WeeChat ≥ 1.1)_ | + - | + Mouse disabled + | weechat | nicklist_group_added + _(WeeChat バージョン 0.3.2 以上で利用可)_ | String: バッファポインタ + "," + グループ名 | @@ -10665,7 +10800,7 @@ weechat_buffer_set (my_buffer, "localvar_del_toto", NULL); # プロトタイプ weechat.buffer_set(buffer, property, value) -# 例s +# 例 # disable hotlist (for all buffers) weechat.buffer_set("", "hotlist", "-") @@ -11653,7 +11788,7 @@ weechat_nicklist_group_set (buffer, group, "visible", "0"); # プロトタイプ weechat.nicklist_group_set(buffer, group, property, value) -# 例s +# 例 # change group color to "bar_fg" weechat.nicklist_group_set(buffer, group, "color", "bar_fg") @@ -11868,7 +12003,7 @@ weechat_nicklist_nick_set (buffer, nick, "visible", "0"); # プロトタイプ weechat.nicklist_nick_set(buffer, nick, property, value) -# 例s +# 例 # change nick color to cyan weechat.nicklist_nick_set(buffer, nick, "color", "cyan") diff --git a/doc/ja/weechat_user.ja.asciidoc b/doc/ja/weechat_user.ja.asciidoc index c12e8897d..c5e65b47d 100644 --- a/doc/ja/weechat_user.ja.asciidoc +++ b/doc/ja/weechat_user.ja.asciidoc @@ -45,7 +45,7 @@ WeeChat をインストールするには、以下のものが必要です: * GNU/Linux が稼動しているシステム (ソースパッケージを使う場合は、 コンパイラツールも必要)、又は互換 OS * 'root' 特権 (WeeChat をシステムディレクトリにインストールする場合) -* ncurses ライブラリ +* 一部のライブラリ (<<dependencies,依存関係>>を参照)。 [[install]] == インストール方法 @@ -74,6 +74,11 @@ WeeChat をインストールするには、以下のものが必要です: WeeChat は cmake または autotools を使ってコンパイルできます (cmake を使うことが推奨されています)。 +[NOTE] +OS X では、http://brew.sh/[Homebrew] を使ってください: +`brew install weechat --with-python --with-perl` +(ヘルプを見るには: `brew info weechat`)。 + [[dependencies]] ==== 依存関係 @@ -82,20 +87,21 @@ WeeChat は cmake または autotools を使ってコンパイルできます (c [width="100%",cols="5,^3,^3,.^13",options="header"] |=== -| パッケージ ^(1)^ | バージョン | 必須 | 機能 -| cmake | | *yes* | ビルド (autotools でも可能ですが、cmake を推奨します) -| libncursesw5-dev ^(2)^ | | *yes* | ncurses インターフェイス -| libcurl4-gnutls-dev | | *yes* | URL 転送 -| zlib1g-dev | | *yes* | relay プラグインでパケットを圧縮 (weechat プロトコル)、スクリプトプラグイン -| libgcrypt11-dev | | *yes* | 保護データ、IRC SASL 認証 (DH-BLOWFISH/DH-AES)、スクリプトプラグイン -| libgnutls-dev | ≥ 2.2.0 | | IRC サーバへの SSL 接続 +| パッケージ ^(1)^ | バージョン | 要件 | 機能 +| cmake | | *必須* | ビルド (autotools でも可能ですが、cmake を推奨します) +| pkg-config | | *必須* | インストール済みライブラリを検出 +| libncursesw5-dev ^(2)^ | | *必須* | ncurses インターフェイス +| libcurl4-gnutls-dev | | *必須* | URL 転送 +| zlib1g-dev | | *必須* | relay プラグインでパケットを圧縮 (weechat プロトコル)、スクリプトプラグイン +| libgcrypt20-dev | | *必須* | 保護データ、IRC SASL 認証 (DH-BLOWFISH/DH-AES)、スクリプトプラグイン +| libgnutls28-dev | ≥ 2.2.0 | | IRC サーバへの SSL 接続 | gettext | | | 国際化 (メッセージの翻訳; ベース言語は英語です) | ca-certificates | | | SSL 接続に必要な証明書、relay プラグインで SSL サポート | libaspell-dev または libenchant-dev | | | aspell プラグイン | python-dev | ≥ 2.5 ^(3)^ | | python プラグイン | libperl-dev | | | perl プラグイン -| ruby1.9.1-dev | ≥ 1.8 | | ruby プラグイン -| liblua5.1-0-dev | | | lua プラグイン +| ruby2.1-dev | ≥ 1.8 | | ruby プラグイン +| liblua5.2-dev | | | lua プラグイン | tcl-dev | ≥ 8.5 | | tcl プラグイン | guile-2.0-dev | ≥ 2.0 | | guile (scheme) プラグイン | asciidoc | ≥ 8.5.0 | | man ページと文書のビルド @@ -499,11 +505,11 @@ WeeChat を起動したターミナルの例: 状態 ('status') バーは以下の初期値を持っています: -[width="100%",cols="^3,^3,10",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | アイテム | 例 | 説明 | time | `[12:55]` | 時刻 -| buffer_count | `[6]` | 開いているバッファの数 +| buffer_last_number | `[6]` | リスト中の最後のバッファ番号 | buffer_plugin | `[irc/freenode]` | 現在のバッファのプラグイン (irc プラグインではバッファで利用されている IRC サーバ名を追加できます) | buffer_number | `3` | 現在のバッファの番号 | buffer_name | `#test` | 現在のバッファの名前 @@ -511,24 +517,41 @@ WeeChat を起動したターミナルの例: | buffer_nicklist_count | `{4}` | ニックネームリスト中のニックネームの数 | buffer_zoom | ! | `!` はマージされたバッファがズームされている状態 (ズームされたものだけを表示する状態) を示します、空の場合はすべてのマージされたバッファが表示されていることを示します | buffer_filter | `*` | フィルタ表示: `*` の場合いくつかの行がフィルタされ (隠され) ます、空の場合すべての行が表示されます。 +| scroll | `-MORE(50)-` | スクロール表示、最後の行が表示されてから追加された行数を含む。 | lag | `[Lag: 2.5]` | 遅延秒表示 (遅延が短い場合は非表示) | hotlist | `[H: 4:#abc(2,5), 6]` | 変化のあったバッファのリスト (未読メッセージ) (例では、'#abc' に 2 個のハイライトと 5 個の未読メッセージ、6 番目のバッファに 1 個の未読メッセージがあることを意味します。) | completion | `abc(2) def(5)` | 補完候補の単語リスト、各単語に対して適応される補完候補の数を含む。 -| scroll | `-MORE(50)-` | スクロール表示、最後の行が表示されてから追加された行数を含む。 |=== 入力 ('input') バーは以下の初期値を持っています: -[width="100%",cols="^3,^6,8",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | アイテム | 例 | 説明 -| input_paste | `[Paste 7 lines ? [ctrl-Y] Yes [ctrl-N] No]` | 行をペーストする場合にユーザへ行われる質問 | input_prompt | `[@Flashy]` | 入力プロンプト、irc の場合: ニックネームとモード (freenode では "+i" モードは不可視状態を意味します) | away | `(away)` | 離席状態表示 | input_search | `[Search (~ str,msg)]` | 検索インジケータ ("`~`": 大文字小文字を区別しない、"`==`": 大文字小文字を区別する、"`str`": 検索文字列、"`regex`": 検索正規表現、"`msg`": メッセージ部分から検索、"`pre`": プレフィックス部分から検索、"`pre\|msg`": プレフィックス部分とメッセージ部分から検索) +| input_paste | `[Paste 7 lines ? [ctrl-Y] Yes [ctrl-N] No]` | 行をペーストする場合にユーザへ行われる質問 | input_text | `hi peter!` | 入力テキスト |=== +// TRANSLATION MISSING +Other items available (not used in bars by default): + +// TRANSLATION MISSING +[width="100%",cols="^3,^4,10",options="header"] +|=== +| Item | Example | Description +| aspell_dict | `fr,en` | Spelling dictionaries used on current buffer +| aspell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled) +| buffer_count | `10` | Total number of buffers opened +| buffer_short_name | `#test` | Current buffer short name +| irc_channel | `#test` | Current IRC channel name +| irc_nick_modes | `@` | IRC modes for self nick +| mouse_status | `M` | Mouse status (empty if mouse is disabled) +| window_number | `2` | Current window number +|=== + [[buffers_and_windows]] === バッファとウィンドウ @@ -1397,7 +1420,7 @@ key[ctrl-c,c] 用の色コード: を下線付きの明るい赤に表示したい場合: ---- -^Cc12^Cbこんにちは^Cb^Cc04^Cu皆さん^Cu^Cc! +^Cc12^Cbこんにちは^Cb^Cc04^C_皆さん^C_^Cc! ---- [NOTE] @@ -2179,7 +2202,7 @@ WeeChat は SASL 認証をサポートします、以下の認証メカニズム [NOTE] "dh-blowfish" メカニズムを利用する場合、"gcrypt" ライブラリが -WeeChat のコンパイル時に必要です (<<dependencies,依存関係>> を参照)。 +WeeChat のコンパイル時に必要です (<<dependencies,依存関係>>を参照)。 [[irc_tor_freenode]] ==== TOR/SASL を使って Freenode に接続する場合 @@ -3054,15 +3077,16 @@ ${tg_highlight} || ${tg_msg_pv} マッチグループを "replace" の中で利用できます: -* `$0` から `$99`: `$0` はマッチ部分の全体、`$1` から `$99` はグループ化されたマッチ部分 -* `$+`: 最後のマッチ部分 (最大のグループ番号を持つ) -* `$.cN`: マッチグループ "N" のすべての文字を "c" で置換した文字列 (例: `$.*2` はグループ - #2 のすべての文字を `*` で置換した文字列). +* `${re:0}` から `${re:99}`: `${re:0}` はマッチ部分の全体、`${re:1}` から + `${re:99}` はグループ化されたマッチ部分 +* `${re:+}`: 最後のマッチ部分 (最大のグループ番号を持つ) +* `${hide:c,${re:N}}`: マッチグループ "N" のすべての文字を "c" で置換した文字列 + (例: `${hide:*,${re:2}}` はグループ #2 のすべての文字を `*` で置換した文字列). 例: "*" で囲まれた文字を太字にする: ---- -/\*(\S+)\*/*${color:bold}$1${color:-bold}*/ +/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/ ---- 例: デフォルトトリガ 'server_pass' はこの正規表現を使って、`/server` @@ -3070,7 +3094,7 @@ ${tg_highlight} || ${tg_msg_pv} `*` で置換しています): ---- -==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5 +==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5} ---- [NOTE] diff --git a/doc/pl/autogen/plugin_api/completions.asciidoc b/doc/pl/autogen/plugin_api/completions.asciidoc index 38e45c512..916098593 100644 --- a/doc/pl/autogen/plugin_api/completions.asciidoc +++ b/doc/pl/autogen/plugin_api/completions.asciidoc @@ -86,6 +86,8 @@ | trigger | trigger_names | triggery +| trigger | trigger_names_default | domyślne triggery + | trigger | trigger_option_value | wartość opcji triggera | trigger | trigger_options | opcje dla triggerów diff --git a/doc/pl/autogen/plugin_api/hdata.asciidoc b/doc/pl/autogen/plugin_api/hdata.asciidoc index ca0f2de95..6e92ef980 100644 --- a/doc/pl/autogen/plugin_api/hdata.asciidoc +++ b/doc/pl/autogen/plugin_api/hdata.asciidoc @@ -586,21 +586,13 @@ *** 'direction' (integer) *** 'add_space' (integer) *** 'force_partial_completion' (integer) -*** 'completion_list' (pointer) +*** 'list' (pointer) *** 'word_found' (string) *** 'word_found_is_nick' (integer) *** 'position_replace' (integer) *** 'diff_size' (integer) *** 'diff_length' (integer) -*** 'partial_completion_list' (pointer, hdata: "completion_partial") -*** 'last_partial_completion' (pointer, hdata: "completion_partial") -* 'completion_partial': struktura z częściowym uzupełnianiem -** wtyczka: weechat -** zmienne: -*** 'word' (string) -*** 'count' (integer) -*** 'prev_item' (pointer, hdata: "completion_partial") -*** 'next_item' (pointer, hdata: "completion_partial") +*** 'partial_list' (pointer) * 'config_file': plik konfiguracyjne ** wtyczka: weechat ** zmienne: diff --git a/doc/pl/autogen/user/irc_commands.asciidoc b/doc/pl/autogen/user/irc_commands.asciidoc index f93df80d7..740b8cb12 100644 --- a/doc/pl/autogen/user/irc_commands.asciidoc +++ b/doc/pl/autogen/user/irc_commands.asciidoc @@ -91,6 +91,7 @@ Bez podania argumentu komenda wyświetla listę banów na obecnym kanale. - wewnętrzna nazwa serwera (tworzona przez /server add, zalecane użycie) - nazwa hosta/port lub IP/port (stworzy to TYMCZASOWY serwer), domyślny port to 6667 - URL o formacie: irc[6][s]://[nick[:hasło]@]irc.example.org[:port][/#kanał1][,#kanał2[...]] + Uwaga: dla adresu/IP/URLa, tworzony jest serwer tymczasowy (NIE ZAPISYWANY), zobacz /help irc.look.temporary_servers opcja: ustawia opcję dla serwera (dla opcji boolowskich można pominąć wartość) nooption: ustawia opcje boolowskie na 'off' (na przykład: -nossl) -all: łączy się ze wszystkimi serwerami zdefiniowanymi w konfiguracji @@ -631,7 +632,7 @@ kanał: nazwa kanału [command]*`samode`* zmienia atrybuty kanału, bez posiadania statusu operatora:: ---- -/samode <kanał> <atrybuty> +/samode [<channel>] <mode> kanał: nazwa kanału atrybuty: atrybuty kanału diff --git a/doc/pl/autogen/user/irc_options.asciidoc b/doc/pl/autogen/user/irc_options.asciidoc index dc761fa0e..668989a42 100644 --- a/doc/pl/autogen/user/irc_options.asciidoc +++ b/doc/pl/autogen/user/irc_options.asciidoc @@ -343,6 +343,11 @@ ** typ: bool ** wartości: on, off (domyślna wartość: `on`) +* [[option_irc.look.temporary_servers]] *irc.look.temporary_servers* +** opis: `włącza tworzenie tymczasowych serwerów za pomocą komendy /connect` +** typ: bool +** wartości: on, off (domyślna wartość: `off`) + * [[option_irc.look.topic_strip_colors]] *irc.look.topic_strip_colors* ** opis: `usuń kolory w tematach (używane przy wyświetlaniu tytułu bufora)` ** typ: bool @@ -479,7 +484,7 @@ ** wartości: 0 .. 1000000 (domyślna wartość: `25`) * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** opis: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, multi-prefix, server-time, userhost-in-names, (example: "away-notify,multi-prefix")` +** opis: `comma-separated list of client capabilities to enable for server if they are available; capabilities supported by WeeChat are: away-notify, extended-join, multi-prefix, server-time, userhost-in-names (example: "away-notify,multi-prefix")` ** typ: ciąg ** wartości: dowolny ciąg (domyślna wartość: `""`) @@ -591,7 +596,7 @@ * [[option_irc.server_default.ssl_priorities]] *irc.server_default.ssl_priorities* ** opis: `ciąg z priorytetami dla gnutls (składnię można znaleźć w dokumentacji gnutls dla funkcji gnutls_priority_init, często używane ciągi to: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` ** typ: ciąg -** wartości: dowolny ciąg (domyślna wartość: `"NORMAL"`) +** wartości: dowolny ciąg (domyślna wartość: `"NORMAL:-VERS-SSL3.0"`) * [[option_irc.server_default.ssl_verify]] *irc.server_default.ssl_verify* ** opis: `sprawdź czy połączenie ssl jest w pełni zaufane` diff --git a/doc/pl/autogen/user/relay_commands.asciidoc b/doc/pl/autogen/user/relay_commands.asciidoc index c0562f1d0..fa9517206 100644 --- a/doc/pl/autogen/user/relay_commands.asciidoc +++ b/doc/pl/autogen/user/relay_commands.asciidoc @@ -3,44 +3,52 @@ ---- /relay list|listfull|listrelay - add [ipv4.][ipv6.][ssl.]<protokół.nazwa> <port> - del [ipv4.][ipv6.][ssl.]<protokół.nazwa> + add <name> <port> + del|stop|restart <name> raw - kluczSSL + sslcertkey - list: wyświetla klienty relay (tylko aktywne) - listfull: wyświetla klienty relay (wszystkie) - listrelay: wyświetla relaye (nazwa i port) - add: dodaje relay dla protokołu + nazwa - del: usuwa relay dla protokołu + nazwa - ipv4: wymusza użycie IPv4 - ipv6: wymusza użycie IPv6 - ssl: włącza SSL -protokół.nazwa: protokół i nazwa dla relay: - - protokół "irc": nazwą jest dzielony serwer (opcjonalnie, jeśli nie zostanie podana, nazwa serwera musi zostać wysłanaprzez klienta w komendzie"PASS", w formacie: "PASS serwer:hasło") - - protokół "weechat" (nazwa nie jest używana) - port: port używany przez relay - raw: otwiera bufor z nieprzetworzonymi danymi Relay - kluczSSL: ustawia certyfikat SSL/hasło używając ścieżki w opcji relay.network.ssl_cert_key + list: list relay clients (only active relays) + listfull: list relay clients (verbose, all relays) + listrelay: list relays (name and port) + add: add a relay (listen on a port) + del: remove a relay (clients remain connected) + stop: close the server socket (clients remain connected) + restart: close the server socket and listen again on port (clients remain connected) + name: relay name (see format below) + port: port used for relay + raw: open buffer with raw Relay data + sslcertkey: set SSL certificate/key using path in option relay.network.ssl_cert_key -Bez argumentu komenda otwiera bufor z listą klientów relay. +Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name> + ipv4: force use of IPv4 + ipv6: force use of IPv6 + ssl: enable SSL +protocol.name: protocol and name to relay: + - protocol "irc": name is the server to share (optional, if not given, the server name must be sent by client in command "PASS", with format: "PASS server:password") + - protocol "weechat" (name is not used) -Przykłady: - pośrednik irc dla serwera "freenode": +The "irc" protocol allows any IRC client (including WeeChat itself) to connect on the port. +The "weechat" protocol allows a remote interface to connect on the port, see the list here: http://weechat.org/download/ + +Without argument, this command opens buffer with list of relay clients. + +Examples: + irc proxy, for server "freenode": /relay add irc.freenode 8000 - pośrednik irc dla serwera "freenode", z SSL: + irc proxy, for server "freenode", with SSL: /relay add ssl.irc.freenode 8001 - pośrednik irc dla wszystkich serwerów (klient wybiera) z SSL: + irc proxy, for all servers (client will choose), with SSL: /relay add ssl.irc 8002 - protokół weechat: + weechat protocol: /relay add weechat 9000 - protokół weechat z SSL: + weechat protocol with SSL: /relay add ssl.weechat 9001 - protokół weechat z SSL, używający tylko IPv4: + weechat protocol with SSL, using only IPv4: /relay add ipv4.ssl.weechat 9001 - protokół weechat z SSL, używający tylko IPv6: + weechat protocol with SSL, using only IPv6: /relay add ipv6.ssl.weechat 9001 - protokół weechat z SSL, używający IPv4 + IPv6: + weechat protocol with SSL, using IPv4 + IPv6: /relay add ipv4.ipv6.ssl.weechat 9001 ---- diff --git a/doc/pl/autogen/user/relay_options.asciidoc b/doc/pl/autogen/user/relay_options.asciidoc index 49feca873..ce8f20ba1 100644 --- a/doc/pl/autogen/user/relay_options.asciidoc +++ b/doc/pl/autogen/user/relay_options.asciidoc @@ -59,7 +59,7 @@ ** wartości: on, off (domyślna wartość: `on`) * [[option_relay.irc.backlog_tags]] *relay.irc.backlog_tags* -** opis: `tagi dla wiadomości, które są wyświetlane w backlogu dla kanałów IRC (wspierane tagi: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = dla wszystkich wspieranych tagów` +** opis: `comma-separated list of messages tags which are displayed in backlog per IRC channel (supported tags: "irc_join", "irc_part", "irc_quit", "irc_nick", "irc_privmsg"), "*" = all supported tags` ** typ: ciąg ** wartości: dowolny ciąg (domyślna wartość: `"irc_privmsg"`) @@ -118,6 +118,11 @@ ** typ: ciąg ** wartości: dowolny ciąg (domyślna wartość: `"%h/ssl/relay.pem"`) +* [[option_relay.network.ssl_priorities]] *relay.network.ssl_priorities* +** opis: `ciąg z priorytetami dla gnutls (składnię można znaleźć w dokumentacji gnutls dla funkcji gnutls_priority_init, często używane ciągi to: "PERFORMANCE", "NORMAL", "SECURE128", "SECURE256", "EXPORT", "NONE")` +** typ: ciąg +** wartości: dowolny ciąg (domyślna wartość: `"NORMAL:-VERS-SSL3.0"`) + * [[option_relay.network.websocket_allowed_origins]] *relay.network.websocket_allowed_origins* ** opis: `rozszerzone wyrażenia regularne POSIX ze źródłami dozwolonymi dla gniazd webowych (nie wrażliwe na wielkość znaków, umieszczenie "(?-i)" na początku sprawi, że wielość znaków będzie miała znaczenie), przykład: "^http://(www\.)?przykład\.(com|org)"` ** typ: ciąg diff --git a/doc/pl/autogen/user/trigger_commands.asciidoc b/doc/pl/autogen/user/trigger_commands.asciidoc index 2c1fb51af..0b24421ec 100644 --- a/doc/pl/autogen/user/trigger_commands.asciidoc +++ b/doc/pl/autogen/user/trigger_commands.asciidoc @@ -12,67 +12,69 @@ restart <nazwa>|-all [<nazwa>...] show <nazwa> del <nazwa>|-all [<nazwa>...] + restore <nazwa> [<nazwa>...] default -yes monitor [<filtr>] - list: lista triggerów (jeśli nie podano argumentu, wyświetli się ta lista) - listfull: lista triggerów ze szczegółowymi informacjami -listdefault: lista domyślnych triggerów - add: dodaje trigger - addoff: dodaje trigger (wyłączony) - addreplace: dodaje lub zastępuje istniejący trigger - nazwa: nazwa triggera - uchwyt: signal, hsignal, modifier, print, command, command_run, timer, config, focus - argumenty: argumenty dla uchwytu, w zależności od jego typu (oddzielone średnikami): - signal: nazwa(-y) signal (wymagane) - hsignal: nazwa(-y) hsignal (wymagane) - modifier: nazwa(-y) modifier (wymagane) - print: bufor, tagi, wiadomość, pomiń kolory - command: komenda (wymagane), opis, argumenty, opis argumentów, dopełnienie - command_run: komenda(-y) (wymagane) - timer: interwał (wymagane), wyrównanie sekund, ilość wywołań - config: nazwa(-y) opcji (wymagane) - focus: nazwa(-y) obszarów (wymagane) - warunki: przetwarzane warunki dla triggera - regex: jedno lub więcej wyrażeń regularnych do zastępowania ciągów w zmiennych - komenda: komenda do wykonania (wiele komend można oddzielić ";" -zwracany kod: kod zwracany w callbacku (ok (domyślne), ok_eat, error) - addinput: ustawia wejście z domyślnymi argumentami do stworzenia triggera - input: ustawia wejście z komendą użytą do stworzenia triggera - output: wysyła komendę do stworzenia triggera do buforu - recreate: tak samo jak "input", z opcją "addreplace" zamiast "add" - set: ustawia opcje triggera - opcja: nazwa opcji: name, hook, arguments, conditions, regex, command, return_code - (aby uzyskać pomoc na temat opcji możesz wpisać: /help trigger.trigger.<nazwa>.<opcja>) - wartość: nowa wartość dla opcji - rename: zmienia nazwę triggera - copy: kopiuje trigger - enable: włącza trigger(y) (bez argumentów: włącza triggery globalnie) - disable: wyłącza trigger(y) (bez argumentów: wyłącza triggery globalnie) - toggle: zmienia stan triggera(-ów) (bez argumentów: zmienia stan triggerów globalnie) - restart: restartuje trigger(y) (tworzy na nowo uchwyty) - show: pokazuje szczegółowe informacje o triggerze (z niektórymi statystykami) - del: usuwa trigger - -all: wykonaj akcję na wszystkich triggerach - default: przywraca domyślne triggery - monitor: otwiera bufor monitorowania triggerów, z opcjonalnym filtrem: - filtr: filtruje uchwyty/triggery do wyświetlenia (uchwyt musi się zaczynać od "@", na przykład "@signal"), wiele filtrów może być oddzielonych przecinkiem; dzika karta "*" jest dozwolona w nazwie każdego triggera + list: list triggers (without argument, this list is displayed) + listfull: list triggers with detailed info for each trigger +listdefault: list default triggers + add: add a trigger + addoff: add a trigger (disabled) + addreplace: add or replace an existing trigger + name: name of trigger + hook: signal, hsignal, modifier, print, command, command_run, timer, config, focus + arguments: arguments for the hook, depending on hook (separated by semicolons): + signal: name(s) of signal (required) + hsignal: name(s) of hsignal (required) + modifier: name(s) of modifier (required) + print: buffer, tags, message, strip colors + command: command (required), description, arguments, description of arguments, completion + command_run: command(s) (required) + timer: interval (required), align on second, max calls + config: name(s) of option (required) + focus: name(s) of area (required) + conditions: evaluated conditions for the trigger + regex: one or more regular expressions to replace strings in variables + command: command to execute (many commands can be separated by ";" +return_code: return code in callback (ok (default), ok_eat, error) + addinput: set input with default arguments to create a trigger + input: set input with the command used to create the trigger + output: send the command to create the trigger on the buffer + recreate: same as "input", with option "addreplace" instead of "add" + set: set an option in a trigger + option: name of option: name, hook, arguments, conditions, regex, command, return_code + (for help on option, you can type: /help trigger.trigger.<name>.<option>) + value: new value for the option + rename: rename a trigger + copy: copy a trigger + enable: enable trigger(s) (without arguments: enable triggers globally) + disable: disable trigger(s) (without arguments: disable triggers globally) + toggle: toggle trigger(s) (without arguments: toggle triggers globally) + restart: restart trigger(s) (recreate the hooks) + show: show detailed info on a trigger (with some stats) + del: delete a trigger + -all: do action on all triggers + restore: restore trigger(s) with the default values (works only for default triggers) + default: delete all triggers and restore default ones + monitor: open the trigger monitor buffer, with optional filter: + filter: filter hooks/triggers to display (a hook must start with "@", for example "@signal"), many filters can be separated by commas; wildcard "*" is allowed in each trigger name -Kiedy callback triggera jest wywoływany, wykonywane są następujące akcje, w kolejności: - 1. sprawdzenie warunków; jeśli nie są spełnione, wyjście - 2. zastąpienie tekstu za pomocą rozszerzonych wyrażeń regularnych POSIX (jeśli zdefiniowane) - 3. wykonanie komend(y) (jeśli zdefiniowane) - 4. wyjście z kodem wyjścia (poza modifiers i focus) +When a trigger callback is called, following actions are performed, in this order: + 1. check conditions; if false, exit + 2. replace text using POSIX extended regular expression(s) (if defined in trigger) + 3. execute command(s) (if defined in trigger) + 4. exit with a return code (except for modifiers and focus) -Przykłady (możesz też spojrzeć na domyślne triggery za pomocą /trigger listdefault): - dodaje atrybuty tekstu *bold*, _underline_ i /italic/ (tylko w wiadomościach użytkowników): - /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}/" - ukrywa pasek z nickami na małych terminalach: +Examples (you can also look at default triggers with /trigger listdefault): + add text attributes *bold*, _underline_ and /italic/ (only in user messages): + /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/" + hide nicklist bar on small terminals: /trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist" /trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist" - cichy zapis plików konfiguracyjnych co każdą godzinę: + silently save config each hour: /trigger add cfgsave timer 3600000;0;0 "" "" "/mute /save" - otwiera monitor triggerów i pokazuje tylko modifiers i triggery, których nazwa zaczyna się od "resize": + open trigger monitor and show only modifiers and triggers whose name starts with "resize": /trigger monitor @modifier,resize* ---- diff --git a/doc/pl/autogen/user/weechat_commands.asciidoc b/doc/pl/autogen/user/weechat_commands.asciidoc index d30b45e60..a8eed5df6 100644 --- a/doc/pl/autogen/user/weechat_commands.asciidoc +++ b/doc/pl/autogen/user/weechat_commands.asciidoc @@ -235,61 +235,63 @@ infolists: wyświetla informacje o infolistach /eval [-n] <wyrażenie> [-n] -c <wyrażenie1> <operator> <wyrażenie2> - -n: wyświetla wynik bez wysyłania go do buforu (tryb debugowania) - -c: przetwarza jako warunek: użyj operatorów i nawiasów, zwraca wartość logiczną ("0" lub "1") -wyrażenie: wyrażenie do przetworzenia, zmienne o formacie ${zmienna} są zastępowane (zobacz niżej); wiele komend można oddzielić średnikami - operator: operator logiczny lub porównania: - - operatory logiczne: - && boolowskie "i" - || boolowskie "lub" - - operatory porównania: - == równy - != różny - <= mniejszy lub równy - < mniejszy - >= większy lub równy - > większy - =~ pasuje do rozszerzonego wyrażenia regularnego POSIX - !~ NIE pasuje do rozszerzonego wyrażenia regularnego POSIX - -Wyrażenie jest uznawane za "prawdziwe" jeśli nie jest NULL, nie jest puste, oraz różni się od "0". -Porównania dokonuje się z użyciem liczb całkowitych jeśli oba wyrażenia są liczbami całkowitymi. -W celu wymuszenia porównywania ciągów, należy umieścić każde wyrażenie w cudzysłowie, na przykład: + -n: display result without sending it to buffer (debug mode) + -c: evaluate as condition: use operators and parentheses, return a boolean value ("0" or "1") +expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons + operator: a logical or comparison operator: + - logical operators: + && boolean "and" + || boolean "or" + - comparison operators: + == equal + != not equal + <= less or equal + < less + >= greater or equal + > greater + =~ is matching POSIX extended regex + !~ is NOT matching POSIX extended regex + +An expression is considered as "true" if it is not NULL, not empty, and different from "0". +The comparison is made using integers if the two expressions are valid integers. +To force a string comparison, add double quotes around each expression, for example: 50 > 100 ==> 0 "50" > "100" ==> 1 -Niektóre zmienne w wyrażeniach są zamieniane, poprzez zastosowanie formatu ${zmienna}, według priorytetu zmienną może być: - 1. ciąg z wyescapowanymi znakami (format: "esc:xxx" lub "\xxx") - 2. kolor (format color:xxx) - 3. informacja (format: "info:nazwa,argumenty", argumenty są opcjonalne) - 4. opcja (format: plik.sekcja.opcja) - 5. zmienna lokalna w buforze - 6. nazwa hdatay/zmiennej (wartość jest automatycznie konwertowana na ciąg znaków), domyślnie "window" i "buffer" wskazują na aktualne okno/bufor. -Format dla hdata może być jednym z poniższych: - hdata.zmienna1.zmienna2...: inicjuje hdata (wskaźnik musi być znany), następnie wypytuje zmienne jedna po drugiej (inne hdata mogą być następne) - hdata[list].zmienna1.zmienna2...: inicjuje hdata z wykorzystaniem listy, na przykład: - ${buffer[gui_buffers].full_name}: pełna nazwa buforu w połączonej liście buforów - ${plugin[weechat_plugins].name}: nazwa pierwszej wtyczki w połączonej liście wtyczek -Nazwy hdata i zmiennych, można znaleźć w "Opisie API wtyczek", fukcja "weechat_hdata_get". - -Przykłady (proste ciągi): - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - -Przykłady (warunki): - /eval -n -c ${window.buffer.number} > 2 ==> 0 - /eval -n -c ${window.win_width} > 100 ==> 1 - /eval -n -c (8 > 12) || (5 > 2) ==> 1 - /eval -n -c (8 > 12) && (5 > 2) ==> 0 - /eval -n -c abcd =~ ^ABC ==> 1 - /eval -n -c abcd =~ (?-i)^ABC ==> 0 - /eval -n -c abcd =~ (?-i)^abc ==> 1 - /eval -n -c abcd !~ abc ==> 0 +Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: + 1. a string with escaped chars (format: "esc:xxx" or "\xxx") + 2. a string with chars to hide (format: "hide:char,string") + 3. a color (format: "color:xxx") + 4. an info (format: "info:name,arguments", arguments are optional) + 5. an option (format: "file.section.option") + 6. a local variable in buffer + 7. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. +Format for hdata can be one of following: + hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed) + hdata[list].var1.var2...: start with a hdata using a list, for example: + ${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers + ${plugin[weechat_plugins].name}: name of first plugin in linked list of plugins +For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". + +Examples (simple strings): + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${\t} ==> <tab> + /eval -n ${hide:-,${relay.network.password}} ==> -------- + +Examples (conditions): + /eval -n -c ${window.buffer.number} > 2 ==> 0 + /eval -n -c ${window.win_width} > 100 ==> 1 + /eval -n -c (8 > 12) || (5 > 2) ==> 1 + /eval -n -c (8 > 12) && (5 > 2) ==> 0 + /eval -n -c abcd =~ ^ABC ==> 1 + /eval -n -c abcd =~ (?-i)^ABC ==> 0 + /eval -n -c abcd =~ (?-i)^abc ==> 1 + /eval -n -c abcd !~ abc ==> 0 ---- [[command_weechat_filter]] @@ -306,7 +308,7 @@ Przykłady (warunki): enable: włącza filtry (filtry są domyślnie włączone) disable: wyłącza filtry toggle: przełącza filtry - nazwa: nazwa filtru + nazwa: nazwa filtru ("@" = włącza/wyłącza wszystkie filtry w obecnym buforze) add: dodaje filtr rename: zmienia nazwę filtru del: usuwa filtr diff --git a/doc/pl/autogen/user/weechat_options.asciidoc b/doc/pl/autogen/user/weechat_options.asciidoc index 2be8fca9a..675dbfef6 100644 --- a/doc/pl/autogen/user/weechat_options.asciidoc +++ b/doc/pl/autogen/user/weechat_options.asciidoc @@ -69,17 +69,17 @@ ** wartości: dowolny ciąg (domyślna wartość: `"cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue"`) * [[option_weechat.color.chat_nick_offline]] *weechat.color.chat_nick_offline* -** opis: `kolor dla nieobecnych nicków (nie znajdujących się na liście nicków)` +** opis: `text color for offline nick (not in nicklist any more); this color is used only if option weechat.look.color_nick_offline is enabled` ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie (domyślna wartość: `default`) * [[option_weechat.color.chat_nick_offline_highlight]] *weechat.color.chat_nick_offline_highlight* -** opis: `kolor dla nieobecnych nicków z podświetleniem` +** opis: `text color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie (domyślna wartość: `default`) * [[option_weechat.color.chat_nick_offline_highlight_bg]] *weechat.color.chat_nick_offline_highlight_bg* -** opis: `kolor tła dla nieobecnych nicków z podświetleniem` +** opis: `background color for offline nick with highlight; this color is used only if option weechat.look.color_nick_offline is enabled` ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie (domyślna wartość: `blue`) @@ -283,6 +283,11 @@ ** typ: kolor ** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie (domyślna wartość: `yellow`) +* [[option_weechat.color.status_mouse]] *weechat.color.status_mouse* +** opis: `text color for mouse indicator in status bar` +** typ: kolor +** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie (domyślna wartość: `green`) + * [[option_weechat.color.status_name]] *weechat.color.status_name* ** opis: `kolor nazwy obecnego bufora w pasku statusu` ** typ: kolor @@ -313,6 +318,11 @@ ** typ: bool ** wartości: on, off (domyślna wartość: `on`) +* [[option_weechat.completion.command_inline]] *weechat.completion.command_inline* +** opis: `if enabled, the commands inside command line are completed (the command at beginning of line has higher priority and is used first); note: when this option is enabled, there is no more automatic completion of paths beginning with '/' (outside commands arguments)` +** typ: bool +** wartości: on, off (domyślna wartość: `on`) + * [[option_weechat.completion.default_template]] *weechat.completion.default_template* ** opis: `domyślny szablon dopełnień (zajrzyj do dokumentacji w celu uzyskania kodów i wartości szablonów: opis API wtyczek, funkcja "weechat_hook_command")` ** typ: ciąg @@ -518,6 +528,11 @@ ** typ: ciąg ** wartości: dowolny ciąg (domyślna wartość: `""`) +* [[option_weechat.look.command_incomplete]] *weechat.look.command_incomplete* +** opis: `jeśli ustawione, niekompletne i jednoznaczne komendy są dozwolone, na przykład /he dla /help` +** typ: bool +** wartości: on, off (domyślna wartość: `off`) + * [[option_weechat.look.confirm_quit]] *weechat.look.confirm_quit* ** opis: `jeśli ustawione, komenda /quit musi być potwierdzona dodatkowym argumentem "-yes" (zobacz /help quit)` ** typ: bool @@ -663,6 +678,11 @@ ** typ: ciąg ** wartości: dowolny ciąg (domyślna wartość: `"!"`) +* [[option_weechat.look.item_mouse_status]] *weechat.look.item_mouse_status* +** opis: `string used to show if mouse is enabled (bar item "mouse_status")` +** typ: ciąg +** wartości: dowolny ciąg (domyślna wartość: `"M"`) + * [[option_weechat.look.item_time_format]] *weechat.look.item_time_format* ** opis: `format czasu dla elementu paska "time" (zobacz man strftime dla specyfikatorów daty/czasu)` ** typ: ciąg diff --git a/doc/pl/weechat.1.pl.asciidoc b/doc/pl/weechat.1.pl.asciidoc index 701ceb93d..b5b6f36cd 100644 --- a/doc/pl/weechat.1.pl.asciidoc +++ b/doc/pl/weechat.1.pl.asciidoc @@ -52,9 +52,8 @@ $HOME/.weechat/weechat.conf:: $HOME/.weechat/plugins.conf:: plik konfiguracyjny wtyczek -// TRANSLATION MISSING $HOME/.weechat/sec.conf:: - configuration file with secured data + plik konfiguracyjny z zabezpieczonymi danymi $HOME/.weechat/alias.conf:: plik konfiguracyjny wtyczki 'alias' diff --git a/doc/pl/weechat_faq.pl.asciidoc b/doc/pl/weechat_faq.pl.asciidoc index 402aaa3ea..19e712e18 100644 --- a/doc/pl/weechat_faq.pl.asciidoc +++ b/doc/pl/weechat_faq.pl.asciidoc @@ -51,6 +51,24 @@ zależności. Ten pakiet jest budowany prawie codziennie z użyciem repozytorium git. Ten pakiet może odpowiadać dokładnie wersji z gita i jest mniej wygodny przy aktualizowaniu jak klonowanie z gita. +// TRANSLATION MISSING +[[compile_osx]] +=== How can I install WeeChat on OS X? + +// TRANSLATION MISSING +It is recommended to use http://brew.sh/[Homebrew], you can get help with: + +---- +brew info weechat +---- + +// TRANSLATION MISSING +You can install WeeChat with this command: + +---- +brew install weechat --with-python --with-perl +---- + [[lost]] === Uruchomiłem WeeChat, ale czuję się zagubiony, co robić? @@ -651,7 +669,21 @@ Dla WeeChat ≤ 0.3.3, opcje te to 'irc.network.away_check' oraz [[highlight_notification]] === Jak mogę zostać powiadomiony, jeśli ktoś będzie chciał przyciągnąć moją uwagę na kanale? -Możesz użyć skryptu jak 'beep.pl' lub 'launcher.pl'. +// TRANSLATION MISSING +With WeeChat ≥ 1.0, there is a default trigger "beep" which sends a 'BEL' to +the terminal on a highlight or private message. Thus you can configure your +terminal (or multiplexer like screen/tmux) to run a command or play a sound +when a 'BEL' occurs. + +// TRANSLATION MISSING +Or you can add a command in "beep" trigger: + +---- +/set trigger.trigger.beep.command "/print -beep;/exec -bg /ścieżka/do/komendy argumenty" +---- + +// TRANSLATION MISSING +With an older WeeChat, you can use a script like 'beep.pl' or 'launcher.pl'. Dla 'launcher.pl', należ przeprowadzić konfigurację: diff --git a/doc/pl/weechat_user.pl.asciidoc b/doc/pl/weechat_user.pl.asciidoc index 86d5e3cf3..69c1c7c54 100644 --- a/doc/pl/weechat_user.pl.asciidoc +++ b/doc/pl/weechat_user.pl.asciidoc @@ -45,7 +45,8 @@ Strona domowa WeeChat: http://weechat.org/ * działający system GNU/Linux (z narzędziami kompilatora dla kompilacji ze źródeł), lub kompatybilny system * przywileje 'roota' (do instalacji w katalogu systemowym) -* bibliotekę ncurses +// TRANSLATION MISSING +* some libraries (see <<dependencies,dependencies>>). [[install]] == Instalacja @@ -74,6 +75,12 @@ pakietów. WeeChat może być kompilowany za pomocą cmake lub autotools (cmake jest zalecany). +// TRANSLATION MISSING +[NOTE] +On OS X, you can use http://brew.sh/[Homebrew]: +`brew install weechat --with-python --with-perl` +(for help: `brew info weechat`). + [[dependencies]] ==== Zależności @@ -84,18 +91,20 @@ WeeChat. |=== | Pakiet ^(1)^ | Wersja | Wymagany | Opis | cmake | | *tak* | Kompilacja (możliwe jest użycie autotools, jednak cmake jest zalecany) +// TRANSLATION MISSING +| pkg-config | | *tak* | Detect installed libraries | libncursesw5-dev ^(2)^ | | *tak* | Interfejs ncurses | libcurl4-gnutls-dev | | *tak* | Transfer URL | zlib1g-dev | | *tak* | Kompresja pakietów we wtyczce relay (protokół weechat), wtyczka script -| libgcrypt11-dev | | *tak* | Zabezpieczone dane, uwierzytelnianie IRC SASL (DH-BLOWFISH/DH-AES), wtyczka script -| libgnutls-dev | ≥ 2.2.0 | | Połączenia SSL z serwerami IRC, wsparcie dla SSL we wtyczce relay +| libgcrypt20-dev | | *tak* | Zabezpieczone dane, uwierzytelnianie IRC SASL (DH-BLOWFISH/DH-AES), wtyczka script +| libgnutls28-dev | ≥ 2.2.0 | | Połączenia SSL z serwerami IRC, wsparcie dla SSL we wtyczce relay | gettext | | | Internacjonalizacja (tłumaczenie wiadomości; język bazowy to Angielski) | ca-certificates | | | Certyfikaty dla połączeń SSL | libaspell-dev or libenchant-dev | | | Wtyczka aspell | python-dev | ≥ 2.5 ^(3)^ | | Wtyczka python | libperl-dev | | | Wtyczka perl -| ruby1.9.1-dev | ≥ 1.8 | | Wtyczka ruby -| liblua5.1-0-dev | | | Wtyczka lua +| ruby2.1-dev | ≥ 1.8 | | Wtyczka ruby +| liblua5.2-dev | | | Wtyczka lua | tcl-dev | ≥ 8.5 | | Wtyczka tcl | guile-2.0-dev | ≥ 2.0 | | Wtyczka guile (scheme) | asciidoc | ≥ 8.5.0 | | Tworzenie strony man i dokumentacji @@ -503,11 +512,12 @@ Ekran składa się z następujących obszarów: Pasek 'status' posiada następujące domyślne elementy: -[width="100%",cols="^3,^3,10",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Element | Przykład | Opis | time | `[12:55]` | Czas -| buffer_count | `[6]` | Ilość otwartych buforów +// TRANSLATION MISSING +| buffer_last_number | `[6]` | Number of last buffer in list | buffer_plugin | `[irc/freenode]` | Wtyczka dla obecnego bufora (wtyczka irc może dodać nazwę serwera IRC używanego przez bufor) | buffer_number | `3` | Numer obecnego buforu | buffer_name | `#test` | Nazwa obecnego buforu @@ -515,24 +525,41 @@ Pasek 'status' posiada następujące domyślne elementy: | buffer_nicklist_count | `{4}` | Ilość nicków na liście nicków | buffer_zoom | ! | `!` oznacza, że połączony bufor jest przybliżony (tylko ten jest wyświetlany), pusta wartość oznacza, że wszystkie połączone bufory są wyświetlane | buffer_filter | `*` | Wskaźnik filtrowania: `*` oznacza, że niektóre linie zostały odfiltrowywane (ukryte), pusta wartość oznacza, że wszystkie linie są wyświetlane +| scroll | `-Więcej(50)-` | Wskaźnik przewijania, z numerem linii poniżej ostatniej wyświetlanej | lag | `[Lag: 2.5]` | Wskaźnik opóźnienia, w sekundach (ukryty dla niskich opóźnień) | hotlist | `[H: 4:#abc(2,5), 6]` | Lista buforów z aktywnością (nieprzeczytane wiadomości) (w przykładzie, 2 podświetlenia i 5 nieprzeczytanych wiadomości w '#abc', jedna wiadomość w buforze #6) | completion | `abc(2) def(5)` | Lista słów do dopełnienia, z ilością możliwych dopełnień dla każdego słowa -| scroll | `-Więcej(50)-` | Wskaźnik przewijania, z numerem linii poniżej ostatniej wyświetlanej |=== Pasek 'input' posiada następujące domyślne elementy: -[width="100%",cols="^3,^6,8",options="header"] +[width="100%",cols="^3,^4,10",options="header"] |=== | Element | Przykład | Opis -| input_paste | `[Wkleić 7 linii ? [ctrl-Y] Tak [ctrl-N] Nie]` | Pyta użytkownika podczas wklejania kilku linii tekstu | input_prompt | `[@Flashy(i)]` | Input prompt, dla irc: nick i tryby (tryb "+i" oznacza niewidzialny na freenode) | away | `(away)` | Wskaźnik nieobecności | input_search | `[Szukam (~ str,msg)]` | Wskaźnik wyszukiwania ("`~`": wielkość liter ma znaczenie, "`==`": wielkość liter nie ma znaczenia, "`str`": wyszukiwanie ciągu, "`regex`": wyszukiwanie wyrażenia regularnego, "`msg`": wyszukiwanie w wiadomościach, "`pre`": wyszukiwanie w prefiksach, "`pre\|msg`": wyszukiwanie w prefiksach i wiadomościach) +| input_paste | `[Wkleić 7 linii ? [ctrl-Y] Tak [ctrl-N] Nie]` | Pyta użytkownika podczas wklejania kilku linii tekstu | input_text | `hi peter!` | Wprowadzony tekst |=== +// TRANSLATION MISSING +Other items available (not used in bars by default): + +// TRANSLATION MISSING +[width="100%",cols="^3,^4,10",options="header"] +|=== +| Item | Example | Description +| aspell_dict | `fr,en` | Spelling dictionaries used on current buffer +| aspell_suggest | `print,prone,prune` | Spelling suggestions for word under cursor (if misspelled) +| buffer_count | `10` | Total number of buffers opened +| buffer_short_name | `#test` | Current buffer short name +| irc_channel | `#test` | Current IRC channel name +| irc_nick_modes | `@` | IRC modes for self nick +| mouse_status | `M` | Mouse status (empty if mouse is disabled) +| window_number | `2` | Current window number +|=== + [[buffers_and_windows]] === Bufory i okna @@ -1407,7 +1434,7 @@ Przykład: wyświetlenie "hello everybody!" z pogrubionym jasno niebieskim "hell i podkreślonym jasno czerwonym "everybody": ---- -^Cc12^Cbhello ^Cb^Cc04^Cueverybody^Cu^Cc! +^Cc12^Cbhello ^Cb^Cc04^C_everybody^C_^Cc! ---- [NOTE] @@ -3079,22 +3106,23 @@ identycznymi znakami). Dopasowane grupy, które mogą zostać użyte w "zamień": -* `$0` to `$99`: `$0` to pełne dopasowanie, `$1` do `$99` to przechwycone grupy -* `$+`: ostatnie dopasowanie (z najwyższym numerem) -* `$.cN`: dopasowanie "N" z wszystkimi znakami zastąpionymi "c" (przykład: `$.*2` - to grupa #2 ze znakami zastąpionymi `*`). +* `${re:0}` to `${re:99}`: `${re:0}` to pełne dopasowanie, `${re:1}` do + `${re:99}` to przechwycone grupy +* `${re:+}`: ostatnie dopasowanie (z najwyższym numerem) +* `${hide:c,${re:N}}`: dopasowanie "N" z wszystkimi znakami zastąpionymi "c" + (przykład: `${hide:*,${re:2}}` to grupa #2 ze znakami zastąpionymi `*`). Przykład: użyj pogrubienia dla słów pomiędzy "*": ---- -/\*(\S+)\*/*${color:bold}$1${color:-bold}*/ +/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/ ---- Przykład: domyślny trigger 'server_pass' używa tego wyrażenia do ukrycia hasła w komendach `/server` i `/connect` (znaki haseł są zastępowane przez `*`): ---- -==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5 +==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5} ---- [NOTE] @@ -3406,18 +3434,16 @@ include::autogen/user/xfer_commands.asciidoc[] [[support]] == Wsparcie -// TRANSLATION MISSING -Before asking for support, be sure you've read documentation and FAQ provided -with WeeChat. +Przed pytaniem o pomoc upewnij się, że przeczytałeś dokumentację i FAQ +dostarczone z WeeChat. -// TRANSLATION MISSING -For support with IRC, on server 'chat.freenode.net': +Wsparcie w sieci IRC na serwerze 'chat.freenode.net': -* official channels (with developers): -** '#weechat' (English) -** '#weechat-fr' (French) -* non-official channels: -** '#weechat-de' (German) +* oficjalne kanały (z developerami): +** '#weechat' (Angielski) +** '#weechat-fr' (Francuski) +* nieoficjalne kanały: +** '#weechat-de' (Niemiecki) -// TRANSLATION MISSING -For other ways of support, see: http://weechat.org/dev/support +Inne sposoby na uzyskanie pomocy można znaleźć pod adresem: +http://weechat.org/dev/support diff --git a/po/POTFILES.in b/po/POTFILES.in index e89ebdad6..c9681d5f4 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,4 +1,6 @@ ./doc/docgen.py +./src/core/wee-arraylist.c +./src/core/wee-arraylist.h ./src/core/wee-backtrace.c ./src/core/wee-backtrace.h ./src/core/weechat.c @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:46+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: cs\n" @@ -1422,11 +1422,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1440,23 +1441,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -1486,7 +1488,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -2870,6 +2872,11 @@ msgstr "" "předponu příkazu (napříkald: \".$\")" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3062,6 +3069,9 @@ msgstr "" msgid "string used to show zoom on merged buffer (bar item \"buffer_zoom\")" msgstr "" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3346,17 +3356,20 @@ msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "" "barva prefixu přezdívky (prefix je uživatelský řetězec před přezdívkou)" -#, fuzzy -msgid "text color for offline nick (not in nicklist any more)" -msgstr "barva textu pro nepřipojené přezdíveky" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" +msgstr "" -#, fuzzy -msgid "text color for offline nick with highlight" -msgstr "barva textu pro nepřipojené přezdíveky" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -#, fuzzy -msgid "background color for offline nick with highlight" -msgstr "barva pozadí pro zvýrazněný prefix" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" msgid "text color for other nick in private buffer" msgstr "barva textu pro jiné přezdívky v soukromém bufferu" @@ -3492,6 +3505,10 @@ msgstr "barva textu pro buffer se soukromou zprávou (status bar)" msgid "text color for filter indicator in status bar" msgstr "barva textu pro indikátor filtru ve stavovém řádku" +#, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "barva textu pro indikátor filtru ve stavovém řádku" + msgid "text color for current buffer name in status bar" msgstr "barva textu pro aktuální jméno bufferu ve stavovém řádku" @@ -3529,6 +3546,13 @@ msgid "" "the base word ends at first space after cursor" msgstr "" +msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + #, fuzzy msgid "" "default completion template (please see documentation for template codes and " @@ -3772,6 +3796,10 @@ msgstr "%sDo tohoto bufferu nemůžete zapisovat text" msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%sChyba s příkazem \"%s\" (zkuste /help %s)" +#, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%sChyba: neznámý příkaz \"%s\" (napište /help pro nápovědu)" + #, fuzzy, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" @@ -3780,13 +3808,14 @@ msgstr "" "%sChyba: nejednoznačný příkaz \"%s\": již existuje v mnoha pluginech a ne v " "pluginu \"%s\"" -#, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%sChyba: příliš mnoho volání příkazu \"%s\" (cyklení)" +#, fuzzy, c-format +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "%sChyba s příkazem \"%s\" (zkuste /help %s)" -#, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%sChyba: neznámý příkaz \"%s\" (napište /help pro nápovědu)" +#, fuzzy, c-format +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%sChyba: příliš mnoho volání příkazu \"%s\" (cyklení)" msgid "" "Error: unable to create/append to log file (weechat.log)\n" @@ -4999,6 +5028,21 @@ msgstr "%s%s: zrovna připojuji k serveru \"%s\"!" msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s: server %s%s%s vytvořen (dočasný server, NEUKLÁDA SE!)" +#, fuzzy, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s: nemohu registrovat skript \"%s\" (jiný skript se stejným jménem již " +"existuje)" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + #, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%sCTCP dotaz pro %s%s%s: %s%s%s%s%s" @@ -5387,10 +5431,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -6120,7 +6165,8 @@ msgstr "<přezdívka> <kanál>[,<kanál>...]" msgid "change mode on channel, without having operator status" msgstr "změnit mód kanálu, bez nutnosti mít operátorské oprávnění" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<kanál> <mód>" msgid "" @@ -6617,8 +6663,9 @@ msgstr "příkaz spuštěný při startu WeeChat, před načtením pluginů" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" msgid "" @@ -7098,6 +7145,12 @@ msgstr "povolit chytrý filter pro \"nick\" zprávy" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "povolit chytrý filter pro \"part\" a \"quit\" zprávy" +#, fuzzy +msgid "enable creation of temporary servers with command /connect" +msgstr "" +"%s%s: nemohu registrovat skript \"%s\" (jiný skript se stejným jménem již " +"existuje)" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" "ořezávat barvy z tématu rozhovoru (použito pouze při zobrazování titulku " @@ -7532,8 +7585,8 @@ msgstr "%sByl jsi pozván na %s%s%s od %s%s%s" msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s: nemohu vytvořit nový kanál \"%s\"" -#, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +#, fuzzy, c-format +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s%s%s%s%s%s%s%s%s se připojil %s%s%s" #, c-format @@ -7700,12 +7753,12 @@ msgid "%sChannel reop %s%s%s: %s%s" msgstr "%sReop kanálu %s%s%s: %s%s" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)%s v %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s" msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)" #, fuzzy, c-format @@ -7713,10 +7766,14 @@ msgid "%s%s[%s%s%s] %s%s%s invited" msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" msgstr "%s%s[%s%s%s]%s vyjímka %s%s%s od %s%s %s(%s%s%s)%s v %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s vyjímka %s%s" + #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" msgstr "%s%s[%s%s%s]%s vyjímka %s%s" @@ -7762,14 +7819,18 @@ msgstr[1] "přezdívka" msgstr[2] "přezdívky" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s zakázán uživatelem %s%s %s(%s%s%s)%s v %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s zakázán uživatelem %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" msgstr "%s%s[%s%s%s] %s%s%s zakázán uživatelem %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)" + #, c-format msgid "" "%s%s: all declared nicknames are already in use or invalid, closing " @@ -7803,11 +7864,15 @@ msgstr "" #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)%s v %s" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" +msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)" #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s quieted" msgstr "%s%s[%s%s%s] %s%s%s pozván uživatelem %s%s %s(%s%s%s)" #, c-format @@ -8648,10 +8713,6 @@ msgid "structure with completion" msgstr "funkce pro příkazovou řádku" #, fuzzy -msgid "structure with partial completion" -msgstr "upozornit uživatele pokud nastane částečné doplnění" - -#, fuzzy msgid "config file" msgstr "konfigurační soubory" @@ -9080,6 +9141,10 @@ msgid "Listening on ports:" msgstr "Poslouchám na portech:" #, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " port %s%d%s, přesměrování: %s%s.%s%s, spuštěno v: %s" + +#, fuzzy, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " port %s%d%s, přesměrování: %s%s.%s%s, spuštěno v: %s" @@ -9103,8 +9168,8 @@ msgstr "ovládání přesměrování" #, fuzzy msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" "list|listfull|listrelay || add <protocol.name> <port> || del <protocol.name> " "|| raw" @@ -9114,8 +9179,18 @@ msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -9124,10 +9199,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -9300,9 +9376,9 @@ msgid "display backlog starting from last client disconnect" msgstr "" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -9982,6 +10058,12 @@ msgstr "Žádné rmodifikátory nejsou definovány" msgid "List of default triggers:" msgstr "Seznam aliasů:" +#, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + #, fuzzy, c-format msgid "Trigger \"%s\" restarted" msgstr "Pole \"%s\" vytvořeno" @@ -10083,6 +10165,14 @@ msgstr "Rmodifikátor \"%s\" odebrán" msgid "Trigger:" msgstr "" +#, fuzzy, c-format +msgid "Trigger \"%s\" restored" +msgstr "Pole \"%s\" vytvořeno" + +#, fuzzy, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sKlávesa \"%s\" nenalezena" + #, fuzzy msgid "Default triggers restored:" msgstr "Výchozí rmodifikátory obnoveny:" @@ -10104,8 +10194,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -10158,7 +10248,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -10176,9 +10268,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -10195,6 +10287,10 @@ msgid "triggers" msgstr "" #, fuzzy +msgid "default triggers" +msgstr "Seznam aliasů:" + +#, fuzzy msgid "options for triggers" msgstr "volby pro proxy" @@ -10263,8 +10359,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -10428,6 +10525,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "%s: soubor %s (lokální jméno souboru: %s) bude obnoven na pozici %llu" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: nekorektní znaková sada: \"%s\"" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s: chybí argumenty (%s)" @@ -10444,14 +10549,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s: nemohu přistupovat k souboru \"%s\"" #, fuzzy, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "%s%s: nekorektní znaková sada: \"%s\"" - -#, fuzzy, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s: nekorektní znaková sada: \"%s\"" - -#, fuzzy, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s: nemohu vytvořit soket pro xfer" @@ -22,8 +22,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:54+0100\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <weechatter@arcor.de>\n" "Language: de_DE\n" @@ -1091,7 +1091,7 @@ msgstr "" "\"window\"):\n" " active: in einem aktiven Fenster\n" " inactive: in einem inaktiven Fenster\n" -" nicklist: in Fenstern mit einer Nickliste\n" +" nicklist: in Fenstern mit einer Benutzerliste\n" " weitere Merkmale: siehe /help weechat.bar.xxx.conditions und /" "help eval\n" " ohne Angabe von Merkmalen wird die Infobar immer angezeigt\n" @@ -1127,7 +1127,7 @@ msgstr "" "completion\n" " versteckt die Infobar (meinebar):\n" " /bar hide meinebar\n" -" scrollt die Nickliste im aktuellen Buffer um 10 Zeilen nach unten:\n" +" scrollt die Benutzerliste im aktuellen Buffer um 10 Zeilen nach unten:\n" " /bar scroll nicklist * y+10\n" " scrollt zum Ende der Nicklist im aktuellen Buffer:\n" " /bar scroll nicklist * ye" @@ -1399,7 +1399,7 @@ msgstr "" "Punkt.\n" "\n" "Beispiele:\n" -" gehe zur Nickliste:\n" +" gehe zur Benutzerliste:\n" " /cursor go nicklist\n" " gehe zu den Koordinaten x=10, y=5:\n" " /cursor go 10,5" @@ -1496,11 +1496,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1514,23 +1515,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: gibt das Ergebnis aus, ohne das dieses in den Buffer gesendet " "wird (debug Modus)\n" @@ -1566,11 +1568,13 @@ msgstr "" "ersetzt. Mögliche Variablen sind, nach Reihenfolge ihrer Priorität:\n" " 1. eine Zeichenkette mit Escapesequenzen (Format: \"esc:xxx\" oder \"\\xxx" "\")\n" -" 2. eine Farbe (Format: color:xxx)\n" -" 3. eine Info (Format: \"info:name,arguments\", Argumente sind optional)\n" -" 4. der Name einer Option (Format: file.section.option)\n" -" 5. der Name einer lokalen Variablen eines Buffer\n" -" 6. ein hdata Name/Variable (der Wert wird automatisch als Zeichenkette " +" 2. Zeichen welche in einer Zeichenkette nicht dargestellt werden sollen " +"(Format: \"hide:Zeichen,Zeichenkette\")\n" +" 3. eine Farbe (Format: color:xxx)\n" +" 4. eine Info (Format: \"info:name,arguments\", Argumente sind optional)\n" +" 5. der Name einer Option (Format: file.section.option)\n" +" 6. der Name einer lokalen Variablen eines Buffer\n" +" 7. ein hdata Name/Variable (der Wert wird automatisch als Zeichenkette " "konvertiert), standardmäßig wird für \"window\" und \"buffer\" das aktuelle " "Fenster/Buffer verwendet.\n" "Das Format für hdata kann wie folgt aufgebaut sein:\n" @@ -1593,6 +1597,7 @@ msgstr "" " /eval -n ${window.buffer.full_name} ==> core.weechat\n" " /eval -n ${window.buffer.number} ==> 1\n" " /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Beispiele (Bedingungen):\n" " /eval -n -c ${window.buffer.number} > 2 ==> 0\n" @@ -1629,7 +1634,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -1698,10 +1703,10 @@ msgstr "" " - beginnt ein Name mit '!' wird für diesen Buffer kein Filter " "genutzt\n" " - Platzhalter \"*\" kann verwendet werden\n" -" tags: durch Kommata getrennte Liste von Schlagwörtern. Zum Beispiel: " +" tags: durch Kommata getrennte Liste von Schlagwörtern. Zum Beispiel: " "\"irc_join,irc_part,irc_quit\"\n" -" - logisch \"und\": wird \"+\" zwischen den Tags verwendet (zum " -"Beispiel: \"nick_toto+irc_action\")\n" +" - logisch \"und\": mittels \"+\" zwischen den Tags (zum Beispiel: " +"\"nick_toto+irc_action\")\n" " - Platzhalter \"*\" kann verwendet werden\n" " - wird ein Tag mit '!' eingeleitet, dann muss dieser Tag NICHT in " "der Nachricht enthalten sein\n" @@ -1710,7 +1715,7 @@ msgstr "" "getrennt. Sonderzeichen wie '|' müssen mit einer Escapesequenz : '\\|' " "eingebunden werden)\n" " - wird ein regulärer Ausdruck mit '!' eingeleitet dann wird das " -"übereinstimmende Ergebnis umgekehrt (nutze '\\!' um mit '!' zu beginnen)\n" +"übereinstimmende Ergebnis umgekehrt (nutze '\\!' um mit '!' zu beginnen)\n" " - es werden zwei reguläre Ausdrücke erstellt: Der erste für den " "Präfix und der zweite für die eigentliche Nachricht\n" " - reguläre Ausdrücke unterscheiden nicht zwischen Groß- und " @@ -1731,7 +1736,7 @@ msgstr "" " irc_numeric, irc_error, irc_action, irc_ctcp, irc_ctcp_reply, " "irc_smart_filter, away_info.\n" "Mittels \"/debug tags\" kann man sich die Tags jeder einzelnen Zeile " -"darstellen zu lassen.\n" +"darstellen lassen.\n" "\n" "Beispiele:\n" " aktiviert den intelligenten IRC Filter für alle Buffer:\n" @@ -2000,7 +2005,7 @@ msgstr "" "gelöschte Tastenbelegungen)\n" " context: Name des Kontextes (\"default\" oder \"search\")\n" " bind: belegt eine Taste mit einem Befehl oder zeigt an welcher Befehl " -"auf eine Taste gelegt wurde (für Kontext \"default\")\n" +"auf eine Taste gelegt wurde (für Kontext \"default\")\n" " bindctxt: belegt eine Taste mit einem Befehl oder zeigt an welcher Befehl " "auf eine Taste gelegt wurde, dies trifft für Kontext definierte Tasten zu\n" " command: Befehl (mehrere Befehle werden durch ein Semikolon getrennt)\n" @@ -2128,7 +2133,7 @@ msgstr "" "wiederhergestellt wird (sinnvoll um die Mausunterstützung zeitabhängig zu " "deaktivieren)\n" "\n" -"Die Mausunterstützung wird in der Option \"weechat.look.mouse\" gesichert.\n" +"Die Mausunterstützung wird in der Option \"weechat.look.mouse\" gesichert.\n" "\n" "Beispiele:\n" " Mausunterstützung aktivieren:\n" @@ -2808,7 +2813,7 @@ msgstr "" "Text der in dem Buffer ausgegeben werden soll\n" "\n" "Hinweis: Der Befehl der Zeit verzögert gestartet werden soll wird im selben " -"Buffer ausgeführt in dem auch der /wait Befehl aufgerufen wurde. Falls der " +"Buffer ausgeführt in dem auch der /wait Befehl aufgerufen wurde. Falls der " "Buffer nicht gefunden werden kann, da er in der Zwischenzeit zum Beispiel " "geschlossen wurde, wird der Befehl im WeeChat Core-Buffer ausgeführt.\n" "\n" @@ -2929,7 +2934,7 @@ msgstr "" " scroll_up: scrollt ein paar Zeilen nach oben\n" " scroll_down: scrollt ein paar Zeilen nach unten\n" " scroll_top: scrollt zum Anfang des Buffers\n" -"scroll_bottom: scrollt zum Ende des Buffers\n" +"scroll_bottom: scrollt zum Ende des Buffers\n" "scroll_beyond_end: scrollt über das Ende des Buffers hinaus\n" "scroll_previous_highlight: scrollt zum vorherigen Hightlight\n" "scroll_next_highlight: scrollt zum nächsten Highlight\n" @@ -2999,7 +3004,7 @@ msgid "names of infolists hooked" msgstr "Namen der gehookten Infolisten" msgid "nicks in nicklist of current buffer" -msgstr "Nicks in Nickliste für aktuellen Buffer" +msgstr "Nicks in Benutzerliste für aktuellen Buffer" msgid "configuration options" msgstr "Konfigurationsoptionen" @@ -3318,7 +3323,7 @@ msgstr "" msgid "use a different color for offline nicks (not in nicklist any more)" msgstr "" "Nicks die Offline sind werden im Buffer in einer anderen Farbe dargestellt " -"(dies betrifft Nicks, die nicht in der Nickliste vorhanden sind!)" +"(dies betrifft Nicks, die nicht in der Benutzerliste vorhanden sind!)" msgid "" "automatically reset table of color pairs when number of available pairs is " @@ -3352,6 +3357,13 @@ msgstr "" "ist ein reserviertes Zeichen und wird immer genutzt" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" +"ist diese Option aktiviert werden unvollständige und eindeutige Befehle " +"akzeptiert, zum Beispiel /he für /help" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3596,6 +3608,11 @@ msgstr "" "Zeichen mit welchem signalisiert wird ob im aktuellen Buffer der Zoom " "aktiviert ist (durch Bar-Item \"buffer_zoom\")" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" +"Zeichen mit welchem signalisiert wird ob die Mausfunktionalität " +"eingeschaltet ist (durch Bar-Item \"mouse_status\")" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3941,19 +3958,29 @@ msgstr "" msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "Farbe für den Nick-Präfix (Zeichenkette die vor dem Nick steht)" -msgid "text color for offline nick (not in nicklist any more)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" msgstr "" -"Textfarbe für Nicks im Buffer die Offline sind (dies betrifft Nicks, die " -"nicht in der Nickliste vorhanden sind!)" +"Textfarbe für Nicks die nicht angemeldet sind (nicht in der Benutzerliste " +"aufgeführt sind); diese Farbeinstellung wird aber nur verwendet wenn die " +"Option weechat.look.color_nick_offline aktiviert ist" -msgid "text color for offline nick with highlight" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" msgstr "" -"Textfarbe für Highlight Nachrichten von Nicks die nicht mehr Online sind" +"Textfarbe bei Highlights für Nicks die nicht angemeldet sind; diese " +"Farbeinstellung wird aber nur verwendet wenn die Option weechat.look." +"color_nick_offline aktiviert ist" -msgid "background color for offline nick with highlight" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" msgstr "" -"Hintergrundfarbe für Highlight Nachrichten von Nicks die nicht mehr Online " -"sind" +"Hintergrundfarbe bei Highlights für Nicks die nicht angemeldet sind, diese " +"Farbeinstellung wird aber nur verwendet wenn die Option weechat.look." +"color_nick_offline aktiviert ist" msgid "text color for other nick in private buffer" msgstr "Farbe des anderen Nicknamens in einem privaten Buffer" @@ -4106,6 +4133,9 @@ msgstr "Farbe eines Buffers mit privater Nachricht (Statusbar)" msgid "text color for filter indicator in status bar" msgstr "Farbe des Filterkennzeichens in der Statuszeile" +msgid "text color for mouse indicator in status bar" +msgstr "Farbe des Zeichens welches den Status der Maus anzeigt" + msgid "text color for current buffer name in status bar" msgstr "Farbe des aktuellen Buffer-Namens in der Statuszeile" @@ -4118,7 +4148,7 @@ msgstr "" "ist" msgid "text color for number of nicks in nicklist (status bar)" -msgstr "Textfarbe für die Anzahl der Nicks in der Nickliste (Statusbar)" +msgstr "Textfarbe für die Anzahl der Nicks in der Benutzerliste (Statusbar)" msgid "text color for current buffer number in status bar" msgstr "Farbe des aktuellen Channels in der Statuszeile" @@ -4133,7 +4163,7 @@ msgid "text color for away nicknames" msgstr "Textfarbe von abwesenden Nicknamen" msgid "text color for groups in nicklist" -msgstr "Textfarbe für Gruppen in Nickliste" +msgstr "Textfarbe für Gruppen in Benutzerliste" msgid "text color for offline nicknames" msgstr "Textfarbe von Nicknamen die Offline sind" @@ -4149,6 +4179,18 @@ msgstr "" "schon geschriebenen Text, einen Nick einzufügen)" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" +"ist diese Option aktiviert werden Befehle innerhalb der Eingabezeile " +"vervollständigt (ein Befehl zu Beginn der Eingabezeile besitzt die höhere " +"Priorität und wird zuerst verwendet). Hinweis: die Vervollständigung von " +"Verzeichnissen, die mit '/' beginnen, funktioniert außerhalb von Befehlen " +"nicht mehr" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -4410,6 +4452,11 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%sFehler mit dem Befehl \"%s\" aufgetreten (nutze: /help %s)" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "" +"%sFehler: Der Befehl \"%s\" ist nicht bekannt. Für eine Hilfe nutze /help" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" @@ -4418,13 +4465,15 @@ msgstr "" "Erweiterungen, aber nicht für die Erweiterung \"%s\"" #, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%sFehler: zu viele Aufrufe des Programms \"%s\" (Wiederholungen)" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "" +"%sFehler: für den unvollständiger Befehl \"%s\" existieren mehrere mögliche " +"Befehle" #, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "" -"%sFehler: Der Befehl \"%s\" ist nicht bekannt. Für eine Hilfe nutze /help" +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%sFehler: zu viele Aufrufe des Programms \"%s\" (Wiederholungen)" msgid "" "Error: unable to create/append to log file (weechat.log)\n" @@ -4807,10 +4856,10 @@ msgid "" msgstr "" "Bedingung(en), damit eine Infobar angezeigt wird (Infobars vom Typ \"window" "\"). Eine einfache Bedingung: \"active\", \"inactive\", \"nicklist" -"\" (Fenster muss aktiv/inaktiv sein oder der Buffer enthält eine Nickliste), " -"oder man nutzt einen Ausdruck mit Bedingungen (siehe /help eval). Zum " -"Beispiel: \"${nicklist} && ${window.win_width} > 100\" (lokale Variablen für " -"den Ausdruck sind ${active}, ${inactive} und ${nicklist})" +"\" (Fenster muss aktiv/inaktiv sein oder der Buffer enthält eine " +"Benutzerliste), oder man nutzt einen Ausdruck mit Bedingungen (siehe /help " +"eval). Zum Beispiel: \"${nicklist} && ${window.win_width} > 100\" (lokale " +"Variablen für den Ausdruck sind ${active}, ${inactive} und ${nicklist})" msgid "bar position (bottom, top, left, right)" msgstr "Position der Infobar (unten, oben, links, rechts)" @@ -5367,7 +5416,7 @@ msgstr "" " reset: setze im aktuellen Buffer den Zeichensatz zurück" msgid "Execution of external commands in WeeChat" -msgstr "externe Befehle aus WeeChat heraus ausführen" +msgstr "externe Befehle aus WeeChat heraus ausführen" #, c-format msgid "%s: end of command %d (\"%s\"), return code: %d" @@ -5627,9 +5676,9 @@ msgid "" "default options for command /exec (see /help exec); example: \"-nosh -bg\" " "to run all commands in background (no output), and without using the shell" msgstr "" -"Standardoptionen für den Befehl /exec (siehe /help exec); Beispiele: \"-" -"nosh -bg\" führt alle Befehle im Hintergrund aus (keine Textausgabe) und " -"ohne das die shell genutzt wird" +"Standardoptionen für den Befehl /exec (siehe /help exec); Beispiele: \"-nosh " +"-bg\" führt alle Befehle im Hintergrund aus (keine Textausgabe) und ohne das " +"die shell genutzt wird" msgid "" "delay for purging finished commands (in seconds, 0 = purge commands " @@ -5834,6 +5883,26 @@ msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s: Server %s%s%s angelegt (temporärer Server, WIRD NICHT GESICHERT!)" #, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s: ein temporärer Server, \"%s\", kann nicht erstellt werden da die " +"Erstellung temporärer Server mittels des Befehls /connect zur Zeit " +"deaktiviert ist" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" +"%s%s: soll ein Standardserver erstellt werden, muss der Befehl \"/server add" +"\" (siehe /help server) verwendet werden; soll ein temporärer Server (WIRD " +"NICHT GESICHERT) erstellt werden, muss die Option irc.look.temporary_servers " +"aktiviert werden" + +#, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%sCTCP Anfrage an %s%s%s: %s%s%s%s%s" @@ -6116,7 +6185,7 @@ msgid "" msgstr "" " -current: führt einen Befehl aus der an alle Channels des aktuellen Servers " "gesendet wird\n" -" -exclude: dient zum Ausschluss ausgewählter Channels (Platzhalter \"*\" " +" -exclude: dient zum Ausschluss ausgewählter Channels (Platzhalter \"*\" " "kann verwendet werden)\n" " command: Befehl der ausgeführt werden soll\n" "arguments: Argumente für Befehl (Variablen die genutzt werden können und " @@ -6243,10 +6312,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -6268,14 +6338,17 @@ msgid "" " /connect irc://nick@irc.oftc.net/#channel\n" " /connect -switch" msgstr "" -" server: Name des Servers (folgende Möglichkeiten bestehen):\n" +" server: Name des Servers, folgende Möglichkeiten bestehen:\n" " - intern genutzter Servername, zu dem eine Verbindung aufgebaut " -"werden soll (Der Server sollte zuerst mittels \"/server add\" angelegt " -"werden)\n" -" - Hostname/Port oder IP/Port (damit wird lediglich ein " -"TEMPORÄRER Server erstellt), Port 6667 wird standardmäßig verwendet\n" +"werden soll (Server muss zuerst mittels \"/server add\" angelegt werden " +"(wird empfohlen!))\n" +" - Hostname/Port oder IP/Port, Port 6667 wird standardmäßig " +"verwendet\n" " - URL mit folgendem Format: irc[6][s]://[nickname[:" "password]@]irc.example.org[:port][/#channel1][,#channel2[...]]\n" +" Hinweis: bei einer Adresse/IP/URL, wird ein temporärer Server " +"erstellt (DIESER WIRD NICHT GESPEICHERT), siehe /help irc.look." +"temporary_servers\n" " option: legt Option für den Server fest (die Boolean-Optionen können " "weggelassen werden)\n" " nooption: deaktiviert eine Boolean Option (Beispiel: -nossl)\n" @@ -6284,7 +6357,7 @@ msgstr "" " -auto: Verbindung zu den Servern herstellen, für die die Option " "\"autoconnect\" aktiviert ist\n" " -open: stellt eine Verbindung zu allen geöffneten Servern her, zu denen " -"aktuell aber keine Verbindung besteht\n" +"aktuell keine Verbindung besteht\n" " -nojoin: Channel(s) werden nicht betreten (auch falls die Funktion " "\"autojoin\" aktiviert sein sollte)\n" " -switch: wechselt zur nächsten Server-Adresse\n" @@ -6412,7 +6485,7 @@ msgid "" msgstr "" "server: interner Name des Servers\n" " -all: Verbindung zu allen Servern trennen\n" -"-pending: bricht eine automatische Wiederverbindung für Server ab, zu denen " +"-pending: bricht eine automatische Wiederverbindung für Server ab, zu denen " "gerade eine erneute Verbindung aufgebaut werden soll\n" "reason: Begründung der Trennung" @@ -6475,7 +6548,7 @@ msgstr "" " /ignore add toto\n" " ignoriert den Host \"toto@domain.com\" auf dem freenode Server:\n" " /ignore add toto@domain.com freenode\n" -" ignoriert den Host \"toto*@*.domain.com\" im Chat freenode/#weechat:\n" +" ignoriert den Host \"toto*@*.domain.com\" im Chat freenode/#weechat:\n" " /ignore add toto*@*.domain.com freenode #weechat" msgid "get information describing the server" @@ -6549,7 +6622,7 @@ msgid "" msgstr "" "channel: Channelname\n" " nick: Nick der rausgeworfen werden soll\n" -" reason: Begründung für den Rauswurf (Variablen die genutzt werden können: " +" reason: Begründung für den Rauswurf (Variablen die genutzt werden können: " "$nick, $channel und $server)" msgid "kick a user out of a channel and ban the host" @@ -6991,8 +7064,8 @@ msgstr "<nick> <channel>[,<channel>...]" msgid "change mode on channel, without having operator status" msgstr "ändert den Modus des Channels ohne das Operator-Privilegien vorliegen" -msgid "<channel> <mode>" -msgstr "<channel> <mode>" +msgid "[<channel>] <mode>" +msgstr "[<channel>] <mode>" msgid "" "channel: channel name\n" @@ -7512,16 +7585,17 @@ msgid "password for server (note: content is evaluated, see /help eval)" msgstr "Passwort für Server (Hinweis: Inhalt wird evaluiert, siehe /help eval)" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) -#, fuzzy msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" "durch Kommata getrennte Liste von erweiterten Client Fähigkeiten (\"client " "capabilities\"), welche vom Server angeboten und genutzt werden sollen. " -"Fähigkeiten die von WeeChat unterstützt werden: multi-prefix, userhost-in-" -"name, away-notify (Beispiel: \"multi-prefix, userhost-in-name,away-notify\")" +"Fähigkeiten die von WeeChat unterstützt werden: away-notify, extended-join, " +"multi-prefix, server-time, userhost-in-name (Beispiel: \"away-notify,multi-" +"prefix\")" msgid "" "mechanism for SASL authentication: \"plain\" for plain text password, \"dh-" @@ -7774,7 +7848,7 @@ msgid "display host in join messages" msgstr "zeigt den Host innerhalb einer join Nachricht an" msgid "display host in join messages from local client" -msgstr "zeigt den Host innerhalb einer join Nachrichten des lokalen Client an" +msgstr "zeigt den Host innerhalb einer join Nachrichten des lokalen Client an" msgid "display host in part/quit messages" msgstr "zeigt den Host innerhalb einer part/quit Nachricht an" @@ -7815,7 +7889,7 @@ msgstr "" "unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss " "zu Beginn \"(?-i)\" genutzt werden; des weiteren können folgende Variablen " "genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann " -"werden die angegeben Wörter dem Buffer-Merkmal \"highlight_words\" " +"werden die angegeben Wörter dem Buffer-Merkmal \"highlight_words\" " "hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf " "schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein " "Highlight für den Nick. Beispiel: \"$nick\", \"(?-i)$nick\"" @@ -7834,7 +7908,7 @@ msgstr "" "unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss " "zu Beginn \"(?-i)\" genutzt werden; des weiteren können folgende Variablen " "genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann " -"werden die angegeben Wörter dem Buffer-Merkmal \"highlight_words\" " +"werden die angegeben Wörter dem Buffer-Merkmal \"highlight_words\" " "hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf " "schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein " "Highlight für den Nick. Beispiel: \"$nick\", \"(?-i)$nick\"" @@ -7853,7 +7927,7 @@ msgstr "" "unterschieden. Um zwischen Groß- und Kleinschreibung zu unterscheiden muss " "zu Beginn \"(?-i)\" genutzt werden; des weiteren können folgende Variablen " "genutzt werden: $nick, $channel und $server). Wird ein Buffer geöffnet, dann " -"werden die angegeben Wörter dem Buffer-Merkmal \"highlight_words\" " +"werden die angegeben Wörter dem Buffer-Merkmal \"highlight_words\" " "hinzugefügt. Dies bedeutet, dass diese Option keinen direkten Einfluss auf " "schon geöffnete Buffer hat. Eine leere Zeichenkette deaktiviert ein " "Highlight für den Nick. Beispiel: \"$nick\", \"(?-i)$nick\"" @@ -8123,7 +8197,7 @@ msgstr "" "aktiviert einen intelligenten Filter für \"mode\" Nachrichten: \"*\" filtert " "alle Modi-Nachrichten, \"+\" um alle Modi im Server-Präfix zu filtern (zum " "Beispiel \"ovh\"), \"xyz\" um die Modi x/y/z zu filtern, \"-xyz\" um alle " -"Modi, außer x/y/z, zu filtern; Beispiele: \"ovh\": filtert die Modi o/v/h, " +"Modi, außer x/y/z, zu filtern; Beispiele: \"ovh\": filtert die Modi o/v/h, " "\"-bkl\": filtert alle Modi, ausgenommen b/k/l" #. TRANSLATORS: please do not translate "nick" @@ -8137,6 +8211,10 @@ msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "" "aktiviert einen intelligenten Filter für \"part\" und \"quit\" Nachrichten" +msgid "enable creation of temporary servers with command /connect" +msgstr "" +"aktiviert die Erstellung von temporären Servern mit dem Befehl /connect" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" "Farben werden im Channel-Thema entfernt (wird nur genutzt wenn der Buffer-" @@ -8265,7 +8343,7 @@ msgid "" msgstr "" "Vorgabewert für Befehle /ban, /unban und /kickban; Variablen $nick, $user, " "$ident und $host werden durch den jeweiligen Wert ersetzt (extrahiert aus " -"\"nick!user@host\"); $ident ist identisch mit $user, sofern $user nicht mit " +"\"nick!user@host\"); $ident ist identisch mit $user, sofern $user nicht mit " "\"~\" beginnt. Andernfalls wird daraus \"*\"; diese Vorgabemaske wird nur " "angewendet, sofern WeeChat den Host des Nicks ermitteln kann" @@ -8618,8 +8696,8 @@ msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s: der neue Channel \"%s\" konnte nicht erstellt werden" #, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" -msgstr "%s%s%s%s%s%s%s%s%s%s ist in den %s%s%s Channel eingetreten" +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +msgstr "%s%s%s%s%s%s%s%s%s%s%s%s ist in den Channel %s%s%s eingetreten" #, c-format msgid "%s%s%s%s has kicked %s%s%s %s(%s%s%s)" @@ -8788,12 +8866,12 @@ msgstr "%sChannel-Reop %s%s%s: %s%s" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s wurde von %s%s %s(%s%s%s)%s eingeladen am %s" +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s wurde von %s am %s eingeladen" #, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" -msgstr "%s%s[%s%s%s] %s%s%s wurde von %s%s %s(%s%s%s) eingeladen" +msgid "%s%s[%s%s%s] %s%s%s invited by %s" +msgstr "%s%s[%s%s%s] %s%s%s eingeladen von %s" #, c-format msgid "%s%s[%s%s%s] %s%s%s invited" @@ -8801,8 +8879,12 @@ msgstr "%s%s[%s%s%s] %s%s%s eingeladen" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s]%s Exception %s%s%s von %s%s %s(%s%s%s)%s auf %s" +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" +msgstr "%s%s[%s%s%s]%s Ausnahmesituation %s%s%s von %s auf %s" + +#, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s Ausnahmesituation %s%s%s von %s" #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" @@ -8847,12 +8929,16 @@ msgstr[1] "Nicks" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s wurde von %s%s %s(%s%s%s)%s gebannt , am %s" +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s wurde gebannt von %s am %s" #, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" -msgstr "%s%s[%s%s%s] %s%s%s wurde gebannt von %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s banned by %s" +msgstr "%s%s[%s%s%s] %s%s%s wurde gebannt von %s" + +#, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s gebannt" #, c-format msgid "" @@ -8890,13 +8976,16 @@ msgstr "" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "" -"%s%s[%s%s%s] %s%s%s wurde durch %s%s %s(%s%s%s)%s, am %s, das Wort entzogen" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s wurde durch %s das Wort entzogen, am %s" #, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" -msgstr "%s%s[%s%s%s] %s%s%s wurde durch %s%s %s(%s%s%s) das Wort entzogen" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" +msgstr "%s%s[%s%s%s] %s%s%s wurde durch %s das Wort entzogen" + +#, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted" +msgstr "%s%s[%s%s%s] %s%s%s wurde das Wort entzogen" #, c-format msgid "%s%s: command \"%s\" not found:" @@ -9121,7 +9210,7 @@ msgstr[1] "%sgnutls: empfange %d Zertifikate" #, c-format msgid "%sgnutls: failed to import certificate[%d]" -msgstr "%sgnutls: Zertifikat[%d] konnte nicht importiert werden" +msgstr "%sgnutls: Zertifikat[%d] konnte nicht importiert werden" #, c-format msgid "%s - certificate[%d] info:" @@ -9671,7 +9760,7 @@ msgid "list of layouts" msgstr "Auflistung der Layouts" msgid "nicks in nicklist for a buffer" -msgstr "Nicks in Nickliste für einen Buffer" +msgstr "Nicks in Benutzerliste für einen Buffer" msgid "nick_xxx or group_xxx to get only nick/group xxx (optional)" msgstr "" @@ -9733,9 +9822,6 @@ msgstr "besuchte Buffer" msgid "structure with completion" msgstr "Struktur mit Vervollständigung" -msgid "structure with partial completion" -msgstr "Struktur mit teilweise Vervollständigung" - msgid "config file" msgstr "Konfigurationsdatei" @@ -9779,10 +9865,10 @@ msgid "structure with one line data" msgstr "Struktur mit einzeiligen Daten" msgid "group in nicklist" -msgstr "Gruppen in Nickliste" +msgstr "Gruppen in Benutzerliste" msgid "nick in nicklist" -msgstr "Nick in Nickliste" +msgstr "Nick in Benutzerliste" msgid "proxy" msgstr "Proxy" @@ -10162,6 +10248,10 @@ msgid "Listening on ports:" msgstr "Lausche an Ports:" #, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " Port %s%d%s, Relay: %s%s%s, %s (nicht gestartet)" + +#, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " Port %s%d%s, Relay: %s%s%s, %s, gestartet am: %s" @@ -10184,18 +10274,28 @@ msgid "relay control" msgstr "Relay-Kontrolle" msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -10204,10 +10304,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -10234,19 +10335,30 @@ msgstr "" " listrelay: Auflistung der Relays (Name und Port)\n" " add: fügt ein Relay, für ein Protokoll + Name, hinzu\n" " del: entfernt Relay für ein Protokoll + Name\n" +" stop: schließt den Server Socket (Clients bleiben verbunden)\n" +" restart: beendet den Server Socket und lauscht erneut am Port (Clients " +"bleiben verbunden)\n" +" name: Name des Relays (siehe Format weiter unten)\n" +" port: Port der für Relay genutzt werden soll\n" +" raw: öffnet einen Buffer mit Relay-Rohdaten\n" +" sslcertkey: setzt SSL Zertifikat/Schlüssel mittels Pfad in Option relay." +"network.ssl_cert_key\n" +"\n" +"Aufbau des Relay-Namens: [ipv4.][ipv6.][ssl.]<Protokoll.Name>\n" " ipv4: erzwingt die Nutzung von IPv4\n" " ipv6: erzwingt die Nutzung von IPv6\n" " ssl: aktiviert SSL\n" -"protocol.name: Protokoll und Name des Relay:\n" +"protocol.name: Protokoll und Name relay:\n" " - Protokoll \"irc\": Name des Servers welcher geteilt " -"werden soll (optional). Wird kein Name angegeben, dann muss der Client den " -"Servernamen mittels Befehl \"PASS\" anfordern. Format: \"PASS Server:Passwort" -"\")\n" -" - Protokoll \"weechat\" (Name wird nicht unterstützt)\n" -" port: Port den das Relay nutzen soll\n" -" raw: öffnet Buffer mit RAW-Relay Daten\n" -" sslcertkey: setzt SSL Zertifikat/Schlüssel mittels Eintrag in Option " -"relay.network.ssl_cert_key\n" +"werden soll (optional. Falls kein Name angegeben wird, muss der Client einen " +"Namen mit dem Befehl \"PASS\" übermitteln, das Format ist wie folgt: \"PASS " +"Server:Passwort\")\n" +" - Protokoll \"weechat\" (es wird kein Name verwendet)\n" +"\n" +"Das \"irc\" Protokoll dient dazu eine Verbindung zu einem anderen IRC Client " +"(oder zu einem zweiten WeeChat) herzustellen.\n" +"Das \"weechat\" Protokoll wird von einem Remote-Interface genutzt um eine " +"Verbindung herzustellen. Siehe http://weechat.org/download/\n" "\n" "Ohne Angabe von Argumenten werden alle Relay-Clients in einem neuen Buffer " "dargestellt.\n" @@ -10344,7 +10456,7 @@ msgstr "" "unterschieden. Um zwischen Groß-und Kleinschreibung zu unterscheiden muss am " "Wortanfang \"(?-i)\" genutzt werden) . Sollte IPv6 aktiviert sein und es " "wird eine IPv4 Verbindung aufgebaut, werden die IPv6 Adressen nach IPv4 " -"gewandelt (siehe: \"::ffff:127.0.0.1\"), Beispiele: \"^((::ffff:)?" +"gewandelt (siehe: \"::ffff:127.0.0.1\"), Beispiele: \"^((::ffff:)?" "123.45.67.89|192.160.*)$\"" msgid "" @@ -10426,13 +10538,14 @@ msgstr "" "Verlaufsspeicher anzeigen, beginnend mit dem Client der zuletzt beendet wurde" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" -"Nachrichten-Tags welche im Verlaufsspeicher, für IRC Channels, angezeigt " -"werden (unterstützte Tags: \"irc_join\", \"irc_part\", \"irc_quit\", " -"\"irc_nick\", \"irc_privmsg\"), \"*\" = alle unterstützten Tags" +"durch Kommata getrennte Liste von Nachrichten-Tags welche im " +"Verlaufsspeicher von IRC Channels angezeigt werden (unterstützte Tags: " +"\"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg\"), \"*" +"\" = alle unterstützten Tags" msgid "" "format for time in backlog messages (see man strftime for format) (not used " @@ -10881,7 +10994,7 @@ msgstr "" "Tastenbefehle, weiter oben)\n" " q schließt den Buffer\n" " $ Buffer wird aktualisiert\n" -" s:x,y Buffer wird nach den Vorgaben x und y sortiert (siehe /help " +" s:x,y Buffer wird nach den Vorgaben x und y sortiert (siehe /help " "script.look.sort)\n" " s: die Sortierung des Buffers wird zurückgesetzt (Standardwerte " "werden genutzt)\n" @@ -11227,6 +11340,14 @@ msgid "List of default triggers:" msgstr "Liste der standardmäßigen Trigger:" #, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" +"%s%s: Aktion \"%s\" kann auf Trigger \"%s\" nicht angewendet werden, da " +"dieser zur Zeit ausgeführt wird" + +#, c-format msgid "Trigger \"%s\" restarted" msgstr "Trigger \"%s\" neu gestartet" @@ -11328,6 +11449,14 @@ msgstr "Trigger \"%s\" entfernt" msgid "Trigger:" msgstr "Trigger:" +#, c-format +msgid "Trigger \"%s\" restored" +msgstr "Trigger \"%s\" wiederhergestellt" + +#, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%s: Voreingestellten Trigger, \"%s\", nicht gefunden" + msgid "Default triggers restored:" msgstr "Standard-Trigger wiederhergestellt:" @@ -11348,16 +11477,16 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" "list|listfull|listdefault || add|addoff|addreplace <name> <hook> " "[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgid "" " list: list triggers (without argument, this list is displayed)\n" @@ -11409,7 +11538,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -11427,9 +11558,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -11496,6 +11627,8 @@ msgstr "" "einer kleinen Statistik)\n" " del: entfernt einen Trigger\n" " -all: führt eine Aktion aus, die alle Trigger beinhaltet\n" +" restore: stellt Trigger mit Standardwerten wieder her (funktioniert nur " +"bei vorgegebenen Triggern)\n" " default: stellt die standardmäßigen Trigger wieder her\n" " monitor: öffnet den Trigger Monitor-Buffer, mit optionaler " "Filterfunktion:\n" @@ -11519,9 +11652,9 @@ msgstr "" " fügt einer Nachricht die Textattribute *fett*, _unterstrichen_ und /" "kursiv/ hinzu:\n" " /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" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " verbirgt die Nicklist auf kleineren Terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -11536,6 +11669,9 @@ msgstr "" msgid "triggers" msgstr "trigger" +msgid "default triggers" +msgstr "voreingestellte Trigger" + msgid "options for triggers" msgstr "Optionen für Trigger" @@ -11608,8 +11744,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" "ersetzt Text mittels erweitertem regulären POSIX Ausdruck (dies passiert nur " "falls die Bedingungen erfüllt werden und bevor der Befehl ausgeführt wird) " @@ -11617,11 +11754,12 @@ msgstr "" "help eval); Format: \"/regex/replace/var\" (var ist eine Hashtable-Variable " "welche ersetzt wird, dies ist optional), mehrere reguläre Ausdrücke werden " "durch ein Leerzeichen voneinander getrennt, Beispiel: \"/regex1/replace1/" -"var1 /regex2/replace2/var2\"; Escapesequenzen werden umgewandelt (zum " +"var1 /regex2/replace2/var2\"; Escapesequenzen werden umgewandelt (zum " "Beispiel \"\\n\"); das Trennzeichen \"/\" kann durch jedes beliebe Zeichen " "ersetzt werden (eine oder mehrere identische Zeichen); matching groups kann " -"in \"replace\" genutzt werden: $0 bis $99, $+ für letzten Treffer und $.cN " -"ersetzt alle Zeichen der Gruppe N mit Zeichen c" +"in \"replace\" genutzt werden: ${re:0} to ${re:99}, ${re:+} für letzten " +"Treffer und ${hide:c,${re:N}} ersetzt alle Zeichen der Gruppe N mit Zeichen " +"'c'" msgid "" "command(s) to run if conditions are OK, after regex replacements (many " @@ -11781,6 +11919,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "%s: Datei %s (lokaler Dateiname: %s) wird an Position %llu fortgesetzt" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: Adresse von \"%s\" konnte nicht gefunden werden: Fehler %d %s" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s: fehlende Argumente (%s)" @@ -11797,15 +11943,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s: auf die Datei \"%s\" kann nicht zugegriffen werden" #, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "" -"%s%s: ungültige Adresse \"%s\" (Option xfer.network.own_ip): Fehler %d %s" - -#, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s: Adresse von \"%s\" konnte nicht gefunden werden: Fehler %d %s" - -#, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s: Socket kann für xfer nicht erstellt werden: Fehler %d %s" @@ -22,8 +22,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:46+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: es\n" @@ -1460,11 +1460,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1478,23 +1479,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -1524,7 +1526,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -3024,6 +3026,11 @@ msgstr "" "siempre considerado como prefijo de comando (ejemplo: \".$\")" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3233,6 +3240,12 @@ msgstr "" "cadena a usar para indicar que algunas líneas están filtradas en el buffer " "actual (elemento de barra \"buffer_filter\")" +#, fuzzy +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" +"cadena a usar para indicar que algunas líneas están filtradas en el buffer " +"actual (elemento de barra \"buffer_filter\")" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3543,14 +3556,20 @@ msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "" "color del prefijo del apodo (el prefijo es el texto mostrado antes del apodo)" -msgid "text color for offline nick (not in nicklist any more)" -msgstr "color para apodos desconectados (ya no están en la lista de apodos)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "text color for offline nick with highlight" -msgstr "color para apodos desconectados con realces" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "background color for offline nick with highlight" -msgstr "color de fondo para apodos desconectados con realces" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" msgid "text color for other nick in private buffer" msgstr "color para el otro apodo en una conversación privada" @@ -3696,6 +3715,10 @@ msgstr "color para un buffer con un mensaje privado (barra de estado)" msgid "text color for filter indicator in status bar" msgstr "color para el indicador de filtro en la barra de estado" +#, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "color para el indicador de filtro en la barra de estado" + msgid "text color for current buffer name in status bar" msgstr "color para el nombre del buffer actual en la barra de estado" @@ -3737,6 +3760,13 @@ msgstr "" "cursor, de otra forma la palabra base termina en el primer espacio después " "del cursor" +msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + #, fuzzy msgid "" "default completion template (please see documentation for template codes and " @@ -3982,6 +4012,10 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%sError con el comando \"%s\" (trata con /help %s)" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%sError: comando \"%s\" desconocido (use /help para ver la ayuda)" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" @@ -3989,13 +4023,14 @@ msgstr "" "%sError: el comando \"%s\" es ambiguo: existe en varios plugins y no en el " "plugin \"%s\"" -#, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%sError: demasiadas llamadas al comando \"%s\" (bucle)" +#, fuzzy, c-format +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "%sError con el comando \"%s\" (trata con /help %s)" -#, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%sError: comando \"%s\" desconocido (use /help para ver la ayuda)" +#, fuzzy, c-format +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%sError: demasiadas llamadas al comando \"%s\" (bucle)" msgid "" "Error: unable to create/append to log file (weechat.log)\n" @@ -5215,6 +5250,21 @@ msgstr "%s%s: ¡actualmente conectando al servidor \"%s\"!" msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s: servidor %s%s%s creado (temporalmente, ¡SIN GUARDAR!)" +#, fuzzy, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s: no es posible registrar el script \"%s\" (otro script ya existe con " +"ese nombre)" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + #, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%sconsulta CTCP a %s%s%s: %s%s%s%s%s" @@ -5609,10 +5659,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -6354,7 +6405,8 @@ msgstr "<apodo> <canal>[,<canal>...]" msgid "change mode on channel, without having operator status" msgstr "cambiar el modo del canal, sin tener el estado de operador" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<canal> <modo>" msgid "" @@ -6853,8 +6905,9 @@ msgstr "comando ejecutado cuando WeeChat inicia, antes de cargar los plugins" #, fuzzy msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" "lista separada por comas de capabilidades del cliente (\"client capabilities" "\") para habilitar en el servidor si están disponibles (ejemplo: \"multi-" @@ -7375,6 +7428,12 @@ msgstr "habilitar el filtro inteligente para mensajes \"nick\"" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "habilitar el filtro inteligente para mensajes \"part\" y \"quit\"" +#, fuzzy +msgid "enable creation of temporary servers with command /connect" +msgstr "" +"%s%s: no es posible registrar el script \"%s\" (otro script ya existe con " +"ese nombre)" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" "remover colores en el tema (usado solamente cuando se esté mostrando el " @@ -7821,8 +7880,8 @@ msgstr "%sUsted ha sido invitado a %s%s%s por %s%s%s" msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s: no es posible crear el nuevo canal \"%s\"" -#, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +#, fuzzy, c-format +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s%s%s%s%s%s%s%s%s se ha unido a %s%s%s" #, c-format @@ -7989,23 +8048,27 @@ msgid "%sChannel reop %s%s%s: %s%s" msgstr "%sCanal reop %s%s%s: %s%s" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s invitado por %s%s %s(%s%s%s)%s el %s" - -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" msgstr "%s%s[%s%s%s] %s%s%s invitado por %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s" +msgstr "%s%s[%s%s%s] %s%s%s invitado" + #, c-format msgid "%s%s[%s%s%s] %s%s%s invited" msgstr "%s%s[%s%s%s] %s%s%s invitado" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" msgstr "%s%s[%s%s%s]%s excepción %s%s%s por %s%s %s(%s%s%s)%s el %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s excepción %s%s" + #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" msgstr "%s%s[%s%s%s]%s excepción %s%s" @@ -8048,14 +8111,18 @@ msgstr[0] "apodo" msgstr[1] "apodos" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s vetado por %s%s %s(%s%s%s)%s el %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s vetado por %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" msgstr "%s%s[%s%s%s] %s%s%s vetado por %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s invitado" + #, c-format msgid "" "%s%s: all declared nicknames are already in use or invalid, closing " @@ -8085,14 +8152,18 @@ msgid "%s%s: nickname \"%s\" is unavailable, trying nickname \"%s\"" msgstr "%s%s: el apodo \"%s\" no está disponible, probando con el apodo \"%s\"" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s silenciado por %s%s %s(%s%s%s)%s el %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s silenciado por %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" msgstr "%s%s[%s%s%s] %s%s%s silenciado por %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted" +msgstr "%s%s[%s%s%s] %s%s%s invitado" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: comando \"%s\" no encontrado:" @@ -8935,9 +9006,6 @@ msgstr "lista de buffers" msgid "structure with completion" msgstr "estructura con auto-completador" -msgid "structure with partial completion" -msgstr "estructura con auto-completador parcial" - msgid "config file" msgstr "archivo de configuración" @@ -9357,6 +9425,10 @@ msgstr "Ningún cliente conectado para retransmitir" msgid "Listening on ports:" msgstr "Escuchando en los puertos:" +#, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " puerto %s%d%s, repetidor: %s%s%s, %s, iniciado en: %s" + #, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " puerto %s%d%s, repetidor: %s%s%s, %s, iniciado en: %s" @@ -9381,8 +9453,8 @@ msgstr "control de retransmisión" #, fuzzy msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" "list|listfull|listrelay || add <protocolo.nombre> <puerto> || del <protocolo." "nombre> || raw || sslcertkey" @@ -9392,8 +9464,18 @@ msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -9402,10 +9484,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -9598,9 +9681,9 @@ msgid "display backlog starting from last client disconnect" msgstr "" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -10257,6 +10340,12 @@ msgstr "Ningún modificador regular definido" msgid "List of default triggers:" msgstr "Lista de alias:" +#, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + #, fuzzy, c-format msgid "Trigger \"%s\" restarted" msgstr "Barra \"%s\" creada" @@ -10358,6 +10447,14 @@ msgstr "Modificador regular \"%s\" removido" msgid "Trigger:" msgstr "" +#, fuzzy, c-format +msgid "Trigger \"%s\" restored" +msgstr "Barra \"%s\" creada" + +#, fuzzy, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sTecla \"%s\" no encontrada" + #, fuzzy msgid "Default triggers restored:" msgstr "Modificadores regulares predeterminados restaurados:" @@ -10379,8 +10476,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -10433,7 +10530,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -10451,9 +10550,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -10470,6 +10569,10 @@ msgid "triggers" msgstr "" #, fuzzy +msgid "default triggers" +msgstr "Lista de alias:" + +#, fuzzy msgid "options for triggers" msgstr "opciones para proxies" @@ -10538,8 +10641,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -10708,6 +10812,14 @@ msgstr "" "posición %llu" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: set de caracteres inválido: \"%s\"" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s: argumentos faltantes (%s)" @@ -10724,14 +10836,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s: no es posible acceder el archivo \"%s\"" #, fuzzy, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "%s%s: set de caracteres inválido: \"%s\"" - -#, fuzzy, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s: set de caracteres inválido: \"%s\"" - -#, fuzzy, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s: no ha sido posible crear el socket para la transferencia" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-17 09:55+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -1474,11 +1474,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1492,23 +1493,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n : afficher le résultat sans envoyer au tampon (mode debug)\n" " -c : évaluer comme une condition : utiliser les opérateurs et les " @@ -1544,12 +1546,14 @@ msgstr "" "${variable}, la variable pouvant être, par ordre de priorité :\n" " 1. une chaîne avec les caractères échappés (format : \"esc:xxx\" ou \"\\xxx" "\")\n" -" 2. une couleur (format : \"color:xxx\")\n" -" 3. une info (format : \"info:nom,paramètres\", les paramètres sont " +" 2. une chaîne avec des caractères à cacher (format : \"hide:caractère," +"chaîne\")\n" +" 3. une couleur (format : \"color:xxx\")\n" +" 4. une info (format : \"info:nom,paramètres\", les paramètres sont " "optionnels)\n" -" 4. une option (format : \"fichier.section.option\")\n" -" 5. une variable locale du tampon\n" -" 6. un hdata/variable (la valeur est automatiquement convertie en chaîne), " +" 5. une option (format : \"fichier.section.option\")\n" +" 6. une variable locale du tampon\n" +" 7. un hdata/variable (la valeur est automatiquement convertie en chaîne), " "par défaut \"window\" et \"buffer\" pointent vers la fenêtre et le tampon " "courants.\n" "Le format du hdata peut être le suivant :\n" @@ -1566,23 +1570,24 @@ msgstr "" "fonction \"weechat_hdata_get\".\n" "\n" "Exemples (chaînes simples) :\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Exemples (conditions) :\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgid "" "filter messages in buffers, to hide/show them according to tags or regex" @@ -1609,7 +1614,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -1673,7 +1678,7 @@ msgstr "" " tampon : liste des tampons, séparés par des virgules, où le filtre est " "actif :\n" " - il s'agit du nom complet incluant l'extension (exemple : " -"\"irc.freenode.#weechat\")\n" +"\"irc.freenode.#weechat\" ou \"irc.server.freenode\")\n" " - \"*\" signifie tous les tampons\n" " - un nom commençant par '!' est exclu\n" " - le caractère joker \"*\" est autorisé\n" @@ -2569,7 +2574,7 @@ msgstr "" " afficher la valeur de la variable d'environnement LANG :\n" " /set env LANG\n" " modifier la variable d'environnement LANG et l'utiliser :\n" -" /set env LANG=fr_FR.UTF-8\n" +" /set env LANG fr_FR.UTF-8\n" " /upgrade\n" " réinitialiser la variable d'environnement ABC :\n" " /set env ABC \"\"" @@ -3269,6 +3274,13 @@ msgstr "" "\")" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" +"si activé, les commandes incomplètes et non ambiguës sont autorisées, par " +"exemple /he pour /help" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3504,6 +3516,11 @@ msgstr "" "chaîne utilisée pour montrer le zoom sur un tampon mélangé (objet de barre " "\"buffer_zoom\")" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" +"chaîne utilisée pour montrer si la souris est activée (objet de barre " +"\"mouse_status\")" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3836,16 +3853,28 @@ msgstr "" "couleur pour le préfixe du pseudo (chaîne affichée avant le pseudo dans le " "préfixe)" -msgid "text color for offline nick (not in nicklist any more)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" msgstr "" "couleur du texte pour un pseudo déconnecté (qui n'est plus dans la liste de " -"pseudos)" +"pseudos) ; cette couleur est utilisée seulement si l'option weechat.look." +"color_nick_offline est activée" -msgid "text color for offline nick with highlight" -msgstr "couleur du texte pour un pseudo déconnecté avec highlight" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" +"couleur du texte pour un pseudo déconnecté avec highlight ; cette couleur " +"est utilisée seulement si l'option weechat.look.color_nick_offline est " +"activée" -msgid "background color for offline nick with highlight" -msgstr "couleur du fond pour un pseudo déconnecté avec highlight" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" +"couleur du fond pour un pseudo déconnecté avec highlight ; cette couleur est " +"utilisée seulement si l'option weechat.look.color_nick_offline est activée" msgid "text color for other nick in private buffer" msgstr "couleur du texte pour l'autre pseudo dans le tampon privée" @@ -4007,6 +4036,10 @@ msgstr "" msgid "text color for filter indicator in status bar" msgstr "couleur du texte pour l'indicateur de filtrage dans la barre de statut" +msgid "text color for mouse indicator in status bar" +msgstr "" +"couleur du texte pour l'indicateur de la souris dans la barre de statut" + msgid "text color for current buffer name in status bar" msgstr "couleur du texte pour le nom du tampon courant dans la barre de statut" @@ -4050,6 +4083,18 @@ msgstr "" "curseur ; sinon le mot de base s'arrête au premier espace après le curseur" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" +"si activé, les commandes à l'intérieur de la ligne de commande sont " +"complétées (la commande en début de ligne a une priorité plus élevée et est " +"utilisée en premier) ; note : lorsque cette option est activée, il n'y a " +"plus de complétion automatique des chemins commençant par '/' (en dehors des " +"paramètres de commandes)" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -4309,6 +4354,10 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%sErreur avec la commande \"%s\" (aide sur la commande : /help %s)" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%sErreur : commande \"%s\" inconnue (tapez /help pour l'aide)" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" @@ -4317,12 +4366,15 @@ msgstr "" "et pas dans l'extension \"%s\"" #, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%sErreur : trop d'appels à la commande \"%s\" (boucle)" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "" +"%sErreur : commande \"%s\" incomplète et plusieurs commandes commencent par " +"ce nom" #, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%sErreur : commande \"%s\" inconnue (tapez /help pour l'aide)" +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%sErreur : trop d'appels à la commande \"%s\" (boucle)" msgid "" "Error: unable to create/append to log file (weechat.log)\n" @@ -5711,6 +5763,24 @@ msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s : serveur %s%s%s créé (serveur temporaire, NON SAUVÉ !)" #, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s : impossible de créer le serveur temporaire \"%s\" car la création de " +"serveurs temporaires avec la commande /connect est actuellement désactivée" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" +"%s%s : si vous voulez ajouter un serveur standard, utilisez la commande \"/" +"server add\" (voir /help server); si vous voulez vraiment créer un serveur " +"temporaire (NON SAUVÉ), activez l'option irc.look.temporary_servers" + +#, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%sDemande CTCP vers %s%s%s : %s%s%s%s%s" @@ -6111,10 +6181,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -6139,10 +6210,11 @@ msgstr "" " serveur : nom du serveur, qui peut être :\n" " - nom interne de serveur (créé par /server add, usage " "recommandé)\n" -" - nom/port ou IP/port (ceci créera un serveur TEMPORAIRE), le " -"port par défaut est 6667\n" +" - nom/port ou IP/port, le port par défaut est 6667\n" " - URL avec le format : irc[6][s]://[pseudo[:mot_passe]@]irc." "example.org[:port][/#canal1][,#canal2[...]]\n" +" Note : pour une adresse/IP/URL, un serveur temporaire est créé " +"(NON SAUVÉ), voir /help irc.look.temporary_servers\n" " option : définir l'option pour le serveur (pour une option booléenne, la " "valeur peut être omise)\n" "nooption : définir l'option booléenne à 'off' (par exemple : -nossl)\n" @@ -6849,8 +6921,8 @@ msgstr "<pseudo> <canal>[,<canal>...]" msgid "change mode on channel, without having operator status" msgstr "changer le mode du canal, sans avoir le statut d'opérateur" -msgid "<channel> <mode>" -msgstr "<canal> <mode>" +msgid "[<channel>] <mode>" +msgstr "[<canal>] <mode>" msgid "" "channel: channel name\n" @@ -7362,13 +7434,14 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" "liste séparée par des virgules de capacités client (\"client capabilities\") " "à activer sur le serveur si elles sont disponibles ; les capacités " -"supportées par WeeChat sont : away-notify, multi-prefix, server-time, " -"userhost-in-names (exemple : \"away-notify,multi-prefix\")" +"supportées par WeeChat sont : away-notify, extended-join, multi-prefix, " +"server-time, userhost-in-names (exemple : \"away-notify,multi-prefix\")" msgid "" "mechanism for SASL authentication: \"plain\" for plain text password, \"dh-" @@ -7950,6 +8023,9 @@ msgstr "" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "activer le filtre intelligent pour les messages \"part\" et \"quit\"" +msgid "enable creation of temporary servers with command /connect" +msgstr "activer la création des serveurs temporaires avec la commande /connect" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" "supprimer les couleurs dans le titre (utilisé seulement lors de l'affichage " @@ -8406,8 +8482,8 @@ msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s : impossible de créer le nouveau canal \"%s\"" #, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" -msgstr "%s%s%s%s%s%s%s%s%s%s a rejoint %s%s%s" +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +msgstr "%s%s%s%s%s%s%s%s%s%s%s%s a rejoint %s%s%s" #, c-format msgid "%s%s%s%s has kicked %s%s%s %s(%s%s%s)" @@ -8573,12 +8649,12 @@ msgstr "%sReop canal %s%s%s : %s%s" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s invité par %s%s %s(%s%s%s)%s le %s" +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s invité par %s le %s" #, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" -msgstr "%s%s[%s%s%s] %s%s%s invité par %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s invited by %s" +msgstr "%s%s[%s%s%s] %s%s%s invité par %s" #, c-format msgid "%s%s[%s%s%s] %s%s%s invited" @@ -8586,8 +8662,12 @@ msgstr "%s%s[%s%s%s] %s%s%s invité" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s]%s exception %s%s%s par %s%s %s(%s%s%s)%s le %s" +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" +msgstr "%s%s[%s%s%s]%s exception %s%s%s par %s le %s" + +#, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s exception %s%s%s par %s" #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" @@ -8631,12 +8711,16 @@ msgstr[1] "pseudos" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s banni par %s%s %s(%s%s%s)%s le %s" +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s banni par %s le %s" + +#, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" +msgstr "%s%s[%s%s%s] %s%s%s banni par %s" #, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" -msgstr "%s%s[%s%s%s] %s%s%s banni par %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s banni" #, c-format msgid "" @@ -8671,12 +8755,16 @@ msgstr "" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s rendu silencieux par %s%s %s(%s%s%s)%s le %s" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s rendu silencieux par %s le %s" + +#, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" +msgstr "%s%s[%s%s%s] %s%s%s rendu silencieux par %s" #, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" -msgstr "%s%s[%s%s%s] %s%s%s rendu silencieux par %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s quieted" +msgstr "%s%s[%s%s%s] %s%s%s rendu silencieux" #, c-format msgid "%s%s: command \"%s\" not found:" @@ -9501,9 +9589,6 @@ msgstr "tampon visité" msgid "structure with completion" msgstr "structure avec une complétion" -msgid "structure with partial completion" -msgstr "structure avec une complétion partielle" - msgid "config file" msgstr "fichier de configuration" @@ -9935,6 +10020,10 @@ msgid "Listening on ports:" msgstr "Écoute sur les ports :" #, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " port %s%d%s, relai : %s%s%s, %s (non démarré)" + +#, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " port %s%d%s, relai : %s%s%s, %s, démarré le : %s" @@ -9957,18 +10046,28 @@ msgid "relay control" msgstr "contrôle du relai" msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocole.nom> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocole.nom> || raw || sslcertkey" +"list|listfull|listrelay || add <nom> <port> || del|stop|restart <nom> || raw " +"|| sslcertkey" msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -9977,10 +10076,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -10002,11 +10102,21 @@ msgid "" " weechat protocol with SSL, using IPv4 + IPv6:\n" " /relay add ipv4.ipv6.ssl.weechat 9001" msgstr "" -" list : lister les clients pour le relai\n" -" listfull : lister les clients pour le relai (verbeux)\n" -" listrelay : lister les relais (nom et port)\n" -" add : ajouter un relai pour un protocole + nom\n" -" del : supprimer un relai pour un protocole + nom\n" +" list : lister les clients pour le relai\n" +" listfull : lister les clients pour le relai (verbeux)\n" +" listrelay : lister les relais (nom et port)\n" +" add : ajouter un relai (écouter sur un port)\n" +" del : supprimer un relai (les clients restent connectés)\n" +" stop : fermer le socket serveur (les clients restent connectés)\n" +" restart : fermer le socket serveur et écouter à nouveau sur le port (les " +"clients restent connectés)\n" +" nom : nom du relai (voir le format ci-dessous)\n" +" port : port utilisé pour le relai\n" +" raw : ouvrir le tampon avec les données brutes Relay\n" +"sslcertkey : définir le certificat/clé SSL en utilisant le chemin de " +"l'option relay.network.ssl_cert_key\n" +"\n" +"Le nom du relai est : [ipv4.][ipv6.][ssl.]<protocole.nom>\n" " ipv4 : forcer l'utilisation d'IPv4\n" " ipv6 : forcer l'utilisation d'IPv6\n" " ssl : activer SSL\n" @@ -10015,10 +10125,11 @@ msgstr "" "(optionnel, si non donné, le nom de serveur doit être envoyé par le client " "dans la commande \"PASS\", avec le format : \"PASS serveur:motdepasse\")\n" " - protocole \"weechat\" (le nom n'est pas utilisé)\n" -" port : port utilisé pour le relai\n" -" raw : ouvrir le tampon avec les données brutes Relay\n" -" sslcertkey : définir le certificat/clé SSL en utilisant le chemin de " -"l'option relay.network.ssl_cert_key\n" +"\n" +"Le protocole \"irc\" permet à n'importe quel client IRC (incluant WeeChat " +"lui-même) de se connecter sur le port.\n" +"Le protocole \"weechat\" permet à une interface distante de se connecter sur " +"le port, voir la liste ici : http://weechat.org/download/\n" "\n" "Sans paramètre, cette commande ouvre le tampon avec la liste des clients " "pour le relai.\n" @@ -10193,13 +10304,14 @@ msgid "display backlog starting from last client disconnect" msgstr "afficher l'historique en démarrant à la dernière déconnexion du client" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" -"étiquettes des messages qui sont affichés dans l'historique par canal IRC " -"(étiquettes supportées : \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" -"\", \"irc_privmsg\"), \"*\" = toutes les étiquettes supportées" +"liste d'étiquettes de messages (séparées par des virgules) qui sont affichés " +"dans l'historique par canal IRC (étiquettes supportées : \"irc_join\", " +"\"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg\"), \"*\" = toutes " +"les étiquettes supportées" msgid "" "format for time in backlog messages (see man strftime for format) (not used " @@ -10978,6 +11090,14 @@ msgid "List of default triggers:" msgstr "Liste des triggers par défaut :" #, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" +"%s%s : l'action \"%s\" ne peut pas être exécutée sur le trigger \"%s\" car " +"il est actuellement en cours d'exécution" + +#, c-format msgid "Trigger \"%s\" restarted" msgstr "Trigger \"%s\" redémarré" @@ -11079,6 +11199,14 @@ msgstr "Trigger \"%s\" supprimé" msgid "Trigger:" msgstr "Trigger :" +#, c-format +msgid "Trigger \"%s\" restored" +msgstr "Trigger \"%s\" restauré" + +#, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sTrigger par défaut \"%s\" non trouvé" + msgid "Default triggers restored:" msgstr "Triggers par défaut restaurés :" @@ -11099,16 +11227,16 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" "list|listfull|listdefault || add|addoff|addreplace <nom> <hook> " "[\"<paramètres>\" [\"<conditions>\" [\"<regex>\" [\"<commande>" "\" [\"<code_retour>\"]]]]] || addinput [<hook>] || input|output|recreate " "<nom> || set <nom> <option> <valeur> || rename|copy <nom> <nouveau_nom> || " "enable|disable|toggle [<nom>|-all [<nom>...]] || restart <nom>|-all " -"[<nom>...] || show <nom> || del <nom>|-all [<nom>...] || default -yes || " -"monitor [<filtre>]" +"[<nom>...] || show <nom> || del <nom>|-all [<nom>...] || restore <nom> " +"[<nom>...] || default -yes || monitor [<filtre>]" msgid "" " list: list triggers (without argument, this list is displayed)\n" @@ -11160,7 +11288,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -11178,9 +11308,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -11248,6 +11378,8 @@ msgstr "" "quelques statistiques)\n" " del : supprimer un trigger\n" " -all : effectuer l'action sur tous les triggers\n" +" restore : restaurer un/des trigger(s) avec les valeurs par défaut " +"(fonctionne seulement pour les triggers par défaut)\n" " default : restaurer les triggers par défaut\n" " monitor : ouvrir le tampon moniteur des triggers\n" " filtre : filtrer les hooks/triggers à afficher (un hook doit commencer " @@ -11268,9 +11400,9 @@ msgstr "" " ajouter des attributs *gras*, _souligné_ et /italique/ (seulement dans les " "messages d'utilisateurs) :\n" " /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" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " cacher la barre de pseudos sur les petits terminaux :\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -11285,6 +11417,9 @@ msgstr "" msgid "triggers" msgstr "triggers" +msgid "default triggers" +msgstr "triggers par défaut" + msgid "options for triggers" msgstr "options pour les triggers" @@ -11353,8 +11488,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" "remplacer du texte avec une expression régulière POSIX étendue (cela est " "fait seulement si les conditions sont OK, et avant d'exécuter la commande) " @@ -11366,8 +11502,9 @@ msgstr "" "interprétés dans l'expression régulière (par exemple \"\\n\") ; le " "séparateur \"/\" peut être remplacé par n'importe quel caractère (un ou " "plusieurs identiques) ; les groupes de correspondance peuvent être utilisés " -"dans le remplacement : $0 à $99, $+ pour le dernier groupe et $.cN pour " -"remplacer tous les caractères du groupe N par c" +"dans le remplacement : ${re:0} à ${re:99}, ${re:+} pour le dernier groupe et " +"${hide:c,${re:N}} pour remplacer tous les caractères du groupe N par le " +"caractère 'c'" msgid "" "command(s) to run if conditions are OK, after regex replacements (many " @@ -11532,6 +11669,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "%s : fichier %s (nom local : %s) sera recommencé en position %llu" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "%s%s: l'adresse \"%s\" a été résolue en un sockaddr plus grand que prévu" + +#, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s : adresse \"%s\" invalide : erreur %d %s" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s : paramètres manquants (%s)" @@ -11548,15 +11693,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s : impossible d'accéder au fichier \"%s\"" #, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "" -"%s%s : adresse \"%s\" invalide (option xfer.network.own_ip) : erreur %d %s" - -#, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s : impossible de trouver l'adresse pour \"%s\" : erreur %d %s" - -#, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s : impossible de créer le socket pour le xfer : erreur %d %s" @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:46+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: hu\n" @@ -1353,11 +1353,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1371,23 +1372,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -1411,7 +1413,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -2519,6 +2521,11 @@ msgid "" msgstr "" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -2682,6 +2689,9 @@ msgstr "" msgid "string used to show zoom on merged buffer (bar item \"buffer_zoom\")" msgstr "" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -2946,17 +2956,20 @@ msgstr "idő színe a beszédablakban" msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "" -#, fuzzy -msgid "text color for offline nick (not in nicklist any more)" -msgstr "távollevő felhasználók nevének színe" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" +msgstr "" -#, fuzzy -msgid "text color for offline nick with highlight" -msgstr "távollevő felhasználók nevének színe" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -#, fuzzy -msgid "background color for offline nick with highlight" -msgstr "címsor háttere" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" #, fuzzy msgid "text color for other nick in private buffer" @@ -3119,6 +3132,10 @@ msgid "text color for filter indicator in status bar" msgstr "aktuális szoba színe a státuszsorban" #, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "aktuális szoba színe a státuszsorban" + +#, fuzzy msgid "text color for current buffer name in status bar" msgstr "aktuális szoba színe a státuszsorban" @@ -3162,6 +3179,13 @@ msgid "" msgstr "" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -3395,18 +3419,23 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%s a \"%s\" aliasz vagy parancs nem található\n" #, fuzzy, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%s a \"%s\" aliasz vagy parancs nem található\n" + +#, fuzzy, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" msgstr "%s az ignore már létezik\n" #, fuzzy, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%s helytelen érték a \"%s\" paraméternek\n" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "%s a \"%s\" aliasz vagy parancs nem található\n" #, fuzzy, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%s a \"%s\" aliasz vagy parancs nem található\n" +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%s helytelen érték a \"%s\" paraméternek\n" #, fuzzy msgid "" @@ -4571,6 +4600,19 @@ msgstr "%s éppen kapcsolódik a(z) \"%s\" szerverhez!\n" msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "A %s%s%s szerver létrehozva\n" +#, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + #, fuzzy, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%s Szerver: %s%s %s[%s%s%s]\n" @@ -4926,10 +4968,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -5590,7 +5633,7 @@ msgid "change mode on channel, without having operator status" msgstr "" #, fuzzy -msgid "<channel> <mode>" +msgid "[<channel>] <mode>" msgstr "%d szoba" #, fuzzy @@ -6115,8 +6158,9 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" msgid "" @@ -6553,6 +6597,9 @@ msgstr "új üzenetet tartalmazó ablak színe" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "" +msgid "enable creation of temporary servers with command /connect" +msgstr "" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" @@ -6992,7 +7039,7 @@ msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s nem sikerült új szobát nyitni \"%s\"\n" #, fuzzy, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s %s(%s%s%s)%s belépett a(z) %s%s szobába\n" #, fuzzy, c-format @@ -7156,11 +7203,11 @@ msgstr "%s szoba: %s> %s" #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s invited by %s" msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " #, fuzzy, c-format @@ -7169,7 +7216,11 @@ msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" +msgstr "%s[%s%s%s] %s%s%s kitiltva\n" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" msgstr "%s[%s%s%s] %s%s%s kitiltva\n" #, fuzzy, c-format @@ -7218,11 +7269,15 @@ msgstr[1] "név" #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s banned by %s" +msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " #, fuzzy, c-format @@ -7253,11 +7308,15 @@ msgstr "%s: a(z) \"%s\" név már foglalt, próbálom a második nevet: \"%s\"\n #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s quieted" msgstr "%s[%s%s%s] %s%s%s-t kitiltotta " #, fuzzy, c-format @@ -8045,10 +8104,6 @@ msgid "structure with completion" msgstr "szöveg beillesztése a parancssorba" #, fuzzy -msgid "structure with partial completion" -msgstr "szöveg beillesztése a parancssorba" - -#, fuzzy msgid "config file" msgstr "szerver konfigurációs fájljának újraolvastatása" @@ -8474,6 +8529,10 @@ msgid "Listening on ports:" msgstr "Aliaszok listája:\n" #, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr "%s%s%s távol: %s\n" + +#, fuzzy, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr "%s%s%s távol: %s\n" @@ -8497,16 +8556,26 @@ msgid "relay control" msgstr "" msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -8515,10 +8584,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -8676,9 +8746,9 @@ msgid "display backlog starting from last client disconnect" msgstr "" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -9357,6 +9427,12 @@ msgstr "Nincs aliasz definiálva.\n" msgid "List of default triggers:" msgstr "Aliaszok listája:\n" +#, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + #, fuzzy, c-format msgid "Trigger \"%s\" restarted" msgstr "A \"%s\" => \"%s\" aliasz elkészült\n" @@ -9458,6 +9534,14 @@ msgstr "A \"%s\" aliasz eltávolítva\n" msgid "Trigger:" msgstr "" +#, fuzzy, c-format +msgid "Trigger \"%s\" restored" +msgstr "A \"%s\" => \"%s\" aliasz elkészült\n" + +#, fuzzy, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%s a \"%s\" szerver nem található\n" + #, fuzzy msgid "Default triggers restored:" msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" @@ -9479,8 +9563,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -9533,7 +9617,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -9551,9 +9637,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -9570,6 +9656,10 @@ msgid "triggers" msgstr "" #, fuzzy +msgid "default triggers" +msgstr "Aliaszok listája:\n" + +#, fuzzy msgid "options for triggers" msgstr "Aliaszok listája:\n" @@ -9638,8 +9728,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -9810,6 +9901,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "" "DCC: a %s%s%s fájl (helyi fájlnév: %s%s%s) a(z) %u pozíción fog visszatérni\n" +#, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + #, fuzzy, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n" @@ -9827,14 +9926,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s nem sikerült a(z) \"%s\" fájlt elérni\n" #, fuzzy, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" - -#, fuzzy, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" - -#, fuzzy, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s nem sikerült a csatornát létrehozni\n" @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:46+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: it\n" @@ -1440,11 +1440,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1458,23 +1459,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: mostra il risultato senza inviarlo al buffer (modalità debug)\n" "espressione: espressione da analizzare, le variabili con il formato " @@ -1562,7 +1564,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -3117,6 +3119,11 @@ msgstr "" "sempre considerata come prefisso per comando (esempio: \".$\")" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3323,6 +3330,12 @@ msgstr "" "stringa usata per mostrare che alcune righe sono state filtrate nel buffer " "corrente (elemento barra \"buffer_filter\")" +#, fuzzy +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" +"stringa usata per mostrare che alcune righe sono state filtrate nel buffer " +"corrente (elemento barra \"buffer_filter\")" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3650,14 +3663,20 @@ msgstr "" "colore per il prefisso del nick (stringa visualizzata prima del nick nel " "prefisso)" -msgid "text color for offline nick (not in nicklist any more)" -msgstr "colore del testo per i nick non in linea (non più in lista nick)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "text color for offline nick with highlight" -msgstr "colore del testo per i nick non in linea con highlight" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "background color for offline nick with highlight" -msgstr "colore di sfondo per i nick non in linea con highlight" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" msgid "text color for other nick in private buffer" msgstr "colore del testo per gli altri nick nel buffer privato" @@ -3804,6 +3823,10 @@ msgstr "" msgid "text color for filter indicator in status bar" msgstr "colore del testo per l'indicatore di filtro nella barra di stato" +#, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "colore del testo per l'indicatore di filtro nella barra di stato" + msgid "text color for current buffer name in status bar" msgstr "colore del testo per il nome del buffer corrente nella barra di stato" @@ -3846,6 +3869,13 @@ msgstr "" "cursore; altrimenti la parola base termina al primo spazio dopo il cursore" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -4093,6 +4123,10 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%sErrore con il comando \"%s\" (digita /help %s)" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%sErrore: comando \"%s\" sconosciuto (digita /help per l'aiuto)" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" @@ -4100,13 +4134,14 @@ msgstr "" "%sErrore: comando ambiguo \"%s\": esiste in più plugin e non nel plugin \"%s" "\"" -#, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%sErrore: troppe chiamate al comando \"%s\" (loop)" +#, fuzzy, c-format +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "%sErrore con il comando \"%s\" (digita /help %s)" -#, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%sErrore: comando \"%s\" sconosciuto (digita /help per l'aiuto)" +#, fuzzy, c-format +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%sErrore: troppe chiamate al comando \"%s\" (loop)" msgid "" "Error: unable to create/append to log file (weechat.log)\n" @@ -5354,6 +5389,21 @@ msgstr "%s%s: la connessione al server \"%s\" è già in corso!" msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s: server %s%s%s creato (server temporaneo, NON SALVATO!)" +#, fuzzy, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s: impossibile registrare lo script \"%s\" (esiste un altro script con lo " +"stesso nome)" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + #, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%sRichiesta CTCP a %s%s%s: %s%s%s%s%s" @@ -5748,10 +5798,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -6493,7 +6544,8 @@ msgstr "<nick> <canale>[,<canale>...]" msgid "change mode on channel, without having operator status" msgstr "cambia modalità sul canale, senza avere lo status di operatore" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<canale> <modalità>" msgid "" @@ -6997,8 +7049,9 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" msgid "" @@ -7530,6 +7583,12 @@ msgstr "" "abilita filtro smart per i messaggi \"part\" (uscita) e \"quit " "(disconnessione)" +#, fuzzy +msgid "enable creation of temporary servers with command /connect" +msgstr "" +"%s%s: impossibile registrare lo script \"%s\" (esiste un altro script con lo " +"stesso nome)" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" "elimina colori nell'argomento (usato solo quando mostrato il titolo del " @@ -7978,8 +8037,8 @@ msgstr "%sSei stato invitato su %s%s%s da %s%s%s" msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s: impossibile creare il nuovo canale \"%s\"" -#, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +#, fuzzy, c-format +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s%s%s%s%s%s%s%s%s è entrato in %s%s%s" #, c-format @@ -8146,23 +8205,27 @@ msgid "%sChannel reop %s%s%s: %s%s" msgstr "%sReop sul canale %s%s%s: %s%s" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s invitato da %s%s %s(%s%s%s)%s il %s" - -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" msgstr "%s%s[%s%s%s] %s%s%s invitato da %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s" +msgstr "%s%s[%s%s%s] %s%s%s invitato" + #, c-format msgid "%s%s[%s%s%s] %s%s%s invited" msgstr "%s%s[%s%s%s] %s%s%s invitato" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" msgstr "%s%s[%s%s%s]%s eccezione %s%s%s da %s%s %s(%s%s%s)%s il %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s eccezione %s%s" + #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" msgstr "%s%s[%s%s%s]%s eccezione %s%s" @@ -8204,14 +8267,18 @@ msgstr[0] "nick" msgstr[1] "nick" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s bannato da %s%s %s(%s%s%s)%s il %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s bannato da %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" msgstr "%s%s[%s%s%s] %s%s%s bannato da %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s invitato" + #, c-format msgid "" "%s%s: all declared nicknames are already in use or invalid, closing " @@ -8241,14 +8308,18 @@ msgid "%s%s: nickname \"%s\" is unavailable, trying nickname \"%s\"" msgstr "%s%s: il nick \"%s\" non è disponibile, tentativo con il nick \"%s\"" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s messo a tacere da %s%s %s(%s%s%s)%s il %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s messo a tacere da %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" msgstr "%s%s[%s%s%s] %s%s%s messo a tacere da %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted" +msgstr "%s%s[%s%s%s] %s%s%s invitato" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: comando \"%s\" non trovato:" @@ -9085,9 +9156,6 @@ msgstr "elenco dei buffer" msgid "structure with completion" msgstr "struttura con completamento" -msgid "structure with partial completion" -msgstr "struttura con completamento parziale" - msgid "config file" msgstr "file di configurazione" @@ -9514,6 +9582,10 @@ msgstr "Nessun client connesso per il relay" msgid "Listening on ports:" msgstr "In ascolto sulle porte:" +#, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " porta %s%d%s, relay: %s%s%s, %s, avviato il: %s" + #, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " porta %s%d%s, relay: %s%s%s, %s, avviato il: %s" @@ -9536,19 +9608,31 @@ msgstr "%s%s: relay \"%s\" non trovato" msgid "relay control" msgstr "controllo relay" +#, fuzzy msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" "list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocollo.nome> <porta> " "|| del [ipv4.][ipv6.][ssl.]<protocollo.nome> || raw || sslcertkey" +#, fuzzy msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -9557,10 +9641,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -9763,9 +9848,9 @@ msgid "display backlog starting from last client disconnect" msgstr "mostra la cronologia a partire dall'ultima disconnessione del client" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -10435,6 +10520,12 @@ msgstr "Nessun rmodifier definito" msgid "List of default triggers:" msgstr "Elenco degli alias:" +#, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + #, fuzzy, c-format msgid "Trigger \"%s\" restarted" msgstr "Barra \"%s\" creata" @@ -10536,6 +10627,14 @@ msgstr "Rmodifier \"%s\" eliminato" msgid "Trigger:" msgstr "" +#, fuzzy, c-format +msgid "Trigger \"%s\" restored" +msgstr "Barra \"%s\" creata" + +#, fuzzy, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sTasto \"%s\" non trovato" + #, fuzzy msgid "Default triggers restored:" msgstr "Rmodifier predefiniti ripristinati:" @@ -10557,8 +10656,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -10611,7 +10710,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -10629,9 +10730,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -10648,6 +10749,10 @@ msgid "triggers" msgstr "" #, fuzzy +msgid "default triggers" +msgstr "Elenco degli alias:" + +#, fuzzy msgid "options for triggers" msgstr "opzioni per i proxy" @@ -10716,8 +10821,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -10884,6 +10990,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "%s: file %s (nome file locale: %s) verrà ripreso dalla posizione %llu" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: set di caratter invalido: \"%s\"" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s: argomenti mancanti (%s)" @@ -10899,14 +11013,6 @@ msgstr "%s%s: protocollo xfer \"%s\" sconosciuto" msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s: impossibile accedere al file \"%s\"" -#, fuzzy, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "%s%s: set di caratter invalido: \"%s\"" - -#, fuzzy, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s: set di caratter invalido: \"%s\"" - #, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s: impossibile creare il socker per xfer: errore %d %s" @@ -20,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 23:57+0900\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n" "Language: ja\n" @@ -1266,7 +1266,7 @@ msgstr "" " alias: ある色に別名を追加\n" " unalias: 別名の削除\n" " color: カラー番号 (0 以上、最大値はターミナル依存、多くの場合 63 か 255)\n" -" name: カラーの別名 (例えば: \"orange\")\n" +" name: カラーの別名 (例: \"orange\")\n" " reset: 全てのカラーペアをリセット (自動的なリセットが無効化されており、こ" "れ以上のカラーペアが利用できない場合に必要、オプション weechat.look." "color_pairs_auto_reset を参照)\n" @@ -1439,11 +1439,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1457,23 +1458,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: 結果をバッファに送信せずに表示 (デバッグモード)\n" " -c: 条件として評価: 演算子と括弧をを使い、ブール値 (\"0\" または " @@ -1498,7 +1500,7 @@ msgstr "" "式が NULL でない場合、空でない場合、\"0\" でない場合、式は \"真\" と評価され" "ます。\n" "両方の式が有効な整数である場合、比較は整数を使って行われます。\n" -"文字列比較を強制するには、それぞれの式をダブルクォートで囲みます、例えば:\n" +"文字列比較を強制するには、それぞれの式をダブルクォートで囲みます、例:\n" " 50 > 100 ==> 0\n" " \"50\" > \"100\" ==> 1\n" "\n" @@ -1506,11 +1508,12 @@ msgstr "" "に従います:\n" " 1. エスケープ文字を含む文字列 (フォーマット: \"esc:xxx\" または \"\\xxx" "\")\n" -" 2. 色 (フォーマット: \"color:xxx\")\n" -" 3. 情報 (フォーマット: \"info:name,arguments\"、arguments は任意)\n" -" 4. オプション (フォーマット: \"file.section.option\")\n" -" 5. バッファのローカル変数\n" -" 6. hdata の名前/変数 (値は自動的に文字列に変換されます)、デフォルトでは " +" 2. 隠す文字を含む文字列 (フォーマット: \"hide:char,string\")\n" +" 3. 色 (フォーマット: \"color:xxx\")\n" +" 4. 情報 (フォーマット: \"info:name,arguments\"、arguments は任意)\n" +" 5. オプション (フォーマット: \"file.section.option\")\n" +" 6. バッファのローカル変数\n" +" 7. hdata の名前/変数 (値は自動的に文字列に変換されます)、デフォルトでは " "\"window\" と \"buffer\" は現在のウィンドウ/バッファを指します。\n" "hdata のフォーマットは以下の 1 つです:\n" " hdata.var1.var2...: hdata (ポインタは既知) で始まり、1 個ずつ変数を続ける " @@ -1524,23 +1527,24 @@ msgstr "" "\"weechat_hdata_get\" 関数を参照してください。\n" "\n" "例 (単純な文字列):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "例 (条件):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgid "" "filter messages in buffers, to hide/show them according to tags or regex" @@ -1565,7 +1569,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -1627,13 +1631,13 @@ msgstr "" " del: フィルタを削除\n" " -all: 全てのフィルタを削除\n" " buffer: フィルタが有効化されているバッファのコンマ区切りリスト:\n" -" - これはプラグイン名を含む完全な名前です (例えば: \"irc.freenode." -"#weechat\")\n" +" - これはプラグイン名を含む完全な名前です (例: \"irc.freenode." +"#weechat\" または \"irc.server.freenode\")\n" " - \"*\" は全てのバッファを意味します\n" " - 名前が '!' から始まるものは除外されます\n" " - ワイルドカード '*' を使うことができます\n" " tags: タグのコンマ区切りリスト、例えば \"irc_join,irc_part,irc_quit\"\n" -" - 論理積 \"and\": タグ同士を \"+\" でつなげてください (例えば: " +" - 論理積 \"and\": タグ同士を \"+\" でつなげてください (例: " "\"nick_toto+irc_action\")\n" " - ワイルドカード '*' を使うことができます\n" " - タグを '!' で始めると、そのタグが付けられたメッセージとそのタグを" @@ -2797,7 +2801,7 @@ msgstr "" "を秒単位で任意指定)\n" "\n" "splith と splitv に関しては、pct は新しいウィンドウのパーセンテージで、現在の" -"ウィンドウサイズに対する割合で計算されます。例えば、25 は size = " +"ウィンドウサイズに対する割合で計算されます。例えば 25 は size = " "current_size / 4 の新しいウィンドウを作成します。\n" "\n" "例:\n" @@ -3175,6 +3179,13 @@ msgstr "" "て扱われる (例: \".$\")" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" +"セットされた場合、不完全なコマンドと完全なコマンドを両方使えるようになりま" +"す、例えば /he は /help の意味で使うことができます" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3392,6 +3403,12 @@ msgstr "" "マージされたバッファでズームされたことを示す文字列 (バーアイテム " "\"buffer_zoom\")" +#, fuzzy +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" +"マージされたバッファでズームされたことを示す文字列 (バーアイテム " +"\"buffer_zoom\")" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3700,15 +3717,20 @@ msgstr "" "ニックネームプレフィックスの色 (プレフィックス中のニックネームの前に表示され" "る文字列)" -msgid "text color for offline nick (not in nicklist any more)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" msgstr "" -"オフラインのニックネームのテキスト色 (ニックネームリストにも表示されない)" -msgid "text color for offline nick with highlight" -msgstr "ハイライトされたオフラインのニックネームのテキスト色" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "background color for offline nick with highlight" -msgstr "ハイライトされたオフラインのニックネームの背景色" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" msgid "text color for other nick in private buffer" msgstr "プライベートバッファ内の他のニックネームのテキスト色" @@ -3852,6 +3874,10 @@ msgstr "" msgid "text color for filter indicator in status bar" msgstr "ステータスバーのフィルタ表示のテキスト色" +#, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "ステータスバーのフィルタ表示のテキスト色" + msgid "text color for current buffer name in status bar" msgstr "ステータスバーの現在のバッファ名のテキスト色" @@ -3891,6 +3917,13 @@ msgstr "" "語はカーソル後の最初の文字で終了" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -4134,6 +4167,10 @@ msgstr "" "%sコマンド \"%s\" にエラーがあります (コマンドに関するヘルプ: /help %s)" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%sエラー: 未定義のコマンド \"%s\" (ヘルプを見るには /help)" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" @@ -4142,13 +4179,15 @@ msgstr "" "\" プラグインでは定義されていません" #, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" msgstr "" -"%sエラー: コマンド \"%s\" の呼び出し回数が多すぎます (ループしています)" +"%sエラー: コマンド \"%s\" が不完全でこの名前で始まる別のコマンドが存在します" #, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%sエラー: 未定義のコマンド \"%s\" (ヘルプを見るには /help)" +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "" +"%sエラー: コマンド \"%s\" の呼び出し回数が多すぎます (ループしています)" msgid "" "Error: unable to create/append to log file (weechat.log)\n" @@ -4506,7 +4545,7 @@ msgid "" msgstr "" "バーを表示する条件 (\"window\" タイプのバー): 単純な条件: \"active" "\"、\"inactive\"、\"nicklist\" (ウィンドウはアクティブ/非アクティブ、バッファ" -"にはニックネームリストが含まれる)、条件式 (/help eval を参照)、例えば: " +"にはニックネームリストが含まれる)、条件式 (/help eval を参照)、例: " "\"${nicklist} && ${window.win_width} > 100\" (式のローカル変数は " "${active}、${inactive}、${nicklist})" @@ -4867,7 +4906,7 @@ msgstr "" "aspell.check.commands を参照)。\n" "\n" "全てのバッファで aspell を有効化するには、\"default_dict\" オプションを設定し" -"た後に、aspell を有効化してください。例えば:\n" +"た後に、aspell を有効化してください。例:\n" " /set aspell.check.default_dict \"en\"\n" " /aspell enable\n" "\n" @@ -5469,6 +5508,24 @@ msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s: サーバ %s%s%s が作成されました (一時的な作成で、保存されません!)" #, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s: 現在 /connect コマンドによる一時的なサーバの作成が無効化されているため" +"一時的なサーバ \"%s\" を作成できません" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" +"%s%s: 標準的なサーバを作成したい場合は、\"/server add\" コマンドを使ってくだ" +"さい (/help server を参照); 本当に一時的なサーバ (保存されない) を作成したい" +"場合は、irc.look.temporary_servers オプションを on にしてください" + +#, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%s%s%s%s への CTCP クエリ: %s%s%s%s%s" @@ -5853,10 +5910,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -5880,10 +5938,12 @@ msgid "" msgstr "" " server: サーバ名、これは:\n" " - 内部サーバ名 (/server add で作成されたもの、利用推奨)\n" -" - ホスト名/ポート番号、又は IP アドレス/ポート番号 (これは一時的" -"サーバを作る)、デフォルトのポート番号は 6667\n" +" - ホスト名/ポート番号又は IP アドレス/ポート番号、デフォルトの" +"ポート番号は 6667\n" " - 次のフォーマットに従う URL: irc[6][s]://[nickname[:" "password]@]irc.example.org[:port][/#channel1][,#channel2[...]]\n" +" 注意: アドレス/IP/URL を指定した場合、サーバを一時的に作ります " +"(保存しません)、/help irc.look.temporary_servers を参照してください。\n" " option: サーバに関するオプション (ブール型オプションでは、value は無視さ" "れる)\n" " nooption: ブール型オプションを 'off' にする (例: -nossl)\n" @@ -6575,7 +6635,8 @@ msgstr "<nick> <channel>[,<channel>...]" msgid "change mode on channel, without having operator status" msgstr "チャンネルモードを変更、オペレータ権無しに" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<channel> <mode>" msgid "" @@ -6670,7 +6731,7 @@ msgstr "" "6667)、複数のアドレスはコンマで区切る\n" " temp: 一時的なサーバを作成 (保存されない)\n" " option: サーバのオプションを設定 (ブールオプションでは値が無視される)\n" -"nooption: ブールオプションを 'off' に設定 (例えば: -nossl)\n" +"nooption: ブールオプションを 'off' に設定 (例: -nossl)\n" " copy: サーバを複製\n" " rename: サーバをリネーム\n" " keep: 設定ファイルにサーバを保存 (一時的なサーバ用)\n" @@ -7078,12 +7139,13 @@ msgstr "" #, fuzzy msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" "サーバで利用可能ならば有効化する \"client capabilities\" のコンマ区切りリス" -"ト; WeeChat で利用できる機能: multi-prefix、userhost-in-names、away-notify " -"(例: \"multi-prefix,userhost-in-names,away-notify\")" +"ト; WeeChat で利用できる機能: away-notify、multi-prefix、server-time、" +"userhost-in-names (例: \"away-notify,multi-prefix\")" msgid "" "mechanism for SASL authentication: \"plain\" for plain text password, \"dh-" @@ -7531,7 +7593,7 @@ msgid "" "comma separated list of tags used in a welcome notices redirected to a " "channel, for example: \"notify_private\"" msgstr "" -"ようこそ通知に使われ、チャンネルに転送するタグのコンマ区切りリスト、例えば: " +"ようこそ通知に使われ、チャンネルに転送するタグのコンマ区切りリスト、例: " "\"notify_private\"" msgid "" @@ -7549,7 +7611,7 @@ msgid "" "\"notify_message\", \"notify_private\" or \"notify_highlight\"" msgstr "" "ニックネームの離席状態に変化があった場合の (whois コマンドの結果)、notify に" -"よって表示されたメッセージに使われたタグのコンマ区切りリスト、例えば: " +"よって表示されたメッセージに使われたタグのコンマ区切りリスト、例: " "\"notify_message\"、\"notify_private\"、\"notify_highlight\"" msgid "close buffer when /part is issued on a channel" @@ -7562,7 +7624,7 @@ msgid "" "comma separated list of tags used in private messages, for example: " "\"notify_message\", \"notify_private\" or \"notify_highlight\"" msgstr "" -"プライベートメッセージに使われたタグのコンマ区切りリスト、例えば: " +"プライベートメッセージに使われたタグのコンマ区切りリスト、例: " "\"notify_message\"、\"notify_private\"、\"notify_highlight\"" msgid "" @@ -7631,6 +7693,9 @@ msgstr "" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "\"part\" と \"quit\" メッセージのスマートフィルタを有効化" +msgid "enable creation of temporary servers with command /connect" +msgstr "/connect コマンドによるサーバの一時的な作成を有効化する" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" "トピックにつけられた色を無効化 (バッファタイルに表示される場合のみ利用)" @@ -8070,8 +8135,8 @@ msgstr "%1$s%5$s%6$s%7$s から %2$s%3$s%4$s に招待されました" msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s: 新しいチャンネル \"%s\" を作れません" -#, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +#, fuzzy, c-format +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s%s%s%s%s%s%s%s%s が %s%s%s に参加" #, c-format @@ -8238,24 +8303,28 @@ msgid "%sChannel reop %s%s%s: %s%s" msgstr "%sチャンネルは %s%s%s を reop しました: %s%s" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s)%s によって %s に招待されました" - -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" msgstr "%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s) によって招待されました" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s" +msgstr "%s%s[%s%s%s] %s%s%s が招待されました" + #, c-format msgid "%s%s[%s%s%s] %s%s%s invited" msgstr "%s%s[%s%s%s] %s%s%s が招待されました" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" msgstr "" "%s%s[%s%s%s]%s %s%s%s の除外は %s%s %s(%s%s%s)%s によって %s に設定されました" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s %s%s の除外" + #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" msgstr "%s%s[%s%s%s]%s %s%s の除外" @@ -8293,14 +8362,18 @@ msgid_plural "nicks" msgstr[0] "ニックネーム" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s)%s によって %s に参加禁止" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s) によって参加禁止" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" msgstr "%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s) によって参加禁止" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s が招待されました" + #, c-format msgid "" "%s%s: all declared nicknames are already in use or invalid, closing " @@ -8335,15 +8408,18 @@ msgstr "" "ます" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "" -"%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s)%s によって %s で発言禁止にされました" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s) によって発言禁止にされました" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" msgstr "%s%s[%s%s%s] %s%s%s は %s%s %s(%s%s%s) によって発言禁止にされました" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted" +msgstr "%s%s[%s%s%s] %s%s%s が招待されました" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: コマンド \"%s\" が見つかりません:" @@ -9141,9 +9217,6 @@ msgstr "訪問済みバッファ" msgid "structure with completion" msgstr "補完する構造" -msgid "structure with partial completion" -msgstr "部分補完する構造" - msgid "config file" msgstr "設定ファイル" @@ -9562,6 +9635,10 @@ msgstr "リレーするクライアントはありません" msgid "Listening on ports:" msgstr "リッスンポート:" +#, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " ポート %s%d%s、リレー: %s%s%s, %s、開始日時: %s" + #, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " ポート %s%d%s、リレー: %s%s%s, %s、開始日時: %s" @@ -9584,19 +9661,31 @@ msgstr "%s%s: リレー \"%s\" が見つかりません" msgid "relay control" msgstr "リレー管理" +#, fuzzy msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" "list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " "del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +#, fuzzy msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -9605,10 +9694,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -9811,13 +9901,13 @@ msgid "display backlog starting from last client disconnect" msgstr "最後にクライアントを切断した以降のバックログを表示" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" -"IRC チャンネルごとのバックログに表示するメッセージのタグ (利用可能なタグ: " -"\"irc_join\"、\"irc_part\"、\"irc_quit\"、\"irc_nick\"、\"irc_privmsg\")、\"*" -"\" = 利用可能な全てのタグ" +"IRC チャンネルごとのバックログに表示するメッセージタグのコンマ区切りリスト " +"(利用可能なタグ: \"irc_join\"、\"irc_part\"、\"irc_quit\"、\"irc_nick" +"\"、\"irc_privmsg\")、\"*\" = 利用可能な全てのタグ" msgid "" "format for time in backlog messages (see man strftime for format) (not used " @@ -10572,8 +10662,16 @@ msgid "List of default triggers:" msgstr "デフォルトトリガのリスト:" #, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" +"%1$s%2$s: トリガ \"%4$s\" に対するアクション \"%3$s\" は現在実行中であるため" +"実行できません" + +#, c-format msgid "Trigger \"%s\" restarted" -msgstr "トリガ \"%s\" が再開されました" +msgstr "トリガ \"%s\" を再開しました" #, c-format msgid "%s%s: a disabled trigger can not be restarted" @@ -10673,6 +10771,14 @@ msgstr "トリガ \"%s\" を削除" msgid "Trigger:" msgstr "トリガ:" +#, c-format +msgid "Trigger \"%s\" restored" +msgstr "トリガ \"%s\" を復元しました" + +#, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sデフォルトトリガ \"%s\" が見つかりません" + msgid "Default triggers restored:" msgstr "復元されたデフォルトトリガ:" @@ -10693,17 +10799,18 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" "list|listfull|listdefault || add|addoff|addreplace <name> <hook> " "[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" +#, fuzzy msgid "" " list: list triggers (without argument, this list is displayed)\n" " listfull: list triggers with detailed info for each trigger\n" @@ -10754,7 +10861,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -10772,9 +10881,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -10831,7 +10940,9 @@ msgstr "" " show: トリガに関する情報を表示 (状態を含めて)\n" " del: トリガを削除\n" " -all: 全てのトリガに関するアクションを実行\n" -" default: デフォルトトリガを復元\n" +" restore: デフォルトの値でトリガを復元 (これができるのはデフォルトトリガに" +"限ります)\n" +" default: 全てのトリガを削除してデフォルトのトリガを復元\n" " monitor: 任意でフィルタを付けてトリガ監視バッファを開く:\n" " filter: フックおよびトリガをフィルタして表示 (フックは必ず \"@\" で始め" "てください、たとえば \"@signal\")、複数のフィルタをかける場合はそれぞれをコン" @@ -10863,6 +10974,9 @@ msgstr "" msgid "triggers" msgstr "トリガ" +msgid "default triggers" +msgstr "デフォルトトリガ" + msgid "options for triggers" msgstr "トリガに対するオプション" @@ -10924,6 +11038,7 @@ msgstr "" "コマンドを実行する条件 (フックコールバック内で確認されます) (注意: 内容はトリ" "ガの実行時に評価されます、/help eval を参照)" +#, fuzzy msgid "" "replace text with a POSIX extended regular expression (it is done only if " "conditions are OK, and before running the command) (note: content is " @@ -10932,8 +11047,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" "POSIX 拡張正規表現で置換するテキスト (条件が満足され、コマンドが実行される前" "に置換されます) (注意: 内容はトリガの実行時に評価されます、/help eval を参" @@ -11100,6 +11216,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "%s: ファイル %s (ローカルファイル名: %s) を位置 %llu から再開します" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: \"%s\" のアドレスが見つかりません: エラー %d %s" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s: 引数がありません (%s)" @@ -11116,15 +11240,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s: ファイル \"%s\" にアクセスできません" #, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "" -"%s%s: 不正なアドレス \"%s\" (オプション xfer.network.own_ip): エラー %d %s" - -#, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s: \"%s\" のアドレスが見つかりません: エラー %d %s" - -#, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s: xfer 用のソケット作成に失敗: エラー %d %s" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:46+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: pl\n" @@ -1442,6 +1442,7 @@ msgstr "przetwórz wyrażenie" msgid "[-n] <expression> || [-n] -c <expression1> <operator> <expression2>" msgstr "[-n] <wyrażenie> || [-n] -c <wyrażenie1> <operator> <wyrażenie2>" +#, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" " -c: evaluate as condition: use operators and parentheses, return a " @@ -1474,11 +1475,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1492,23 +1494,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: wyświetla wynik bez wysyłania go do buforu (tryb debugowania)\n" " -c: przetwarza jako warunek: użyj operatorów i nawiasów, zwraca " @@ -1603,7 +1606,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -1658,7 +1661,8 @@ msgstr "" " enable: włącza filtry (filtry są domyślnie włączone)\n" "disable: wyłącza filtry\n" " toggle: przełącza filtry\n" -" nazwa: nazwa filtru\n" +" nazwa: nazwa filtru (\"@\" = włącza/wyłącza wszystkie filtry w obecnym " +"buforze)\n" " add: dodaje filtr\n" " rename: zmienia nazwę filtru\n" " del: usuwa filtr\n" @@ -3237,6 +3241,13 @@ msgstr "" "jest zawsze uważany za prefiks komendy (np: \".$\")" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" +"jeśli ustawione, niekompletne i jednoznaczne komendy są dozwolone, na " +"przykład /he dla /help" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3468,6 +3479,12 @@ msgstr "" "ciąg użyty do pokazania przybliżenia w połączonym buforze (element paska " "\"buffer_zoom\")" +#, fuzzy +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" +"ciąg użyty do pokazania przybliżenia w połączonym buforze (element paska " +"\"buffer_zoom\")" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3789,14 +3806,20 @@ msgstr "" "kolor przedrostka nicka (przedrostek to ciąg wyświetlany przed nickiem w " "prafiksie)" -msgid "text color for offline nick (not in nicklist any more)" -msgstr "kolor dla nieobecnych nicków (nie znajdujących się na liście nicków)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "text color for offline nick with highlight" -msgstr "kolor dla nieobecnych nicków z podświetleniem" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "background color for offline nick with highlight" -msgstr "kolor tła dla nieobecnych nicków z podświetleniem" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" msgid "text color for other nick in private buffer" msgstr "kolor innego nicka w prywatnym buforze" @@ -3943,6 +3966,10 @@ msgstr "kolor bufora z prywatną wiadomością (pasek statusu)" msgid "text color for filter indicator in status bar" msgstr "kolor wskaźnika filtru w pasku statusu" +#, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "kolor wskaźnika filtru w pasku statusu" + msgid "text color for current buffer name in status bar" msgstr "kolor nazwy obecnego bufora w pasku statusu" @@ -3983,6 +4010,13 @@ msgstr "" "kursorze" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -4231,6 +4265,10 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%sBłąd komendy \"%s\" (pomoc dla komendy: /help %s)" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%sBłąd: nieznana komenda \"%s\" (wpisz /help , aby uzyskać pomoc)" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" @@ -4239,12 +4277,14 @@ msgstr "" "wtyczce \"%s\"" #, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%sBłąd: za dużo wywołań komendy \"%s\" (zapętlam)" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "" +"%sBłąd: niekompletna komenda \"%s\", wiele komend zaczyna się od tej nazwy" #, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%sBłąd: nieznana komenda \"%s\" (wpisz /help , aby uzyskać pomoc)" +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%sBłąd: za dużo wywołań komendy \"%s\" (zapętlam)" msgid "" "Error: unable to create/append to log file (weechat.log)\n" @@ -4417,9 +4457,9 @@ msgid "debug: removing file: %s" msgstr "debug: usuwam plik: %s" #. TRANSLATORS: %.02fs is a float number + "s" ("seconds") -#, fuzzy, c-format +#, c-format msgid "Upgrade done (%.02fs)" -msgstr "Uaktualnienie zakończyło się powodzeniem (%.02f %s)" +msgstr "Aktualizacja ukończona (%.02fs)" #, c-format msgid "%sError upgrading WeeChat with file \"%s\":" @@ -5590,6 +5630,25 @@ msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "%s: utworzono serwer %s%s%s (tymczasowy serwer, NIE ZAPISANO!)" #, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s: nie można utworzyć tymczasowego serwera \"%s\" ponieważ możliwość " +"tworzenia tymczasowych serwerów za pomocą komendy /connect jest obecnie " +"wyłączona" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" +"%s%s: jeśli chcesz utworzyć standardowy serwer, użyj komendy \"/server add" +"\" (zobacz /help server); jeśli naprawdę chcesz utworzyć serwer tymczasowy " +"(NIE ZAPISANY), włącz opcję irc.look.temporary_servers" + +#, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%sZapytanie CTCP do %s%s%s: %s%s%s%s%s" @@ -5982,10 +6041,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -6014,6 +6074,8 @@ msgstr "" "domyślny port to 6667\n" " - URL o formacie: irc[6][s]://[nick[:hasło]@]irc.example.org[:" "port][/#kanał1][,#kanał2[...]]\n" +" Uwaga: dla adresu/IP/URLa, tworzony jest serwer tymczasowy (NIE " +"ZAPISYWANY), zobacz /help irc.look.temporary_servers\n" " opcja: ustawia opcję dla serwera (dla opcji boolowskich można pominąć " "wartość)\n" " nooption: ustawia opcje boolowskie na 'off' (na przykład: -nossl)\n" @@ -6712,7 +6774,8 @@ msgstr "<nick> <kanał>[,<kanał>...]" msgid "change mode on channel, without having operator status" msgstr "zmienia atrybuty kanału, bez posiadania statusu operatora" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<kanał> <atrybuty>" msgid "" @@ -7218,12 +7281,13 @@ msgstr "hasło dla serwera ( zawartość jest przetwarzana, zobacz /help eval)" #, fuzzy msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" "oddzielona przecinkami lista opcji klienta do włączenia dla serwera, jeśli " -"są dostępne; opcje wspierane przez WeeChat: multi-prefix, userhost-in-names, " -"away-notify (przykład: \"multi-prefix,userhost-in-names,away-notify\")" +"są dostępne; opcje wspierane przez WeeChat: away-notify, multi-prefix, " +"server-time, userhost-in-names (przykład: \"away-notify,multi-prefix\")" msgid "" "mechanism for SASL authentication: \"plain\" for plain text password, \"dh-" @@ -7791,6 +7855,9 @@ msgstr "włącza mądre filtrowanie dla wiadomości \"nick\" (zmiana nicka)" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "włącza inteligentne filtrowanie dla wiadomości \"part\" oraz \"quit\"" +msgid "enable creation of temporary servers with command /connect" +msgstr "włącza tworzenie tymczasowych serwerów za pomocą komendy /connect" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "usuń kolory w tematach (używane przy wyświetlaniu tytułu bufora)" @@ -7980,9 +8047,9 @@ msgid " (blocked)" msgstr " (zablokowane)" #. TRANSLATORS: %.3fs is a float number + "s" ("seconds") -#, fuzzy, c-format +#, c-format msgid "%sCTCP reply from %s%s%s: %s%s%s %.3fs" -msgstr "%sOdpowiedź CTCP od %s%s%s: %s%s%s%s%s" +msgstr "%sOdpowiedź CTCP od %s%s%s: %s%s%s %.3fs" #, c-format msgid "%sCTCP reply from %s%s%s: %s%s%s%s%s" @@ -8241,8 +8308,8 @@ msgstr "%sZostałeś zaproszony na %s%s%s przez %s%s%s" msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s: nie można utworzyć nowego kanału \"%s\"" -#, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +#, fuzzy, c-format +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s%s%s%s%s%s%s%s%s wszedł na %s%s%s" #, c-format @@ -8409,23 +8476,27 @@ msgid "%sChannel reop %s%s%s: %s%s" msgstr "%sReop kanału %s%s%s: %s%s" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s zaproszony przez %s%s %s(%s%s%s)%s na %s" - -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" msgstr "%s%s[%s%s%s] %s%s%s zaproszony przez %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s" +msgstr "%s%s[%s%s%s] %s%s%s zaproszony" + #, c-format msgid "%s%s[%s%s%s] %s%s%s invited" msgstr "%s%s[%s%s%s] %s%s%s zaproszony" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" msgstr "%s%s[%s%s%s]%s wyjątek %s%s%s ustawiony przez %s%s %s(%s%s%s)%s na %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s wyjątek %s%s" + #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" msgstr "%s%s[%s%s%s]%s wyjątek %s%s" @@ -8471,14 +8542,18 @@ msgstr[1] "nick" msgstr[2] "nick" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s zbanowany przez %s%s %s(%s%s%s)%s na %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s zbanowany przez %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" msgstr "%s%s[%s%s%s] %s%s%s zbanowany przez %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s zaproszony" + #, c-format msgid "" "%s%s: all declared nicknames are already in use or invalid, closing " @@ -8508,14 +8583,18 @@ msgid "%s%s: nickname \"%s\" is unavailable, trying nickname \"%s\"" msgstr "%s%s: nick \"%s\" jest niedostępny, próbuje nicku \"%s\"" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s uciszony przez %s%s %s(%s%s%s)%s na %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s uciszony przez %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" msgstr "%s%s[%s%s%s] %s%s%s uciszony przez %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted" +msgstr "%s%s[%s%s%s] %s%s%s zaproszony" + #, c-format msgid "%s%s: command \"%s\" not found:" msgstr "%s%s: nie znaleziono komendy \"%s\":" @@ -9318,9 +9397,6 @@ msgstr "odwiedzony bufor" msgid "structure with completion" msgstr "struktura z uzupełnianiem" -msgid "structure with partial completion" -msgstr "struktura z częściowym uzupełnianiem" - msgid "config file" msgstr "plik konfiguracyjne" @@ -9744,6 +9820,10 @@ msgstr "Brak klientów do przekazywania" msgid "Listening on ports:" msgstr "Nasłuchuję na portach:" +#, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " port %s%d%s, relay:%s%s%s, %s, rozpoczęto: %s" + #, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " port %s%d%s, relay:%s%s%s, %s, rozpoczęto: %s" @@ -9766,19 +9846,31 @@ msgstr "%s%s: relay \"%s\" nie został znaleziony" msgid "relay control" msgstr "zarządzanie przesyłaniem" +#, fuzzy msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" "list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protokół.nazwa> <port> " "|| del [ipv4.][ipv6.][ssl.]<protokół.nazwa> || raw || kluczSSL" +#, fuzzy msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -9787,10 +9879,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -10001,10 +10094,11 @@ msgstr "" msgid "display backlog starting from last client disconnect" msgstr "wyświetlaj backlog zaczynając od ostatniego rozłączenia klienta" +#, fuzzy msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" "tagi dla wiadomości, które są wyświetlane w backlogu dla kanałów IRC " "(wspierane tagi: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", " @@ -10765,6 +10859,12 @@ msgid "List of default triggers:" msgstr "Lista domyślnych triggerów:" #, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + +#, c-format msgid "Trigger \"%s\" restarted" msgstr "Trigger \"%s\" został zrestartowany" @@ -10866,6 +10966,14 @@ msgstr "Trigger \"%s\" został usunięty" msgid "Trigger:" msgstr "Trigger:" +#, c-format +msgid "Trigger \"%s\" restored" +msgstr "Trigger \"%s\" został przywrócony" + +#, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sDomyślny trigger \"%s\" nie został znaleziony" + msgid "Default triggers restored:" msgstr "Przywrócono domyślne triggery:" @@ -10886,17 +10994,18 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" "list|listfull|listdefault || add|addoff|addreplace <nazwa> <uchwyt> " "[\"<argumenty>\" [\"<warunki>\" [\"<regex>\" [\"<komenda>\" [\"<kod powrotu>" "\"]]]]] || addinput [<uchwyt>] || input|output|recreate <nazwa> || set " "<nazwa> <opcja> <wartość> || rename|copy <nazwa> <nowa nazwa> || enable|" "disable|toggle [<nazwa>|-all [<nazwa>...]] || restart <nazwa>|-all " -"[<nazwa>...] || show <nazwa> || del <nazwa>|-all [<nazwa>...] || default -" -"yes || monitor [<filtr>]" +"[<nazwa>...] || show <nazwa> || del <nazwa>|-all [<nazwa>...] || restore " +"<nazwa> [<nazwa>...] || default -yes || monitor [<filtr>]" +#, fuzzy msgid "" " list: list triggers (without argument, this list is displayed)\n" " listfull: list triggers with detailed info for each trigger\n" @@ -10947,7 +11056,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -10965,9 +11076,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -11005,7 +11116,7 @@ msgstr "" " regex: jedno lub więcej wyrażeń regularnych do zastępowania ciągów w " "zmiennych\n" " komenda: komenda do wykonania (wiele komend można oddzielić \";\"\n" -"zwracany kod: kod zwracany w callbacku (ok (domyślne), ok_eat, error)\n" +"zwracany_kod: kod zwracany w callbacku (ok (domyślne), ok_eat, error)\n" " addinput: ustawia wejście z domyślnymi argumentami do stworzenia " "triggera\n" " input: ustawia wejście z komendą użytą do stworzenia triggera\n" @@ -11029,6 +11140,8 @@ msgstr "" "statystykami)\n" " del: usuwa trigger\n" " -all: wykonaj akcję na wszystkich triggerach\n" +" restore: przywraca trigger(y) z domyślnymi wartościami (działa tylko dla " +"domyślnych triggerów)\n" " default: przywraca domyślne triggery\n" " monitor: otwiera bufor monitorowania triggerów, z opcjonalnym filtrem:\n" " filtr: filtruje uchwyty/triggery do wyświetlenia (uchwyt musi się " @@ -11066,6 +11179,9 @@ msgstr "" msgid "triggers" msgstr "triggery" +msgid "default triggers" +msgstr "domyślne triggery" + msgid "options for triggers" msgstr "opcje dla triggerów" @@ -11128,6 +11244,7 @@ msgstr "" "(uwaga: zawartość jest przetwarzana, podczas wykonania triggera, zobacz /" "help eval)" +#, fuzzy msgid "" "replace text with a POSIX extended regular expression (it is done only if " "conditions are OK, and before running the command) (note: content is " @@ -11136,8 +11253,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" "zastępuje tekst za pomocą rozszerzonego wyrażenia regularnego POSIX " "(następuje to tylko wtedy, jeśli warunki są spełnione i przed wykonaniem " @@ -11308,6 +11426,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "%s: plik %s (lokalna nazwa: %s) zostanie wznowiony od pozycji%llu" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: niemożna znaleźć adresu dla \"%s\": błąd %d %s" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s: brakujące argumenty (%s)" @@ -11324,15 +11450,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s: nie można uzyskać dostępu do pliku \"%s\"" #, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "" -"%s%s: niepoprawny adres \"%s\" (opcja xfer.network.own_ip): błąd %d %s" - -#, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s: niemożna znaleźć adresu dla \"%s\": błąd %d %s" - -#, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s: nie można utworzyć gniazda dla xfer: błąd %d %s" diff --git a/po/pt_BR.po b/po/pt_BR.po index 2d4f2d3f5..0ac780fc8 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:46+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: pt_BR\n" @@ -1477,11 +1477,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1495,23 +1496,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -1541,7 +1543,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -2953,6 +2955,11 @@ msgstr "" "é sempre considerada como prefixo de comando (exemplo: \".$\")" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -3154,6 +3161,9 @@ msgstr "" msgid "string used to show zoom on merged buffer (bar item \"buffer_zoom\")" msgstr "" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -3444,15 +3454,20 @@ msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "" "cor para o prefixo do apelido (string exibida antes de um apelido no prefixo)" -msgid "text color for offline nick (not in nicklist any more)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" msgstr "" -"cor de texto para apelidos desconectados (não mais na lista de apelidos)" -msgid "text color for offline nick with highlight" -msgstr "cor de texto para apelidos desconectados com destaque" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -msgid "background color for offline nick with highlight" -msgstr "cor de fundo para apelido desconectado com destaque" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" msgid "text color for other nick in private buffer" msgstr "cor de texto para outros apelidos em buffers privados" @@ -3595,6 +3610,10 @@ msgstr "cor de texto para buffer com mensagens privadas (barra de status)" msgid "text color for filter indicator in status bar" msgstr "cor de texto para indicador de filtro na barra de status" +#, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "cor de texto para indicador de filtro na barra de status" + msgid "text color for current buffer name in status bar" msgstr "cor de texto para o nome do buffer atual na barra de status" @@ -3634,6 +3653,13 @@ msgid "" "the base word ends at first space after cursor" msgstr "" +msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + #, fuzzy msgid "" "default completion template (please see documentation for template codes and " @@ -3879,6 +3905,10 @@ msgstr "" msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "" +#, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "" + #, fuzzy, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" @@ -3886,11 +3916,12 @@ msgid "" msgstr "%sErro: outro comando \"%s\" já existe para o plugin \"%s\"" #, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" msgstr "" #, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" +msgid "%sError: too many calls to command \"%s\" (looping)" msgstr "" msgid "" @@ -5049,6 +5080,21 @@ msgstr "" msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "" +#, fuzzy, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" +"%s%s: não foi possível registrar script \"%s\" (outro script já existe com " +"este nome)" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + #, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "" @@ -5381,10 +5427,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -5929,7 +5976,8 @@ msgstr "<apelido> <canal>[,<canal>...]" msgid "change mode on channel, without having operator status" msgstr "alterar modo de canal, sem ter status de operador" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<canal> <modo>" msgid "" @@ -6358,8 +6406,9 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" msgid "" @@ -6814,6 +6863,12 @@ msgstr "" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "" +#, fuzzy +msgid "enable creation of temporary servers with command /connect" +msgstr "" +"%s%s: não foi possível registrar script \"%s\" (outro script já existe com " +"este nome)" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" @@ -7240,8 +7295,8 @@ msgstr "%sVocê foi convidado para %s%s%s por %s%s%s" msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s%s: não foi possível criar novo canal \"%s\"" -#, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +#, fuzzy, c-format +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s%s%s%s%s%s%s%s%s entrou %s%s%s" #, c-format @@ -7403,12 +7458,12 @@ msgid "%sChannel reop %s%s%s: %s%s" msgstr "" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)%s em %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s" msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)" #, fuzzy, c-format @@ -7416,10 +7471,14 @@ msgid "%s%s[%s%s%s] %s%s%s invited" msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" msgstr "%s%s[%s%s%s]%s exceção %s%s%s por %s%s %s(%s%s%s)%s em %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s exceção %s%s" + #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" msgstr "%s%s[%s%s%s]%s exceção %s%s" @@ -7461,14 +7520,18 @@ msgstr[0] "apelido" msgstr[1] "apelidos" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s banido por %s%s %s(%s%s%s)%s em %s" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s banido por %s%s %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" msgstr "%s%s[%s%s%s] %s%s%s banido por %s%s %s(%s%s%s)" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)" + #, c-format msgid "" "%s%s: all declared nicknames are already in use or invalid, closing " @@ -7499,11 +7562,15 @@ msgstr "%s%s: apelido \"%s\" está indisponível, tentando apelido #%d (\"%s\")" #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)%s em %s" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" +msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)" #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s quieted" msgstr "%s%s[%s%s%s] %s%s%s convidado por %s%s %s(%s%s%s)" #, c-format @@ -8316,9 +8383,6 @@ msgstr "lista de buffers" msgid "structure with completion" msgstr "estrutura com completação" -msgid "structure with partial completion" -msgstr "estrutura com completação parcial" - msgid "config file" msgstr "arquivo de configuração" @@ -8738,6 +8802,10 @@ msgid "Listening on ports:" msgstr "Escutando nas portas:" #, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr " porta %s%d%s, relay: %s%s.%s%s, iniciado em: %s" + +#, fuzzy, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr " porta %s%d%s, relay: %s%s.%s%s, iniciado em: %s" @@ -8760,16 +8828,26 @@ msgid "relay control" msgstr "" msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -8778,10 +8856,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -8944,9 +9023,9 @@ msgid "display backlog starting from last client disconnect" msgstr "" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -9627,6 +9706,12 @@ msgstr "Nenhuma rmodifier definido" msgid "List of default triggers:" msgstr "Lista de atalhos:" +#, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + #, fuzzy, c-format msgid "Trigger \"%s\" restarted" msgstr "Barra \"%s\" criada" @@ -9728,6 +9813,14 @@ msgstr "Rmodifier \"%s\" removido" msgid "Trigger:" msgstr "" +#, fuzzy, c-format +msgid "Trigger \"%s\" restored" +msgstr "Barra \"%s\" criada" + +#, fuzzy, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sTecla \"%s\" não encontrada" + #, fuzzy msgid "Default triggers restored:" msgstr "Rmodifiers padrões restaurados:" @@ -9749,8 +9842,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -9803,7 +9896,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -9821,9 +9916,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -9840,6 +9935,10 @@ msgid "triggers" msgstr "" #, fuzzy +msgid "default triggers" +msgstr "Lista de atalhos:" + +#, fuzzy msgid "options for triggers" msgstr "opções para proxys" @@ -9907,8 +10006,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -10072,6 +10172,14 @@ msgstr "" "%s arquivo %s (arquivo local: %s) vai ser retomado a partir da posição %llu" #, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: charset inválido: \"%s\"" + +#, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s%s: faltando argumentos (%s)" @@ -10088,14 +10196,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s%s: não é possível acessar o arquivo \"%s\"" #, fuzzy, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "%s%s: charset inválido: \"%s\"" - -#, fuzzy, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "%s%s: charset inválido: \"%s\"" - -#, fuzzy, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s%s: não foi possível criar socket para transferência" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" -"PO-Revision-Date: 2014-08-16 11:46+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\n" +"PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: ru\n" @@ -1375,11 +1375,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1393,23 +1394,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -1433,7 +1435,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -2542,6 +2544,11 @@ msgid "" msgstr "" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -2711,6 +2718,9 @@ msgstr "" msgid "string used to show zoom on merged buffer (bar item \"buffer_zoom\")" msgstr "" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -2976,17 +2986,20 @@ msgstr "цвет времени в окне чата" msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "" -#, fuzzy -msgid "text color for offline nick (not in nicklist any more)" -msgstr "цвет отошедших ников" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" +msgstr "" -#, fuzzy -msgid "text color for offline nick with highlight" -msgstr "цвет отошедших ников" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" -#, fuzzy -msgid "background color for offline nick with highlight" -msgstr "цвет фона заголовка" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" +msgstr "" #, fuzzy msgid "text color for other nick in private buffer" @@ -3149,6 +3162,10 @@ msgid "text color for filter indicator in status bar" msgstr "цвет текущего канала в строке состояния" #, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "цвет текущего канала в строке состояния" + +#, fuzzy msgid "text color for current buffer name in status bar" msgstr "цвет текущего канала в строке состояния" @@ -3192,6 +3209,13 @@ msgid "" msgstr "" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -3421,18 +3445,23 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "%s сокращение или команда \"%s\" не найдены\n" #, fuzzy, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "%s сокращение или команда \"%s\" не найдены\n" + +#, fuzzy, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" msgstr "%s игнорирование уже существует\n" #, fuzzy, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" -msgstr "%s некорректное значение параметра \"%s\"\n" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" +msgstr "%s сокращение или команда \"%s\" не найдены\n" #, fuzzy, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" -msgstr "%s сокращение или команда \"%s\" не найдены\n" +msgid "%sError: too many calls to command \"%s\" (looping)" +msgstr "%s некорректное значение параметра \"%s\"\n" #, fuzzy msgid "" @@ -4605,6 +4634,19 @@ msgstr "%s подключается к серверу \"%s\"!\n" msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "Сервер %s%s%s создан\n" +#, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + #, fuzzy, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "%sСервер: %s%s %s[%s%s%s]\n" @@ -4963,10 +5005,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -5622,7 +5665,7 @@ msgid "change mode on channel, without having operator status" msgstr "" #, fuzzy -msgid "<channel> <mode>" +msgid "[<channel>] <mode>" msgstr "%d канал" #, fuzzy @@ -6140,8 +6183,9 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" msgid "" @@ -6576,6 +6620,9 @@ msgstr "цвет текущего окна с сообщениями" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "" +msgid "enable creation of temporary servers with command /connect" +msgstr "" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" @@ -7020,7 +7067,7 @@ msgid "%s%s: cannot create new channel \"%s\"" msgstr "%s не могу создать новый канал \"%s\"\n" #, fuzzy, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s %s(%s%s%s)%s зашёл на канал %s%s\n" #, fuzzy, c-format @@ -7185,11 +7232,11 @@ msgstr "Реоп канала %s%s%s: %s%s\n" #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" msgstr "%s[%s%s%s] %s%s%s забанен пользователем " #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s invited by %s" msgstr "%s[%s%s%s] %s%s%s забанен пользователем " #, fuzzy, c-format @@ -7198,7 +7245,11 @@ msgstr "%s[%s%s%s] %s%s%s забанен пользователем " #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" +msgstr "%s[%s%s%s] %s%s%s забанен\n" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" msgstr "%s[%s%s%s] %s%s%s забанен\n" #, fuzzy, c-format @@ -7251,11 +7302,15 @@ msgstr[2] "ник" #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" msgstr "%s[%s%s%s] %s%s%s забанен пользователем " #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s banned by %s" +msgstr "%s[%s%s%s] %s%s%s забанен пользователем " + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" msgstr "%s[%s%s%s] %s%s%s забанен пользователем " #, fuzzy, c-format @@ -7285,11 +7340,15 @@ msgstr "%s: ник \"%s\" уже используется, пробую втор #. TRANSLATORS: "%s" after "on" is a date #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s[%s%s%s] %s%s%s забанен пользователем " + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" msgstr "%s[%s%s%s] %s%s%s забанен пользователем " #, fuzzy, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s quieted" msgstr "%s[%s%s%s] %s%s%s забанен пользователем " #, fuzzy, c-format @@ -8073,10 +8132,6 @@ msgid "structure with completion" msgstr "вставить строку в поле ввода" #, fuzzy -msgid "structure with partial completion" -msgstr "вставить строку в поле ввода" - -#, fuzzy msgid "config file" msgstr "перезагрузить конфигурационный файл сервера" @@ -8502,6 +8557,10 @@ msgid "Listening on ports:" msgstr "Список сокращений:\n" #, fuzzy, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr "%s%s%s отсутствует: %s\n" + +#, fuzzy, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr "%s%s%s отсутствует: %s\n" @@ -8525,16 +8584,26 @@ msgid "relay control" msgstr "" msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -8543,10 +8612,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -8702,9 +8772,9 @@ msgid "display backlog starting from last client disconnect" msgstr "" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -9383,6 +9453,12 @@ msgstr "Сокращения не заданы.\n" msgid "List of default triggers:" msgstr "Список сокращений:\n" +#, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + #, fuzzy, c-format msgid "Trigger \"%s\" restarted" msgstr "Сокращение \"%s\" => \"%s\" создано\n" @@ -9484,6 +9560,14 @@ msgstr "Сокращение \"%s\" удалено\n" msgid "Trigger:" msgstr "" +#, fuzzy, c-format +msgid "Trigger \"%s\" restored" +msgstr "Сокращение \"%s\" => \"%s\" создано\n" + +#, fuzzy, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%s сервер \"%s\" не найден\n" + #, fuzzy msgid "Default triggers restored:" msgstr "Комбинации клавиш по умолчанию восстановлены\n" @@ -9504,8 +9588,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -9558,7 +9642,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -9576,9 +9662,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -9595,6 +9681,10 @@ msgid "triggers" msgstr "" #, fuzzy +msgid "default triggers" +msgstr "Список сокращений:\n" + +#, fuzzy msgid "options for triggers" msgstr "Список сокращений:\n" @@ -9663,8 +9753,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -9831,6 +9922,14 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "" "DCC: файл %s%s%s (локальное имя файла: %s%s%s) будет продолжен с позиции %u\n" +#, c-format +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" +msgstr "" + +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "Не могу записать лог-файл \"%s\"\n" + #, fuzzy, c-format msgid "%s%s: missing arguments (%s)" msgstr "%s нет аргумента для параметра \"%s\"\n" @@ -9848,14 +9947,6 @@ msgid "%s%s: cannot access file \"%s\"" msgstr "%s нет доступа к файлу \"%s\"\n" #, fuzzy, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" -msgstr "Не могу записать лог-файл \"%s\"\n" - -#, fuzzy, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" -msgstr "Не могу записать лог-файл \"%s\"\n" - -#, fuzzy, c-format msgid "%s%s: cannot create socket for xfer: error %d %s" msgstr "%s невозможно создать сокет\n" diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index 810fd3a31..a7d10d667 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -1,5 +1,7 @@ SET(WEECHAT_SOURCES ./doc/docgen.py +./src/core/wee-arraylist.c +./src/core/wee-arraylist.h ./src/core/wee-backtrace.c ./src/core/wee-backtrace.h ./src/core/weechat.c @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\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" @@ -1210,11 +1210,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1228,23 +1229,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -1268,7 +1270,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -2273,6 +2275,11 @@ msgid "" msgstr "" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -2426,6 +2433,9 @@ msgstr "" msgid "string used to show zoom on merged buffer (bar item \"buffer_zoom\")" msgstr "" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -2665,13 +2675,19 @@ msgstr "" msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "" -msgid "text color for offline nick (not in nicklist any more)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" msgstr "" -msgid "text color for offline nick with highlight" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" msgstr "" -msgid "background color for offline nick with highlight" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" msgstr "" msgid "text color for other nick in private buffer" @@ -2800,6 +2816,10 @@ msgstr "" msgid "text color for filter indicator in status bar" msgstr "" +#, fuzzy +msgid "text color for mouse indicator in status bar" +msgstr "zaman için metin rengi (durum çubuğu)" + msgid "text color for current buffer name in status bar" msgstr "" @@ -2836,6 +2856,13 @@ msgid "" msgstr "" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -3042,17 +3069,22 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" msgstr "" #, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" msgstr "" #, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" +msgid "%sError: too many calls to command \"%s\" (looping)" msgstr "" msgid "" @@ -4156,6 +4188,19 @@ msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "" #, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + +#, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "" @@ -4487,10 +4532,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -5018,7 +5064,8 @@ msgstr "<rumuz> <kanal>[,<kanal>...]" msgid "change mode on channel, without having operator status" msgstr "" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<kanal> <kip>" msgid "" @@ -5459,8 +5506,9 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" msgid "" @@ -5860,6 +5908,9 @@ msgstr "" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "" +msgid "enable creation of temporary servers with command /connect" +msgstr "" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" @@ -6255,8 +6306,8 @@ msgstr "" msgid "%s%s: cannot create new channel \"%s\"" msgstr "" -#, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +#, fuzzy, c-format +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "%s%s%s%s%s%s%s%s%s%s katıldı %s%s%s" #, c-format @@ -6417,22 +6468,26 @@ msgid "%sChannel reop %s%s%s: %s%s" msgstr "" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" -msgstr "" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" +msgstr "%s%s%s%s%s%s%s%s%s%s katıldı %s%s%s" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" -msgstr "" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s invited by %s" +msgstr "%s%s[%s%s%s]%s uzakta: %s" #, c-format msgid "%s%s[%s%s%s] %s%s%s invited" msgstr "" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" -msgstr "" +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" +msgstr "%s%s%s%s%s%s%s%s%s%s katıldı %s%s%s" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" +msgstr "%s%s[%s%s%s]%s uzakta: %s" #, c-format msgid "%s%s[%s%s%s]%s exception %s%s" @@ -6472,13 +6527,17 @@ msgid_plural "nicks" msgstr[0] "rumuz" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" -msgstr "" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" +msgstr "%s%s%s%s%s%s%s%s%s%s katıldı %s%s%s" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" -msgstr "" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned by %s" +msgstr "%s%s[%s%s%s]%s uzakta: %s" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" +msgstr "%s%s%s%s%s%s%s%s%s%s katıldı %s%s%s" #, c-format msgid "" @@ -6505,13 +6564,17 @@ msgid "%s%s: nickname \"%s\" is unavailable, trying nickname \"%s\"" msgstr "%s%s: \"%s\" takma adı kullanılamıyor, \"%s\" takma adı deneniyor" #. TRANSLATORS: "%s" after "on" is a date -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" -msgstr "" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" +msgstr "%s%s%s%s%s%s%s%s%s%s çıktı %s(%s%s%s)" -#, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" -msgstr "" +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" +msgstr "%s%s[%s%s%s]%s uzakta: %s" + +#, fuzzy, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted" +msgstr "%s%s%s%s%s%s%s%s%s%s çıktı" #, c-format msgid "%s%s: command \"%s\" not found:" @@ -7237,9 +7300,6 @@ msgstr "" msgid "structure with completion" msgstr "" -msgid "structure with partial completion" -msgstr "" - msgid "config file" msgstr "" @@ -7620,6 +7680,10 @@ msgid "Listening on ports:" msgstr "" #, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr "" + +#, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr "" @@ -7642,16 +7706,26 @@ msgid "relay control" msgstr "" msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -7660,10 +7734,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -7805,9 +7880,9 @@ msgid "display backlog starting from last client disconnect" msgstr "" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -8445,6 +8520,12 @@ msgstr "" msgid "List of default triggers:" msgstr "filtrelerin listesi" +#, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + #, fuzzy, c-format msgid "Trigger \"%s\" restarted" msgstr "Filtre \"%s\" etkin" @@ -8546,6 +8627,14 @@ msgstr "%s: \"%s\" kaldırıldı" msgid "Trigger:" msgstr "" +#, fuzzy, c-format +msgid "Trigger \"%s\" restored" +msgstr "Filtre \"%s\" etkin" + +#, fuzzy, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "%sTuş \"%s\" bulunamadı" + msgid "Default triggers restored:" msgstr "" @@ -8564,8 +8653,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -8618,7 +8707,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -8636,9 +8727,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -8655,6 +8746,10 @@ msgid "triggers" msgstr "" #, fuzzy +msgid "default triggers" +msgstr "filtrelerin listesi" + +#, fuzzy msgid "options for triggers" msgstr "çubukların seçenekleri" @@ -8721,8 +8816,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -8879,27 +8975,27 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "" #, c-format -msgid "%s%s: missing arguments (%s)" +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" msgstr "" -#, c-format -msgid "%s%s: unknown xfer type \"%s\"" -msgstr "" +#, fuzzy, c-format +msgid "%s%s: invalid address \"%s\": error %d %s" +msgstr "%s%s: \"%s\" adresi bulunamadı" #, c-format -msgid "%s%s: unknown xfer protocol \"%s\"" +msgid "%s%s: missing arguments (%s)" msgstr "" #, c-format -msgid "%s%s: cannot access file \"%s\"" +msgid "%s%s: unknown xfer type \"%s\"" msgstr "" #, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" +msgid "%s%s: unknown xfer protocol \"%s\"" msgstr "" #, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" +msgid "%s%s: cannot access file \"%s\"" msgstr "" #, c-format diff --git a/po/weechat.pot b/po/weechat.pot index 3d026f324..840158ab8 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-08-17 09:50+0200\n" +"POT-Creation-Date: 2014-11-09 16:21+0100\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" @@ -1214,11 +1214,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. a hdata name/variable (the value is automatically converted to string), " "by default \"window\" and \"buffer\" point to current window/buffer.\n" "Format for hdata can be one of following:\n" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1232,23 +1233,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -1272,7 +1274,7 @@ msgid "" " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc.freenode." -"#weechat\")\n" +"#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" @@ -2272,6 +2274,11 @@ msgid "" msgstr "" msgid "" +"if set, incomplete and unambiguous commands are allowed, for example /he " +"for /help" +msgstr "" + +msgid "" "if set, /quit command must be confirmed with extra argument \"-yes\" (see /" "help quit)" msgstr "" @@ -2425,6 +2432,9 @@ msgstr "" msgid "string used to show zoom on merged buffer (bar item \"buffer_zoom\")" msgstr "" +msgid "string used to show if mouse is enabled (bar item \"mouse_status\")" +msgstr "" + msgid "" "jump to previous buffer displayed when jumping to current buffer number " "with /buffer *N (where N is a buffer number), to easily switch to another " @@ -2664,13 +2674,19 @@ msgstr "" msgid "color for nick prefix (string displayed before nick in prefix)" msgstr "" -msgid "text color for offline nick (not in nicklist any more)" +msgid "" +"text color for offline nick (not in nicklist any more); this color is used " +"only if option weechat.look.color_nick_offline is enabled" msgstr "" -msgid "text color for offline nick with highlight" +msgid "" +"text color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" msgstr "" -msgid "background color for offline nick with highlight" +msgid "" +"background color for offline nick with highlight; this color is used only if " +"option weechat.look.color_nick_offline is enabled" msgstr "" msgid "text color for other nick in private buffer" @@ -2799,6 +2815,9 @@ msgstr "" msgid "text color for filter indicator in status bar" msgstr "" +msgid "text color for mouse indicator in status bar" +msgstr "" + msgid "text color for current buffer name in status bar" msgstr "" @@ -2834,6 +2853,13 @@ msgid "" msgstr "" msgid "" +"if enabled, the commands inside command line are completed (the command at " +"beginning of line has higher priority and is used first); note: when this " +"option is enabled, there is no more automatic completion of paths beginning " +"with '/' (outside commands arguments)" +msgstr "" + +msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" msgstr "" @@ -3040,17 +3066,22 @@ msgid "%sError with command \"%s\" (help on command: /help %s)" msgstr "" #, c-format +msgid "%sError: unknown command \"%s\" (type /help for help)" +msgstr "" + +#, c-format msgid "" "%sError: ambiguous command \"%s\": it exists in many plugins and not in \"%s" "\" plugin" msgstr "" #, c-format -msgid "%sError: too much calls to command \"%s\" (looping)" +msgid "" +"%sError: incomplete command \"%s\" and multiple commands start with this name" msgstr "" #, c-format -msgid "%sError: unknown command \"%s\" (type /help for help)" +msgid "%sError: too many calls to command \"%s\" (looping)" msgstr "" msgid "" @@ -4151,6 +4182,19 @@ msgid "%s: server %s%s%s created (temporary server, NOT SAVED!)" msgstr "" #, c-format +msgid "" +"%s%s: unable to create temporary server \"%s\" because the creation of " +"temporary servers with command /connect is currently disabled" +msgstr "" + +#, c-format +msgid "" +"%s%s: if you want to create a standard server, use the command \"/server add" +"\" (see /help server); if you really want to create a temporary server (NOT " +"SAVED), turn on the option irc.look.temporary_servers" +msgstr "" + +#, c-format msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" msgstr "" @@ -4481,10 +4525,11 @@ msgid "" " server: server name, which can be:\n" " - internal server name (created by /server add, recommended " "usage)\n" -" - hostname/port or IP/port (this will create a TEMPORARY " -"server), port is 6667 by default\n" +" - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]irc.example." "org[:port][/#channel1][,#channel2[...]]\n" +" Note: for an address/IP/URL, a temporary server is created (NOT " +"SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -5002,7 +5047,7 @@ msgstr "" msgid "change mode on channel, without having operator status" msgstr "" -msgid "<channel> <mode>" +msgid "[<channel>] <mode>" msgstr "" msgid "" @@ -5400,8 +5445,9 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available; capabilities supported by WeeChat are: away-notify, multi-prefix, " -"server-time, userhost-in-names, (example: \"away-notify,multi-prefix\")" +"available; capabilities supported by WeeChat are: away-notify, extended-" +"join, multi-prefix, server-time, userhost-in-names (example: \"away-notify," +"multi-prefix\")" msgstr "" msgid "" @@ -5799,6 +5845,9 @@ msgstr "" msgid "enable smart filter for \"part\" and \"quit\" messages" msgstr "" +msgid "enable creation of temporary servers with command /connect" +msgstr "" + msgid "strip colors in topic (used only when displaying buffer title)" msgstr "" @@ -6193,7 +6242,7 @@ msgid "%s%s: cannot create new channel \"%s\"" msgstr "" #, c-format -msgid "%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" +msgid "%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s" msgstr "" #, c-format @@ -6356,11 +6405,11 @@ msgstr "" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s invited by %s on %s" msgstr "" #, c-format -msgid "%s%s[%s%s%s] %s%s%s invited by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s invited by %s" msgstr "" #, c-format @@ -6369,7 +6418,11 @@ msgstr "" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s]%s exception %s%s%s by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s on %s" +msgstr "" + +#, c-format +msgid "%s%s[%s%s%s]%s exception %s%s%s by %s" msgstr "" #, c-format @@ -6414,11 +6467,15 @@ msgstr[1] "" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s banned by %s on %s" msgstr "" #, c-format -msgid "%s%s[%s%s%s] %s%s%s banned by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s banned by %s" +msgstr "" + +#, c-format +msgid "%s%s[%s%s%s] %s%s%s banned" msgstr "" #, c-format @@ -6447,11 +6504,15 @@ msgstr "" #. TRANSLATORS: "%s" after "on" is a date #, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)%s on %s" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s on %s" msgstr "" #, c-format -msgid "%s%s[%s%s%s] %s%s%s quieted by %s%s %s(%s%s%s)" +msgid "%s%s[%s%s%s] %s%s%s quieted by %s" +msgstr "" + +#, c-format +msgid "%s%s[%s%s%s] %s%s%s quieted" msgstr "" #, c-format @@ -7178,9 +7239,6 @@ msgstr "" msgid "structure with completion" msgstr "" -msgid "structure with partial completion" -msgstr "" - msgid "config file" msgstr "" @@ -7561,6 +7619,10 @@ msgid "Listening on ports:" msgstr "" #, c-format +msgid " port %s%d%s, relay: %s%s%s, %s (not started)" +msgstr "" + +#, c-format msgid " port %s%d%s, relay: %s%s%s, %s, started on: %s" msgstr "" @@ -7583,16 +7645,26 @@ msgid "relay control" msgstr "" msgid "" -"list|listfull|listrelay || add [ipv4.][ipv6.][ssl.]<protocol.name> <port> || " -"del [ipv4.][ipv6.][ssl.]<protocol.name> || raw || sslcertkey" +"list|listfull|listrelay || add <name> <port> || del|stop|restart <name> || " +"raw || sslcertkey" msgstr "" msgid "" " list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" -" add: add relay for a protocol + name\n" -" del: remove relay for a protocol + name\n" +" add: add a relay (listen on a port)\n" +" del: remove a relay (clients remain connected)\n" +" stop: close the server socket (clients remain connected)\n" +" restart: close the server socket and listen again on port (clients " +"remain connected)\n" +" name: relay name (see format below)\n" +" port: port used for relay\n" +" raw: open buffer with raw Relay data\n" +" sslcertkey: set SSL certificate/key using path in option relay.network." +"ssl_cert_key\n" +"\n" +"Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -7601,10 +7673,11 @@ msgid "" "if not given, the server name must be sent by client in command \"PASS\", " "with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" -" port: port used for relay\n" -" raw: open buffer with raw Relay data\n" -" sslcertkey: set SSL certificate/key using path in option relay.network." -"ssl_cert_key\n" +"\n" +"The \"irc\" protocol allows any IRC client (including WeeChat itself) to " +"connect on the port.\n" +"The \"weechat\" protocol allows a remote interface to connect on the port, " +"see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay clients.\n" "\n" @@ -7746,9 +7819,9 @@ msgid "display backlog starting from last client disconnect" msgstr "" msgid "" -"tags of messages which are displayed in backlog per IRC channel (supported " -"tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg" -"\"), \"*\" = all supported tags" +"comma-separated list of messages tags which are displayed in backlog per IRC " +"channel (supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", \"irc_nick" +"\", \"irc_privmsg\"), \"*\" = all supported tags" msgstr "" msgid "" @@ -8378,6 +8451,12 @@ msgid "List of default triggers:" msgstr "" #, c-format +msgid "" +"%s%s: action \"%s\" can not be executed on trigger \"%s\" because it is " +"currently running" +msgstr "" + +#, c-format msgid "Trigger \"%s\" restarted" msgstr "" @@ -8477,6 +8556,14 @@ msgstr "" msgid "Trigger:" msgstr "" +#, c-format +msgid "Trigger \"%s\" restored" +msgstr "" + +#, c-format +msgid "%sDefault trigger \"%s\" not found" +msgstr "" + msgid "Default triggers restored:" msgstr "" @@ -8495,8 +8582,8 @@ msgid "" "\" [\"<return_code>\"]]]]] || addinput [<hook>] || input|output|recreate " "<name> || set <name> <option> <value> || rename|copy <name> <new_name> || " "enable|disable|toggle [<name>|-all [<name>...]] || restart <name>|-all " -"[<name>...] || show <name> || del <name>|-all [<name>...] || default -yes || " -"monitor [<filter>]" +"[<name>...] || show <name> || del <name>|-all [<name>...] || restore <name> " +"[<name>...] || default -yes || monitor [<filter>]" msgstr "" msgid "" @@ -8549,7 +8636,9 @@ msgid "" " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" -" default: restore default triggers\n" +" restore: restore trigger(s) with the default values (works only for " +"default triggers)\n" +" default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start with \"@\", " "for example \"@signal\"), many filters can be separated by commas; wildcard " @@ -8567,9 +8656,9 @@ msgid "" " 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:" -"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-" -"italic}/\"\n" +"\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== ==_(\\S+)_==_${color:" +"underline}${re:1}${color:-underline}_== ==/(\\S+)/==/${color:" +"italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch \"${info:term_width} < " "100\" \"\" \"/bar hide nicklist\"\n" @@ -8585,6 +8674,9 @@ msgstr "" msgid "triggers" msgstr "" +msgid "default triggers" +msgstr "" + msgid "options for triggers" msgstr "" @@ -8646,8 +8738,9 @@ msgid "" "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; escaped chars are interpreted in the regex (for example " "\"\\n\"); the separator \"/\" can be replaced by any char (one or more " -"identical chars); matching groups can be used in replace: $0 to $99, $+ for " -"last match and $.cN to replace all chars of group N by char c" +"identical chars); matching groups can be used in replace: ${re:0} to " +"${re:99}, ${re:+} for last match and ${hide:c,${re:N}} to replace all chars " +"of group N by char 'c'" msgstr "" msgid "" @@ -8798,27 +8891,27 @@ msgid "%s: file %s (local filename: %s) will be resumed at position %llu" msgstr "" #, c-format -msgid "%s%s: missing arguments (%s)" +msgid "%s%s: address \"%s\" resolved to a larger sockaddr than expected" msgstr "" #, c-format -msgid "%s%s: unknown xfer type \"%s\"" +msgid "%s%s: invalid address \"%s\": error %d %s" msgstr "" #, c-format -msgid "%s%s: unknown xfer protocol \"%s\"" +msgid "%s%s: missing arguments (%s)" msgstr "" #, c-format -msgid "%s%s: cannot access file \"%s\"" +msgid "%s%s: unknown xfer type \"%s\"" msgstr "" #, c-format -msgid "%s%s: invalid address \"%s\" (option xfer.network.own_ip): error %d %s" +msgid "%s%s: unknown xfer protocol \"%s\"" msgstr "" #, c-format -msgid "%s%s: unable to find address for \"%s\": error %d %s" +msgid "%s%s: cannot access file \"%s\"" msgstr "" #, c-format diff --git a/scripts/build.sh b/scripts/build.sh index df2dcd1c8..da68ea56f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -21,6 +21,16 @@ # # Build WeeChat with CMake or autotools, according to environment variable # $BUILDTOOL or first script argument (if given). +# The optional variable $BUILDARGS can be set with arguments for cmake or +# configure commands. +# +# Syntax to run the script with environment variables: +# BUILDTOOL=cmake|autotools ./build.sh +# BUILDTOOL=cmake|autotools BUILDARGS="arguments" ./build.sh +# +# Syntax to run the script with arguments on command line: +# ./build.sh cmake|autotools +# ./build.sh cmake|autotools arguments # # This script is used to build WeeChat in Travis CI environment. # @@ -38,7 +48,12 @@ run () BUILDDIR="build-tmp-$$" if [ $# -ge 1 ]; then - BUILDTOOL=$1 + BUILDTOOL="$1" + shift +fi + +if [ $# -ge 1 ]; then + BUILDARGS="$*" fi if [ -z "$BUILDTOOL" ]; then @@ -52,7 +67,7 @@ run "cd $BUILDDIR" if [ "$BUILDTOOL" = "cmake" ]; then # build with CMake - run "cmake .. -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON" + run "cmake .. -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON ${BUILDARGS}" run "make VERBOSE=1 -j$(nproc)" run "sudo make install" run "ctest -V" @@ -61,7 +76,7 @@ fi if [ "$BUILDTOOL" = "autotools" ]; then # build with autotools run "../autogen.sh" - run "../configure --enable-man --enable-doc --enable-tests" + run "../configure --enable-man --enable-doc --enable-tests ${BUILDARGS}" run "make -j$(nproc)" run "sudo make install" run "./tests/tests -v" diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ff2bc13b5..1ae0eaf37 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -21,6 +21,7 @@ set(LIB_CORE_SRC weechat.c weechat.h +wee-arraylist.c wee-arraylist.h wee-backtrace.c wee-backtrace.h wee-command.c wee-command.h wee-completion.c wee-completion.h diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 65b199263..c7276d8fe 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -23,6 +23,8 @@ noinst_LIBRARIES = lib_weechat_core.a lib_weechat_core_a_SOURCES = weechat.c \ weechat.h \ + wee-arraylist.c \ + wee-arraylist.h \ wee-backtrace.c \ wee-backtrace.h \ wee-command.c \ diff --git a/src/core/wee-arraylist.c b/src/core/wee-arraylist.c new file mode 100644 index 000000000..3d2ab4bab --- /dev/null +++ b/src/core/wee-arraylist.c @@ -0,0 +1,696 @@ +/* + * wee-arraylist.c - array lists management + * + * Copyright (C) 2014 Sébastien Helleu <flashcode@flashtux.org> + * + * This file is part of WeeChat, the extensible chat client. + * + * WeeChat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * WeeChat is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WeeChat. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> + +#include "weechat.h" +#include "wee-arraylist.h" +#include "wee-log.h" +#include "wee-string.h" + + +/* + * Creates a new arraylist. + * + * Returns pointer to arraylist, NULL if error. + */ + +struct t_arraylist * +arraylist_new (int initial_size, + int sorted, + int allow_duplicates, + t_arraylist_cmp *callback_cmp, void *callback_cmp_data, + t_arraylist_free *callback_free, void *callback_free_data) +{ + struct t_arraylist *new_arraylist; + + /* check arguments */ + if ((initial_size < 0) || !callback_cmp) + return NULL; + + new_arraylist = malloc (sizeof (*new_arraylist)); + if (!new_arraylist) + return NULL; + + new_arraylist->size = 0; + if (initial_size > 0) + { + new_arraylist->size_alloc = initial_size; + new_arraylist->size_alloc_min = initial_size; + new_arraylist->data = calloc (initial_size, + sizeof (*new_arraylist->data)); + if (!new_arraylist->data) + { + free (new_arraylist); + return NULL; + } + } + else + { + new_arraylist->size_alloc = 0; + new_arraylist->size_alloc_min = 0; + new_arraylist->data = NULL; + } + new_arraylist->sorted = sorted; + new_arraylist->allow_duplicates = allow_duplicates; + new_arraylist->callback_cmp = callback_cmp; + new_arraylist->callback_cmp_data = callback_cmp_data; + new_arraylist->callback_free = callback_free; + new_arraylist->callback_free_data = callback_free_data; + + return new_arraylist; +} + +/* + * Returns the size of an arraylist (number of elements). + */ + +int +arraylist_size (struct t_arraylist *arraylist) +{ + if (!arraylist) + return 0; + + return arraylist->size; +} + +/* + * Returns the pointer to an arraylist element, by index. + */ + +void * +arraylist_get (struct t_arraylist *arraylist, int index) +{ + if (!arraylist || (index < 0) || (index >= arraylist->size)) + return NULL; + + return arraylist->data[index]; +} + +/* + * Adjusts the allocated size of arraylist to add one element (if needed), + * so that the list has enough allocated data to store (current_size + 1) + * elements. + * + * Returns: + * 1: OK + * 0: error + */ + +int +arraylist_grow (struct t_arraylist *arraylist) +{ + int new_size_alloc; + void **data; + + if (!arraylist) + return 0; + + /* if we have enough space allocated, do nothing */ + if (arraylist->size + 1 <= arraylist->size_alloc) + return 1; + + new_size_alloc = (arraylist->size_alloc < 2) ? + 2 : arraylist->size_alloc + (arraylist->size_alloc / 2); + + data = realloc (arraylist->data, + new_size_alloc * sizeof (*arraylist->data)); + if (!data) + return 0; + arraylist->data = data; + memset (&arraylist->data[arraylist->size_alloc], + 0, + (new_size_alloc - arraylist->size_alloc) * + sizeof (*arraylist->data)); + arraylist->size_alloc = new_size_alloc; + + return 1; +} + +/* + * Adjusts the allocated size of arraylist to remove one element (if needed), + * so that the list has enough allocated data to store (current size - 1) + * elements. + * + * Returns: + * 1: OK + * 0: error + */ + +int +arraylist_shrink (struct t_arraylist *arraylist) +{ + int new_size_alloc; + void **data; + + if (!arraylist) + return 0; + + /* we don't shrink if we are below the min allocated size */ + if ((arraylist->size_alloc == 0) + || (arraylist->size_alloc <= arraylist->size_alloc_min)) + { + return 1; + } + + /* clear the arraylist if current allocated size is 1 */ + if (arraylist->size_alloc == 1) + { + free (arraylist->data); + arraylist->data = NULL; + arraylist->size_alloc = 0; + return 1; + } + + new_size_alloc = arraylist->size_alloc - (arraylist->size_alloc / 2); + + if (arraylist->size - 1 >= new_size_alloc) + return 1; + + data = realloc (arraylist->data, + new_size_alloc * sizeof (*arraylist->data)); + if (!data) + return 0; + arraylist->data = data; + arraylist->size_alloc = new_size_alloc; + + return 1; +} + +/* + * Performs a binary search in the arraylist to find an element + * (this function must be called only if the arraylist is sorted). + * + * If "index" is not NULL, it is set with the index of element found (or -1 if + * element was not found). + * + * If "index_insert" is not NULL, it is set with the index that must be used to + * insert the element in the arraylist (to keep arraylist sorted). + * + * Returns pointer to element found, NULL if not found. + */ + +void * +arraylist_binary_search (struct t_arraylist *arraylist, void *pointer, + int *index, int *index_insert) +{ + int ret_index, ret_index_insert, start, end, middle, rc; + void *ret_pointer; + + ret_index = -1; + ret_index_insert = -1; + ret_pointer = NULL; + + if (!arraylist) + goto end; + + start = 0; + end = arraylist->size - 1; + + /* + * statistically we often add at the end, or before first element, so + * first check these cases (for performance), before doing the binary + * search + */ + rc = (arraylist->callback_cmp) (arraylist->callback_cmp_data, + arraylist, + pointer, + arraylist->data[end]); + if (rc == 0) + { + ret_index = end; + /* by convention, add an element with same value after the last one */ + ret_index_insert = end + 1; + ret_pointer = arraylist->data[end]; + goto end; + } + if (rc > 0) + { + ret_index = -1; + ret_index_insert = -1; + ret_pointer = NULL; + goto end; + } + if (arraylist->size == 1) + { + ret_index = -1; + ret_index_insert = 0; + ret_pointer = NULL; + goto end; + } + + rc = (arraylist->callback_cmp) (arraylist->callback_cmp_data, + arraylist, + pointer, + arraylist->data[start]); + if (rc == 0) + { + ret_index = start; + ret_index_insert = start + 1; + ret_pointer = arraylist->data[start]; + goto end; + } + if (rc < 0) + { + ret_index = -1; + ret_index_insert = start; + ret_pointer = NULL; + goto end; + } + if (arraylist->size == 2) + { + ret_index = -1; + ret_index_insert = end; + ret_pointer = NULL; + goto end; + } + + start++; + end--; + + /* perform a binary search to find the index */ + while (start <= end) + { + middle = (start + end) / 2; + + rc = (arraylist->callback_cmp) (arraylist->callback_cmp_data, + arraylist, + pointer, + arraylist->data[middle]); + if (rc == 0) + { + ret_index = middle; + ret_index_insert = middle + 1; + ret_pointer = arraylist->data[middle]; + goto end; + } + + if (rc < 0) + end = middle - 1; + else + start = middle + 1; + + if (start > end) + { + ret_index = -1; + ret_index_insert = (rc < 0) ? middle : middle + 1; + ret_pointer = NULL; + } + } + +end: + if ((ret_index >= 0) && arraylist->allow_duplicates) + { + /* + * in case of duplicates in table, the index of element found + * is the first element with the value, and the index for + * insert is the last element with the value + 1 + */ + start = ret_index - 1; + while (start >= 0) + { + rc = (arraylist->callback_cmp) ( + arraylist->callback_cmp_data, + arraylist, + pointer, + arraylist->data[start]); + if (rc != 0) + break; + start--; + } + start++; + end = ret_index + 1; + while (end < arraylist->size) + { + rc = (arraylist->callback_cmp) ( + arraylist->callback_cmp_data, + arraylist, + pointer, + arraylist->data[end]); + if (rc != 0) + break; + end++; + } + end--; + ret_index = start; + ret_index_insert = end + 1; + ret_pointer = arraylist->data[start]; + } + + if (index) + *index = ret_index; + if (index_insert) + *index_insert = ret_index_insert; + + return ret_pointer; +} + +/* + * Performs a standard search in the arraylist to find an element + * (this function must be called only if the arraylist is NOT sorted). + * + * If "index" is not NULL, it is set with the index of element found (or -1 if + * element was not found). + * + * If "index_insert" is not NULL, it is set to -1 (elements are always added + * at the end of list when it is not sorted). + * + * Returns pointer to element found, NULL if not found. + */ + +void * +arraylist_standard_search (struct t_arraylist *arraylist, void *pointer, + int *index, int *index_insert) +{ + int i; + + if (!arraylist) + goto end; + + for (i = 0; i < arraylist->size; i++) + { + if ((arraylist->callback_cmp) (arraylist->callback_cmp_data, + arraylist, arraylist->data[i], + pointer) == 0) + { + if (index) + *index = i; + if (index_insert) + *index_insert = -1; + return arraylist->data[i]; + } + } + +end: + if (index) + *index = -1; + if (index_insert) + *index_insert = -1; + return NULL; +} + +/* + * Searches an element in the arraylist. + * + * If "index" is not NULL, it is set with the index of element found (or -1 if + * element was not found). + * + * If "index_insert" is not NULL, it is set with the index that must be used to + * insert the element in the arraylist (to keep arraylist sorted). + * + * Returns pointer to element found, NULL if not found. + */ + +void * +arraylist_search (struct t_arraylist *arraylist, void *pointer, + int *index, int *index_insert) +{ + if (index) + *index = -1; + if (index_insert) + *index_insert = -1; + + if (!arraylist || (arraylist->size == 0)) + return NULL; + + if (arraylist->sorted) + { + return arraylist_binary_search (arraylist, pointer, + index, index_insert); + } + else + { + return arraylist_standard_search (arraylist, pointer, + index, index_insert); + } +} + +/* + * Inserts an element at a given index (and shifts next elements by one + * position), or at automatic index if the arraylist is sorted. + * + * If the index is negative and that the arraylist is not sorted, the element + * is added at the end of arraylist. + * + * If the arraylist is sorted, the argument "index" is ignored (the element + * will be inserted at appropriate position, to keep arraylist sorted). + * + * Returns the index of the new element (>= 0) or -1 if error. + */ + +int +arraylist_insert (struct t_arraylist *arraylist, int index, void *pointer) +{ + int index_insert, i; + + if (!arraylist) + return -1; + + if (arraylist->sorted) + { + (void) arraylist_search (arraylist, pointer, &index, &index_insert); + if ((index >= 0) && !arraylist->allow_duplicates) + { + while ((index < arraylist->size) + && (((arraylist->callback_cmp) (arraylist->callback_cmp_data, + arraylist, arraylist->data[index], + pointer)) == 0)) + { + arraylist_remove (arraylist, index); + } + } + else + index = index_insert; + } + else if (!arraylist->allow_duplicates) + { + /* + * arraylist is not sorted and does not allow duplicates, then we + * remove any element with the same value + */ + i = 0; + while (i < arraylist->size) + { + if ((arraylist->callback_cmp) (arraylist->callback_cmp_data, + arraylist, arraylist->data[i], + pointer) == 0) + { + arraylist_remove (arraylist, i); + } + else + i++; + } + } + + /* if index is negative or too big, add at the end */ + if ((index < 0) || (index > arraylist->size)) + index = arraylist->size; + + if (!arraylist_grow (arraylist)) + return -1; + + /* shift next elements by one position */ + if (index < arraylist->size) + { + memmove (&arraylist->data[index + 1], + &arraylist->data[index], + (arraylist->size - index) * sizeof (*arraylist->data)); + } + + /* set element */ + arraylist->data[index] = pointer; + + (arraylist->size)++; + + return index; +} + +/* + * Adds an element at the end of arraylist (or in the middle if the arraylist + * is sorted). + * + * Returns the index of the new element (>= 0) or -1 if error. + */ + +int +arraylist_add (struct t_arraylist *arraylist, void *pointer) +{ + if (!arraylist) + return -1; + + return arraylist_insert (arraylist, -1, pointer); +} + +/* + * Removes one element from the arraylist. + * + * Returns the index removed or -1 if error. + */ + +int +arraylist_remove (struct t_arraylist *arraylist, int index) +{ + if (!arraylist || (index < 0) || (index >= arraylist->size)) + return -1; + + if (arraylist->callback_free) + { + (arraylist->callback_free) (arraylist->callback_free_data, + arraylist, + arraylist->data[index]); + } + + if (index < arraylist->size - 1) + { + memmove (&arraylist->data[index], + &arraylist->data[index + 1], + (arraylist->size - index - 1) * sizeof (*arraylist->data)); + memset (&arraylist->data[arraylist->size - 1], 0, + sizeof (*arraylist->data)); + } + else + { + memset (&arraylist->data[index], 0, sizeof (*arraylist->data)); + } + + arraylist_shrink (arraylist); + + (arraylist->size)--; + + return index; +} + +/* + * Removes all elements in the arraylist. + * + * Returns: + * 1: OK + * 0: error + */ + +int +arraylist_clear (struct t_arraylist *arraylist) +{ + int i; + + if (!arraylist) + return 0; + + if (arraylist->callback_free) + { + for (i = 0; i < arraylist->size; i++) + { + (arraylist->callback_free) (arraylist->callback_free_data, + arraylist, + arraylist->data[i]); + } + } + + if (arraylist->data + && (arraylist->size_alloc != arraylist->size_alloc_min)) + { + free (arraylist->data); + arraylist->data = NULL; + arraylist->size_alloc = 0; + if (arraylist->size_alloc_min > 0) + { + arraylist->data = calloc(arraylist->size_alloc_min, + sizeof (*arraylist->data)); + if (!arraylist->data) + return 0; + arraylist->size_alloc = arraylist->size_alloc_min; + } + } + else if (arraylist->size_alloc > 0) + { + memset (arraylist->data, + 0, + arraylist->size_alloc * sizeof (*arraylist->data)); + } + + arraylist->size = 0; + + return 1; +} + +/* + * Frees an arraylist. + */ + +void +arraylist_free (struct t_arraylist *arraylist) +{ + int i; + + if (!arraylist) + return; + + if (arraylist->callback_free) + { + for (i = 0; i < arraylist->size; i++) + { + (arraylist->callback_free) (arraylist->callback_free_data, + arraylist, + arraylist->data[i]); + } + } + + if (arraylist->data) + free (arraylist->data); + + free (arraylist); +} + +/* + * Prints an arraylist in WeeChat log file (usually for crash dump). + */ + +void +arraylist_print_log (struct t_arraylist *arraylist, const char *name) +{ + int i; + + log_printf (""); + log_printf ("[arraylist %s (addr:0x%lx)]", name, arraylist); + log_printf (" size . . . . . . . . . : %d", arraylist->size); + log_printf (" size_alloc . . . . . . : %d", arraylist->size_alloc); + log_printf (" size_alloc_min . . . . : %d", arraylist->size_alloc_min); + log_printf (" sorted . . . . . . . . : %d", arraylist->sorted); + log_printf (" allow_duplicates . . . : %d", arraylist->allow_duplicates); + log_printf (" data . . . . . . . . . : 0x%lx", arraylist->data); + if (arraylist->data) + { + for (i = 0; i < arraylist->size_alloc; i++) + { + log_printf (" data[%08d] . . . : 0x%lx", + i, arraylist->data[i]); + } + } + log_printf (" callback_cmp . . . . . : 0x%lx", arraylist->callback_cmp); + log_printf (" callback_cmp_data. . . : 0x%lx", arraylist->callback_cmp_data); + log_printf (" callback_free. . . . . : 0x%lx", arraylist->callback_free); + log_printf (" callback_free_data . . : 0x%lx", arraylist->callback_free_data); +} diff --git a/src/core/wee-arraylist.h b/src/core/wee-arraylist.h new file mode 100644 index 000000000..9f3ac481b --- /dev/null +++ b/src/core/wee-arraylist.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2014 Sébastien Helleu <flashcode@flashtux.org> + * + * This file is part of WeeChat, the extensible chat client. + * + * WeeChat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * WeeChat is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WeeChat. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef WEECHAT_ARRAYLIST_H +#define WEECHAT_ARRAYLIST_H 1 + +struct t_arraylist; + +typedef int (t_arraylist_cmp)(void *data, struct t_arraylist *arraylist, + void *pointer1, void *pointer2); +typedef void (t_arraylist_free)(void *data, struct t_arraylist *arraylist, + void *pointer); + +struct t_arraylist +{ + int size; /* number of items in data */ + int size_alloc; /* number of allocated items */ + int size_alloc_min; /* min number of allocated items */ + int sorted; /* 1 if the arraylist is sorted */ + int allow_duplicates; /* 1 if duplicates are allowed */ + void **data; /* pointers to data */ + t_arraylist_cmp *callback_cmp; /* compare two elements */ + void *callback_cmp_data; /* data for compare callback */ + t_arraylist_free *callback_free; /* free an element */ + void *callback_free_data; /* data for free callback */ +}; + +extern struct t_arraylist *arraylist_new (int initial_size, + int sorted, + int allow_duplicates, + t_arraylist_cmp *callback_cmp, + void *callback_cmp_data, + t_arraylist_free *callback_free, + void *callback_free_data); +extern int arraylist_size (struct t_arraylist *arraylist); +extern void *arraylist_get (struct t_arraylist *arraylist, int index); +extern void *arraylist_search (struct t_arraylist *arraylist, void *pointer, + int *index, int *index_insert); +extern int arraylist_insert (struct t_arraylist *arraylist, int index, + void *pointer); +extern int arraylist_add (struct t_arraylist *arraylist, void *pointer); +extern int arraylist_remove (struct t_arraylist *arraylist, int index); +extern int arraylist_clear (struct t_arraylist *arraylist); +extern void arraylist_free (struct t_arraylist *arraylist); +extern void arraylist_print_log (struct t_arraylist *arraylist, + const char *name); + +#endif /* WEECHAT_ARRAYLIST_H */ diff --git a/src/core/wee-command.c b/src/core/wee-command.c index eebc78048..128477b6d 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1835,10 +1835,9 @@ COMMAND_CALLBACK(eval) { int i, print_only, condition; char *result, *ptr_args, *expr, **commands; - struct t_hashtable *options; + struct t_hashtable *pointers, *options; /* make C compiler happy */ - (void) buffer; (void) data; (void) argv; @@ -1870,12 +1869,24 @@ COMMAND_CALLBACK(eval) if (ptr_args) { + pointers = hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_POINTER, + NULL, + NULL); + if (pointers) + { + hashtable_set (pointers, "window", + gui_window_search_with_buffer (buffer)); + hashtable_set (pointers, "buffer", buffer); + } + options = NULL; if (condition) { options = hashtable_new (32, WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_POINTER, + WEECHAT_HASHTABLE_STRING, NULL, NULL); if (options) @@ -1888,7 +1899,7 @@ COMMAND_CALLBACK(eval) expr = string_remove_quotes (ptr_args, "\""); if (expr) { - result = eval_expression (expr, NULL, NULL, options); + result = eval_expression (expr, pointers, NULL, options); gui_chat_printf_date_tags (NULL, 0, "no_log", "\t>> %s", ptr_args); if (result) { @@ -1911,7 +1922,7 @@ COMMAND_CALLBACK(eval) } else { - result = eval_expression (ptr_args, NULL, NULL, options); + result = eval_expression (ptr_args, pointers, NULL, options); if (result) { commands = string_split_command (result, ';'); @@ -1933,6 +1944,8 @@ COMMAND_CALLBACK(eval) } if (result) free (result); + if (pointers) + hashtable_free (pointers); if (options) hashtable_free (options); } @@ -3886,16 +3899,9 @@ command_mouse_timer_cb (void *data, int remaining_calls) (void) data; (void) remaining_calls; - if (gui_mouse_enabled) - { - gui_mouse_disable (); - config_file_option_set (config_look_mouse, "0", 1); - } - else - { - gui_mouse_enable (); - config_file_option_set (config_look_mouse, "1", 1); - } + config_file_option_set (config_look_mouse, + (gui_mouse_enabled) ? "0" : "1", + 1); return WEECHAT_RC_OK; } @@ -3938,7 +3944,6 @@ COMMAND_CALLBACK(mouse) /* enable mouse */ if (string_strcasecmp (argv[1], "enable") == 0) { - gui_mouse_enable (); config_file_option_set (config_look_mouse, "1", 1); gui_chat_printf (NULL, _("Mouse enabled")); if (argc > 2) @@ -3949,7 +3954,6 @@ COMMAND_CALLBACK(mouse) /* disable mouse */ if (string_strcasecmp (argv[1], "disable") == 0) { - gui_mouse_disable (); config_file_option_set (config_look_mouse, "0", 1); gui_chat_printf (NULL, _("Mouse disabled")); if (argc > 2) @@ -3962,13 +3966,11 @@ COMMAND_CALLBACK(mouse) { if (gui_mouse_enabled) { - gui_mouse_disable (); config_file_option_set (config_look_mouse, "0", 1); gui_chat_printf (NULL, _("Mouse disabled")); } else { - gui_mouse_enable (); config_file_option_set (config_look_mouse, "1", 1); gui_chat_printf (NULL, _("Mouse enabled")); } @@ -7179,12 +7181,13 @@ command_init () "Some variables are replaced in expression, using the format " "${variable}, variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" - " 2. a color (format: \"color:xxx\")\n" - " 3. an info (format: \"info:name,arguments\", arguments are " + " 2. a string with chars to hide (format: \"hide:char,string\")\n" + " 3. a color (format: \"color:xxx\")\n" + " 4. an info (format: \"info:name,arguments\", arguments are " "optional)\n" - " 4. an option (format: \"file.section.option\")\n" - " 5. a local variable in buffer\n" - " 6. a hdata name/variable (the value is automatically converted " + " 5. an option (format: \"file.section.option\")\n" + " 6. a local variable in buffer\n" + " 7. a hdata name/variable (the value is automatically converted " "to string), by default \"window\" and \"buffer\" point to current " "window/buffer.\n" "Format for hdata can be one of following:\n" @@ -7200,23 +7203,24 @@ command_init () "reference\", function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" - " /eval -n ${info:version} ==> 0.4.3\n" - " /eval -n ${weechat.look.scroll_amount} ==> 3\n" - " /eval -n ${window} ==> 0x2549aa0\n" - " /eval -n ${window.buffer} ==> 0x2549320\n" - " /eval -n ${window.buffer.full_name} ==> core.weechat\n" - " /eval -n ${window.buffer.number} ==> 1\n" - " /eval -n ${\\t} ==> <tab>\n" + " /eval -n ${info:version} ==> 0.4.3\n" + " /eval -n ${weechat.look.scroll_amount} ==> 3\n" + " /eval -n ${window} ==> 0x2549aa0\n" + " /eval -n ${window.buffer} ==> 0x2549320\n" + " /eval -n ${window.buffer.full_name} ==> core.weechat\n" + " /eval -n ${window.buffer.number} ==> 1\n" + " /eval -n ${\\t} ==> <tab>\n" + " /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" - " /eval -n -c ${window.buffer.number} > 2 ==> 0\n" - " /eval -n -c ${window.win_width} > 100 ==> 1\n" - " /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" - " /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" - " /eval -n -c abcd =~ ^ABC ==> 1\n" - " /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" - " /eval -n -c abcd =~ (?-i)^abc ==> 1\n" - " /eval -n -c abcd !~ abc ==> 0"), + " /eval -n -c ${window.buffer.number} > 2 ==> 0\n" + " /eval -n -c ${window.win_width} > 100 ==> 1\n" + " /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" + " /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" + " /eval -n -c abcd =~ ^ABC ==> 1\n" + " /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" + " /eval -n -c abcd =~ (?-i)^abc ==> 1\n" + " /eval -n -c abcd !~ abc ==> 0"), "-n|-c -n|-c", &command_eval, NULL); hook_command ( @@ -7240,7 +7244,7 @@ command_init () " -all: delete all filters\n" " buffer: comma separated list of buffers where filter is active:\n" " - this is full name including plugin (example: \"irc." - "freenode.#weechat\")\n" + "freenode.#weechat\" or \"irc.server.freenode\")\n" " - \"*\" means all buffers\n" " - a name starting with '!' is excluded\n" " - wildcard \"*\" is allowed\n" diff --git a/src/core/wee-completion.c b/src/core/wee-completion.c index d4b77127d..e97c2d823 100644 --- a/src/core/wee-completion.c +++ b/src/core/wee-completion.c @@ -34,6 +34,7 @@ #include <unistd.h> #include "weechat.h" +#include "wee-arraylist.h" #include "wee-config.h" #include "wee-hashtable.h" #include "wee-hook.h" @@ -625,12 +626,12 @@ completion_list_add_nicks_cb (void *data, (void) completion_item; (void) buffer; - count_before = weelist_size (completion->completion_list); + count_before = completion->list->size; hook_completion_exec (completion->buffer->plugin, "nick", completion->buffer, completion); - if (weelist_size (completion->completion_list) == count_before) + if (completion->list->size == count_before) { /* * no plugin overrides nick completion => use default nick diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 00bc6dbf3..11d65900b 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -82,6 +82,76 @@ config_file_search (const char *name) } /* + * Searches for position of configuration file (to keep configuration files + * sorted by name). + */ + +struct t_config_file * +config_file_config_find_pos (const char *name) +{ + struct t_config_file *ptr_config; + + if (name) + { + for (ptr_config = config_files; ptr_config; + ptr_config = ptr_config->next_config) + { + if (string_strcasecmp (name, ptr_config->name) < 0) + return ptr_config; + } + } + + /* position not found (we will add to the end of list) */ + return NULL; +} + +/* + * Inserts a configuration file in list (keeping configuration files sorted by + * name). + */ + +void +config_file_config_insert (struct t_config_file *config_file) +{ + struct t_config_file *pos_config; + + if (!config_file) + return; + + if (config_files) + { + pos_config = config_file_config_find_pos (config_file->name); + if (pos_config) + { + /* insert configuration file into the list (before config found) */ + config_file->prev_config = pos_config->prev_config; + config_file->next_config = pos_config; + if (pos_config->prev_config) + (pos_config->prev_config)->next_config = config_file; + else + config_files = config_file; + pos_config->prev_config = config_file; + } + else + { + /* add configuration file to the end of list */ + config_file->prev_config = last_config_file; + config_file->next_config = NULL; + last_config_file->next_config = config_file; + last_config_file = config_file; + } + } + else + { + /* first configuration file */ + config_file->prev_config = NULL; + config_file->next_config = NULL; + config_files = config_file; + last_config_file = config_file; + } +} + +/* * Creates a new configuration file. * * Returns pointer to new configuration file, NULL if error. @@ -149,6 +219,77 @@ config_file_new (struct t_weechat_plugin *plugin, const char *name, } /* + * Searches for position of section in configuration file (to keep sections + * sorted by name). + */ + +struct t_config_section * +config_file_section_find_pos (struct t_config_file *config_file, + const char *name) +{ + struct t_config_section *ptr_section; + + if (config_file && name) + { + for (ptr_section = config_file->sections; ptr_section; + ptr_section = ptr_section->next_section) + { + if (string_strcasecmp (name, ptr_section->name) < 0) + return ptr_section; + } + } + + /* position not found (we will add to the end of list) */ + return NULL; +} + +/* + * Inserts a section in configuration file (keeping sections sorted by name). + */ + +void +config_file_section_insert_in_config (struct t_config_section *section) +{ + struct t_config_section *pos_section; + + if (!section || !section->config_file) + return; + + if (section->config_file->sections) + { + pos_section = config_file_section_find_pos (section->config_file, + section->name); + if (pos_section) + { + /* insert section into the list (before section found) */ + section->prev_section = pos_section->prev_section; + section->next_section = pos_section; + if (pos_section->prev_section) + (pos_section->prev_section)->next_section = section; + else + (section->config_file)->sections = section; + pos_section->prev_section = section; + } + else + { + /* add section to end of sections */ + section->prev_section = (section->config_file)->last_section; + section->next_section = NULL; + (section->config_file)->last_section->next_section = section; + (section->config_file)->last_section = section; + } + } + else + { + /* first section of file */ + section->prev_section = NULL; + section->next_section = NULL; + (section->config_file)->sections = section; + (section->config_file)->last_section = section; + } +} + +/* * Creates a new section in a configuration file. * * Returns pointer to new section, NULL if error. @@ -1711,13 +1852,12 @@ config_file_option_set_with_string (const char *option_name, const char *value) int config_file_option_boolean (struct t_config_option *option) { - if (!option) - return 0; - - if (option->type == CONFIG_OPTION_TYPE_BOOLEAN) + if (option && option->value + && (option->type == CONFIG_OPTION_TYPE_BOOLEAN)) + { return CONFIG_BOOLEAN(option); - else - return 0; + } + return 0; } /* @@ -1729,13 +1869,12 @@ config_file_option_boolean (struct t_config_option *option) int config_file_option_boolean_default (struct t_config_option *option) { - if (!option) - return 0; - - if (option->type == CONFIG_OPTION_TYPE_BOOLEAN) + if (option && option->default_value + && (option->type == CONFIG_OPTION_TYPE_BOOLEAN)) + { return CONFIG_BOOLEAN_DEFAULT(option); - else - return 0; + } + return 0; } /* @@ -1745,23 +1884,23 @@ config_file_option_boolean_default (struct t_config_option *option) int config_file_option_integer (struct t_config_option *option) { - if (!option) - return 0; - - switch (option->type) + if (option && option->value) { - case CONFIG_OPTION_TYPE_BOOLEAN: - if (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) - return 1; - else + switch (option->type) + { + case CONFIG_OPTION_TYPE_BOOLEAN: + if (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) + return 1; + else + return 0; + case CONFIG_OPTION_TYPE_INTEGER: + case CONFIG_OPTION_TYPE_COLOR: + return CONFIG_INTEGER(option); + case CONFIG_OPTION_TYPE_STRING: return 0; - case CONFIG_OPTION_TYPE_INTEGER: - case CONFIG_OPTION_TYPE_COLOR: - return CONFIG_INTEGER(option); - case CONFIG_OPTION_TYPE_STRING: - return 0; - case CONFIG_NUM_OPTION_TYPES: - break; + case CONFIG_NUM_OPTION_TYPES: + break; + } } return 0; } @@ -1773,23 +1912,23 @@ config_file_option_integer (struct t_config_option *option) int config_file_option_integer_default (struct t_config_option *option) { - if (!option) - return 0; - - switch (option->type) + if (option && option->default_value) { - case CONFIG_OPTION_TYPE_BOOLEAN: - if (CONFIG_BOOLEAN_DEFAULT(option) == CONFIG_BOOLEAN_TRUE) - return 1; - else + switch (option->type) + { + case CONFIG_OPTION_TYPE_BOOLEAN: + if (CONFIG_BOOLEAN_DEFAULT(option) == CONFIG_BOOLEAN_TRUE) + return 1; + else + return 0; + case CONFIG_OPTION_TYPE_INTEGER: + case CONFIG_OPTION_TYPE_COLOR: + return CONFIG_INTEGER_DEFAULT(option); + case CONFIG_OPTION_TYPE_STRING: return 0; - case CONFIG_OPTION_TYPE_INTEGER: - case CONFIG_OPTION_TYPE_COLOR: - return CONFIG_INTEGER_DEFAULT(option); - case CONFIG_OPTION_TYPE_STRING: - return 0; - case CONFIG_NUM_OPTION_TYPES: - break; + case CONFIG_NUM_OPTION_TYPES: + break; + } } return 0; } @@ -1801,26 +1940,26 @@ config_file_option_integer_default (struct t_config_option *option) const char * config_file_option_string (struct t_config_option *option) { - if (!option) - return NULL; - - switch (option->type) + if (option && option->value) { - case CONFIG_OPTION_TYPE_BOOLEAN: - if (CONFIG_BOOLEAN(option)) - return config_boolean_true[0]; - else - return config_boolean_false[0]; - case CONFIG_OPTION_TYPE_INTEGER: - if (option->string_values) - return option->string_values[CONFIG_INTEGER(option)]; - return NULL; - case CONFIG_OPTION_TYPE_STRING: - return CONFIG_STRING(option); - case CONFIG_OPTION_TYPE_COLOR: - return gui_color_get_name (CONFIG_COLOR(option)); - case CONFIG_NUM_OPTION_TYPES: - return NULL; + switch (option->type) + { + case CONFIG_OPTION_TYPE_BOOLEAN: + if (CONFIG_BOOLEAN(option)) + return config_boolean_true[0]; + else + return config_boolean_false[0]; + case CONFIG_OPTION_TYPE_INTEGER: + if (option->string_values) + return option->string_values[CONFIG_INTEGER(option)]; + return NULL; + case CONFIG_OPTION_TYPE_STRING: + return CONFIG_STRING(option); + case CONFIG_OPTION_TYPE_COLOR: + return gui_color_get_name (CONFIG_COLOR(option)); + case CONFIG_NUM_OPTION_TYPES: + return NULL; + } } return NULL; } @@ -1832,26 +1971,26 @@ config_file_option_string (struct t_config_option *option) const char * config_file_option_string_default (struct t_config_option *option) { - if (!option) - return NULL; - - switch (option->type) + if (option && option->default_value) { - case CONFIG_OPTION_TYPE_BOOLEAN: - if (CONFIG_BOOLEAN_DEFAULT(option)) - return config_boolean_true[0]; - else - return config_boolean_false[0]; - case CONFIG_OPTION_TYPE_INTEGER: - if (option->string_values) - return option->string_values[CONFIG_INTEGER_DEFAULT(option)]; - return NULL; - case CONFIG_OPTION_TYPE_STRING: - return CONFIG_STRING_DEFAULT(option); - case CONFIG_OPTION_TYPE_COLOR: - return gui_color_get_name (CONFIG_COLOR_DEFAULT(option)); - case CONFIG_NUM_OPTION_TYPES: - return NULL; + switch (option->type) + { + case CONFIG_OPTION_TYPE_BOOLEAN: + if (CONFIG_BOOLEAN_DEFAULT(option)) + return config_boolean_true[0]; + else + return config_boolean_false[0]; + case CONFIG_OPTION_TYPE_INTEGER: + if (option->string_values) + return option->string_values[CONFIG_INTEGER_DEFAULT(option)]; + return NULL; + case CONFIG_OPTION_TYPE_STRING: + return CONFIG_STRING_DEFAULT(option); + case CONFIG_OPTION_TYPE_COLOR: + return gui_color_get_name (CONFIG_COLOR_DEFAULT(option)); + case CONFIG_NUM_OPTION_TYPES: + return NULL; + } } return NULL; } @@ -1863,10 +2002,12 @@ config_file_option_string_default (struct t_config_option *option) const char * config_file_option_color (struct t_config_option *option) { - if (!option) - return NULL; - - return gui_color_get_name (CONFIG_COLOR(option)); + if (option && option->value + && (option->type == CONFIG_OPTION_TYPE_COLOR)) + { + return gui_color_get_name (CONFIG_COLOR(option)); + } + return NULL; } /* @@ -1876,10 +2017,12 @@ config_file_option_color (struct t_config_option *option) const char * config_file_option_color_default (struct t_config_option *option) { - if (!option) - return NULL; - - return gui_color_get_name (CONFIG_COLOR_DEFAULT(option)); + if (option && option->default_value + && (option->type == CONFIG_OPTION_TYPE_COLOR)) + { + return gui_color_get_name (CONFIG_COLOR_DEFAULT(option)); + } + return NULL; } /* diff --git a/src/core/wee-config.c b/src/core/wee-config.c index eb02347bb..cb65ae312 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -103,6 +103,7 @@ struct t_config_option *config_look_color_nick_offline; struct t_config_option *config_look_color_pairs_auto_reset; struct t_config_option *config_look_color_real_white; struct t_config_option *config_look_command_chars; +struct t_config_option *config_look_command_incomplete; struct t_config_option *config_look_confirm_quit; struct t_config_option *config_look_day_change; struct t_config_option *config_look_day_change_message_1date; @@ -134,6 +135,7 @@ struct t_config_option *config_look_input_undo_max; struct t_config_option *config_look_item_time_format; struct t_config_option *config_look_item_buffer_filter; struct t_config_option *config_look_item_buffer_zoom; +struct t_config_option *config_look_item_mouse_status; struct t_config_option *config_look_jump_current_to_previous_buffer; struct t_config_option *config_look_jump_previous_buffer_when_closing; struct t_config_option *config_look_jump_smart_back_to_buffer; @@ -228,6 +230,7 @@ struct t_config_option *config_color_status_data_msg; struct t_config_option *config_color_status_data_other; struct t_config_option *config_color_status_data_private; struct t_config_option *config_color_status_filter; +struct t_config_option *config_color_status_mouse; struct t_config_option *config_color_status_name; struct t_config_option *config_color_status_name_ssl; struct t_config_option *config_color_status_nicklist_count; @@ -241,6 +244,7 @@ struct t_config_option *config_color_nicklist_offline; /* config, completion section */ struct t_config_option *config_completion_base_word_until_cursor; +struct t_config_option *config_completion_command_inline; struct t_config_option *config_completion_default_template; struct t_config_option *config_completion_nick_add_space; struct t_config_option *config_completion_nick_completer; @@ -2219,6 +2223,12 @@ config_weechat_init_options () "input must start with one of these chars; the slash (\"/\") is " "always considered as command prefix (example: \".$\")"), NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_command_incomplete = config_file_new_option ( + weechat_config_file, ptr_section, + "command_incomplete", "boolean", + N_("if set, incomplete and unambiguous commands are allowed, for " + "example /he for /help"), + NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_look_confirm_quit = config_file_new_option ( weechat_config_file, ptr_section, "confirm_quit", "boolean", @@ -2430,6 +2440,12 @@ config_weechat_init_options () N_("string used to show zoom on merged buffer " "(bar item \"buffer_zoom\")"), NULL, 0, 0, "!", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + config_look_item_mouse_status = config_file_new_option ( + weechat_config_file, ptr_section, + "item_mouse_status", "string", + N_("string used to show if mouse is enabled " + "(bar item \"mouse_status\")"), + NULL, 0, 0, "M", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_jump_current_to_previous_buffer = config_file_new_option ( weechat_config_file, ptr_section, "jump_current_to_previous_buffer", "boolean", @@ -2836,19 +2852,23 @@ config_weechat_init_options () config_color_chat_nick_offline = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_offline", "color", - N_("text color for offline nick (not in nicklist any more)"), + N_("text color for offline nick (not in nicklist any more); this " + "color is used only if option weechat.look.color_nick_offline is " + "enabled"), NULL, GUI_COLOR_CHAT_NICK_OFFLINE, 0, "default", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_offline_highlight = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_offline_highlight", "color", - N_("text color for offline nick with highlight"), + N_("text color for offline nick with highlight; this color is used " + "only if option weechat.look.color_nick_offline is enabled"), NULL, -1, 0, "default", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_offline_highlight_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_offline_highlight_bg", "color", - N_("background color for offline nick with highlight"), + N_("background color for offline nick with highlight; this color is " + "used only if option weechat.look.color_nick_offline is enabled"), NULL, -1, 0, "blue", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_other = config_file_new_option ( @@ -3093,6 +3113,12 @@ config_weechat_init_options () N_("text color for filter indicator in status bar"), NULL, -1, 0, "green", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL); + config_color_status_mouse = config_file_new_option ( + weechat_config_file, ptr_section, + "status_mouse", "color", + N_("text color for mouse indicator in status bar"), + NULL, -1, 0, "green", NULL, 0, + NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_name = config_file_new_option ( weechat_config_file, ptr_section, "status_name", "color", @@ -3167,6 +3193,15 @@ config_weechat_init_options () N_("if enabled, the base word to complete ends at char before cursor; " "otherwise the base word ends at first space after cursor"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_command_inline = config_file_new_option ( + weechat_config_file, ptr_section, + "command_inline", "boolean", + N_("if enabled, the commands inside command line are completed (the " + "command at beginning of line has higher priority and is used " + "first); note: when this option is enabled, there is no more " + "automatic completion of paths beginning with '/' (outside " + "commands arguments)"), + NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_default_template = config_file_new_option ( weechat_config_file, ptr_section, "default_template", "string", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index 3ec2b72b1..862490415 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -141,6 +141,7 @@ extern struct t_config_option *config_look_color_nick_offline; extern struct t_config_option *config_look_color_pairs_auto_reset; extern struct t_config_option *config_look_color_real_white; extern struct t_config_option *config_look_command_chars; +extern struct t_config_option *config_look_command_incomplete; extern struct t_config_option *config_look_confirm_quit; extern struct t_config_option *config_look_day_change; extern struct t_config_option *config_look_day_change_message_1date; @@ -171,6 +172,7 @@ extern struct t_config_option *config_look_input_undo_max; extern struct t_config_option *config_look_item_time_format; extern struct t_config_option *config_look_item_buffer_filter; extern struct t_config_option *config_look_item_buffer_zoom; +extern struct t_config_option *config_look_item_mouse_status; extern struct t_config_option *config_look_jump_current_to_previous_buffer; extern struct t_config_option *config_look_jump_previous_buffer_when_closing; extern struct t_config_option *config_look_jump_smart_back_to_buffer; @@ -263,6 +265,7 @@ extern struct t_config_option *config_color_status_data_msg; extern struct t_config_option *config_color_status_data_other; extern struct t_config_option *config_color_status_data_private; extern struct t_config_option *config_color_status_filter; +extern struct t_config_option *config_color_status_mouse; extern struct t_config_option *config_color_status_name; extern struct t_config_option *config_color_status_name_ssl; extern struct t_config_option *config_color_status_nicklist_count; @@ -274,6 +277,7 @@ extern struct t_config_option *config_color_nicklist_group; extern struct t_config_option *config_color_nicklist_offline; extern struct t_config_option *config_completion_base_word_until_cursor; +extern struct t_config_option *config_completion_command_inline; extern struct t_config_option *config_completion_default_template; extern struct t_config_option *config_completion_nick_add_space; extern struct t_config_option *config_completion_nick_completer; diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index c8c77799a..7aa9764ec 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -29,6 +29,7 @@ #endif #include <string.h> #include <time.h> +#include <sys/time.h> #include <gcrypt.h> #include <curl/curl.h> #include <zlib.h> @@ -48,6 +49,7 @@ #include "wee-log.h" #include "wee-proxy.h" #include "wee-string.h" +#include "wee-util.h" #include "../gui/gui-bar.h" #include "../gui/gui-bar-item.h" #include "../gui/gui-buffer.h" @@ -63,6 +65,9 @@ int debug_dump_active = 0; +char *debug_time_name = NULL; +struct timeval debug_timeval_start = { 0, 0 }; + /* * Writes dump of data to WeeChat log file. @@ -578,7 +583,62 @@ debug_directories () } /* - * Hooks signals for debug. + * Starts time measure. + */ + +void +debug_time_start (const char *name) +{ + if (debug_time_name) + { + free (debug_time_name); + debug_time_name = NULL; + } + if (name) + debug_time_name = strdup (name); + + gettimeofday (&debug_timeval_start, NULL); +} + +/* + * Ends time measure and display elapsed time. + * + * If display is 1, the message is displayed in core buffer, otherwise it's + * written in log file. + */ + +void +debug_time_end (int display) +{ + struct timeval debug_timeval_end; + long long diff, diff_hour, diff_min, diff_sec, diff_usec; + + gettimeofday (&debug_timeval_end, NULL); + diff = util_timeval_diff (&debug_timeval_start, + &debug_timeval_end); + + diff_usec = diff % 1000000; + diff_sec = (diff / 1000000) % 60; + diff_min = ((diff / 1000000) / 60) % 60; + diff_hour = (diff / 1000000) / 3600; + + if (display) + { + gui_chat_printf (NULL, + "debug: time[%s] -> %lld:%02lld:%02lld.%06d", + (debug_time_name) ? debug_time_name : "?", + diff_hour, diff_min, diff_sec, diff_usec); + } + else + { + log_printf ("debug: time[%s] -> %lld:%02lld:%02lld.%06d", + (debug_time_name) ? debug_time_name : "?", + diff_hour, diff_min, diff_sec, diff_usec); + } +} + +/* + * Initializes debug. */ void @@ -592,3 +652,17 @@ debug_init () hook_signal (NULL, "2000|debug_dump", &debug_dump_cb, NULL); hook_signal (NULL, "2000|debug_libs", &debug_libs_cb, NULL); } + +/* + * Ends debug. + */ + +void +debug_end () +{ + if (debug_time_name) + { + free (debug_time_name); + debug_time_name = NULL; + } +} diff --git a/src/core/wee-debug.h b/src/core/wee-debug.h index 268fbb120..d3b52dcb5 100644 --- a/src/core/wee-debug.h +++ b/src/core/wee-debug.h @@ -29,6 +29,9 @@ extern void debug_hdata (); extern void debug_hooks (); extern void debug_infolists (); extern void debug_directories (); +extern void debug_time_start (const char *name); +extern void debug_time_end (int display); extern void debug_init (); +extern void debug_end (); #endif /* WEECHAT_DEBUG_H */ diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index cdee2ec79..2bbd0a15c 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -35,6 +35,7 @@ #include "wee-hook.h" #include "wee-secure.h" #include "wee-string.h" +#include "wee-utf8.h" #include "../gui/gui-buffer.h" #include "../gui/gui-color.h" #include "../gui/gui-window.h" @@ -219,11 +220,15 @@ end: /* * Replaces variables, which can be, by order of priority: - * 1. an extra variable (from hashtable "extra_vars") - * 2. a color (format: color:xxx) - * 3. an option (format: file.section.option) - * 4. a buffer local variable - * 5. a hdata name/variable + * 1. an extra variable from hashtable "extra_vars" + * 2. a string with escaped chars (format: esc:xxx or \xxx) + * 3. a string with chars to hide (format: hide:char,string) + * 4. a regex group captured (format: re:N (0.99) or re:+) + * 5. a color (format: color:xxx) + * 6. an info (format: info:name,arguments) + * 7. an option (format: file.section.option) + * 8. a buffer local variable + * 9. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2) * * Examples: * option: ${weechat.look.scroll_amount} @@ -235,18 +240,22 @@ char * eval_replace_vars_cb (void *data, const char *text) { struct t_hashtable *pointers, *extra_vars; + struct t_eval_regex *eval_regex; struct t_config_option *ptr_option; struct t_gui_buffer *ptr_buffer; char str_value[64], *value, *pos, *pos1, *pos2, *hdata_name, *list_name; - char *tmp, *info_name; - const char *ptr_value, *ptr_arguments; + char *tmp, *info_name, *hide_char, *hidden_string, *error; + const char *ptr_value, *ptr_arguments, *ptr_string; struct t_hdata *hdata; void *pointer; + int i, length_hide_char, length, index; + long number; pointers = (struct t_hashtable *)(((void **)data)[0]); extra_vars = (struct t_hashtable *)(((void **)data)[1]); + eval_regex = (struct t_eval_regex *)(((void **)data)[2]); - /* 1. look for var in hashtable "extra_vars" */ + /* 1. variable in hashtable "extra_vars" */ if (extra_vars) { ptr_value = hashtable_get (extra_vars, text); @@ -260,14 +269,67 @@ eval_replace_vars_cb (void *data, const char *text) if ((text[0] == '\\') && text[1] && (text[1] != '\\')) return string_convert_escaped_chars (text); - /* 3. look for a color */ + /* 3. hide chars: replace all chars by a given char/string */ + if (strncmp (text, "hide:", 5) == 0) + { + hidden_string = NULL; + ptr_string = strchr (text + 5, + (text[5] == ',') ? ';' : ','); + if (!ptr_string) + return strdup (""); + hide_char = string_strndup (text + 5, ptr_string - text - 5); + if (hide_char) + { + length_hide_char = strlen (hide_char); + length = utf8_strlen (ptr_string + 1); + hidden_string = malloc ((length * length_hide_char) + 1); + if (hidden_string) + { + index = 0; + for (i = 0; i < length; i++) + { + memcpy (hidden_string + index, hide_char, + length_hide_char); + index += length_hide_char; + } + hidden_string[length * length_hide_char] = '\0'; + } + free (hide_char); + } + return (hidden_string) ? hidden_string : strdup (""); + } + + /* 4. regex group captured */ + if (strncmp (text, "re:", 3) == 0) + { + if (eval_regex && eval_regex->result) + { + if (strcmp (text + 3, "+") == 0) + number = eval_regex->last_match; + else + { + number = strtol (text + 3, &error, 10); + if (!error || error[0]) + number = -1; + } + if ((number >= 0) && (number <= eval_regex->last_match)) + { + return string_strndup ( + eval_regex->result + eval_regex->match[number].rm_so, + eval_regex->match[number].rm_eo - eval_regex->match[number].rm_so); + } + } + return strdup (""); + } + + /* 5. color code */ if (strncmp (text, "color:", 6) == 0) { ptr_value = gui_color_get_custom (text + 6); return strdup ((ptr_value) ? ptr_value : ""); } - /* 4. look for an info */ + /* 6. info */ if (strncmp (text, "info:", 5) == 0) { ptr_value = NULL; @@ -287,7 +349,7 @@ eval_replace_vars_cb (void *data, const char *text) return strdup ((ptr_value) ? ptr_value : ""); } - /* 5. look for name of option: if found, return this value */ + /* 7. option: if found, return this value */ if (strncmp (text, "sec.data.", 9) == 0) { ptr_value = hashtable_get (secure_hashtable_data, text + 9); @@ -320,7 +382,7 @@ eval_replace_vars_cb (void *data, const char *text) } } - /* 6. look for local variable in buffer */ + /* 8. local variable in buffer */ ptr_buffer = hashtable_get (pointers, "buffer"); if (ptr_buffer) { @@ -329,7 +391,7 @@ eval_replace_vars_cb (void *data, const char *text) return strdup (ptr_value); } - /* 7. look for hdata */ + /* 9. hdata */ value = NULL; hdata_name = NULL; list_name = NULL; @@ -393,12 +455,14 @@ end: char * eval_replace_vars (const char *expr, struct t_hashtable *pointers, struct t_hashtable *extra_vars, - const char *prefix, const char *suffix) + const char *prefix, const char *suffix, + struct t_eval_regex *eval_regex) { - void *ptr[2]; + void *ptr[3]; ptr[0] = pointers; ptr[1] = extra_vars; + ptr[2] = eval_regex; return string_replace_with_callback (expr, prefix, suffix, &eval_replace_vars_cb, ptr, NULL); @@ -680,10 +744,12 @@ eval_expression_condition (const char *expr, /* for regex: just replace vars in both expressions */ tmp_value = eval_replace_vars (sub_expr, pointers, extra_vars, - prefix, suffix); + prefix, suffix, + NULL); tmp_value2 = eval_replace_vars (pos, pointers, extra_vars, - prefix, suffix); + prefix, suffix, + NULL); } else { @@ -767,7 +833,8 @@ eval_expression_condition (const char *expr, * at this point, there is no more logical operator neither comparison, * so we just replace variables in string and return the result */ - value = eval_replace_vars (expr2, pointers, extra_vars, prefix, suffix); + value = eval_replace_vars (expr2, pointers, extra_vars, prefix, suffix, + NULL); end: if (expr2) @@ -777,6 +844,125 @@ end: } /* + * Replaces text in a string using a regular expression and replacement text. + * + * The argument "regex" is a pointer to a regex compiled with WeeChat function + * string_regcomp (or function regcomp). + * + * The argument "replace" is evaluated and can contain any valid expression, + * and these ones: + * ${re:0} .. ${re:99} match 0 to 99 (0 is whole match, 1 .. 99 are groups + * captured) + * ${re:+} the last match (with highest number) + * + * Examples: + * + * string | regex | replace | result + * ----------+---------------+----------------------------+------------- + * test foo | test | Z | Z foo + * test foo | ^(test +)(.*) | ${re:2} | foo + * test foo | ^(test +)(.*) | ${re:1}/ ${hide:*,${re:2}} | test / *** + * test foo | ^(test +)(.*) | ${hide:%,${re:+}} | %%% + * + * Note: result must be freed after use. + */ + +char * +eval_replace_regex (const char *string, regex_t *regex, const char *replace, + struct t_hashtable *pointers, + struct t_hashtable *extra_vars, + const char *prefix, const char *suffix) +{ + char *result, *result2, *str_replace; + int length, length_replace, start_offset, i, rc, end; + struct t_eval_regex eval_regex; + + if (!string || !regex || !replace) + return NULL; + + length = strlen (string) + 1; + result = malloc (length); + if (!result) + return NULL; + snprintf (result, length, "%s", string); + + start_offset = 0; + while (result && result[start_offset]) + { + for (i = 0; i < 100; i++) + { + eval_regex.match[i].rm_so = -1; + } + + rc = regexec (regex, result + start_offset, 100, eval_regex.match, 0); + /* + * no match found: exit the loop (if rm_eo == 0, it is an empty match + * at beginning of string: we consider there is no match, to prevent an + * infinite loop) + */ + if ((rc != 0) + || (eval_regex.match[0].rm_so < 0) + || (eval_regex.match[0].rm_eo <= 0)) + { + break; + } + + /* adjust the start/end offsets */ + eval_regex.last_match = 0; + for (i = 0; i < 100; i++) + { + if (eval_regex.match[i].rm_so >= 0) + { + eval_regex.last_match = i; + eval_regex.match[i].rm_so += start_offset; + eval_regex.match[i].rm_eo += start_offset; + } + } + + /* check if the regex matched the end of string */ + end = !result[eval_regex.match[0].rm_eo]; + + eval_regex.result = result; + + str_replace = eval_replace_vars (replace, pointers, extra_vars, + prefix, suffix, &eval_regex); + + length_replace = (str_replace) ? strlen (str_replace) : 0; + + length = eval_regex.match[0].rm_so + length_replace + + strlen (result + eval_regex.match[0].rm_eo) + 1; + result2 = malloc (length); + if (!result2) + { + free (result); + return NULL; + } + result2[0] = '\0'; + if (eval_regex.match[0].rm_so > 0) + { + memcpy (result2, result, eval_regex.match[0].rm_so); + result2[eval_regex.match[0].rm_so] = '\0'; + } + if (str_replace) + strcat (result2, str_replace); + strcat (result2, result + eval_regex.match[0].rm_eo); + + free (result); + result = result2; + + if (str_replace) + free (str_replace); + + if (end) + break; + + start_offset = eval_regex.match[0].rm_so + length_replace; + } + + return result; +} + +/* * Evaluates an expression. * * The hashtable "pointers" must have string for keys, pointer for values. @@ -821,23 +1007,33 @@ char * eval_expression (const char *expr, struct t_hashtable *pointers, struct t_hashtable *extra_vars, struct t_hashtable *options) { - int condition, rc, pointers_allocated; + int condition, rc, pointers_allocated, regex_allocated; char *value; - const char *prefix, *suffix, *default_prefix = "${", *default_suffix = "}"; - const char *ptr_value; + const char *prefix, *suffix; + const char *default_prefix = EVAL_DEFAULT_PREFIX; + const char *default_suffix = EVAL_DEFAULT_SUFFIX; + const char *ptr_value, *regex_replace; struct t_gui_window *window; + regex_t *regex; if (!expr) return NULL; condition = 0; pointers_allocated = 0; + regex_allocated = 0; prefix = default_prefix; suffix = default_suffix; + regex = NULL; + regex_replace = NULL; - /* create hashtable pointers if it's NULL */ - if (!pointers) + if (pointers) { + regex = (regex_t *)hashtable_get (pointers, "regex"); + } + else + { + /* create hashtable pointers if it's NULL */ pointers = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, @@ -881,6 +1077,30 @@ eval_expression (const char *expr, struct t_hashtable *pointers, ptr_value = hashtable_get (options, "suffix"); if (ptr_value && ptr_value[0]) suffix = ptr_value; + + /* check for regex */ + ptr_value = hashtable_get (options, "regex"); + if (ptr_value && ptr_value[0]) + { + regex = malloc (sizeof (*regex)); + if (string_regcomp (regex, ptr_value, + REG_EXTENDED | REG_ICASE) == 0) + { + regex_allocated = 1; + } + else + { + free (regex); + regex = NULL; + } + } + + /* check for regex replacement (evaluated later) */ + ptr_value = hashtable_get (options, "regex_replace"); + if (ptr_value && ptr_value[0]) + { + regex_replace = ptr_value; + } } /* evaluate expression */ @@ -896,12 +1116,28 @@ eval_expression (const char *expr, struct t_hashtable *pointers, } else { - /* only replace variables in expression */ - value = eval_replace_vars (expr, pointers, extra_vars, prefix, suffix); + if (regex && regex_replace) + { + /* replace with regex */ + value = eval_replace_regex (expr, regex, regex_replace, + pointers, extra_vars, + prefix, suffix); + } + else + { + /* only replace variables in expression */ + value = eval_replace_vars (expr, pointers, extra_vars, + prefix, suffix, NULL); + } } if (pointers_allocated) hashtable_free (pointers); + if (regex && regex_allocated) + { + regfree (regex); + free (regex); + } return value; } diff --git a/src/core/wee-eval.h b/src/core/wee-eval.h index 5f0ae7202..4e4af7f17 100644 --- a/src/core/wee-eval.h +++ b/src/core/wee-eval.h @@ -20,8 +20,13 @@ #ifndef WEECHAT_EVAL_H #define WEECHAT_EVAL_H 1 -#define EVAL_STR_FALSE "0" -#define EVAL_STR_TRUE "1" +#include <regex.h> + +#define EVAL_STR_FALSE "0" +#define EVAL_STR_TRUE "1" + +#define EVAL_DEFAULT_PREFIX "${" +#define EVAL_DEFAULT_SUFFIX "}" struct t_hashtable; @@ -47,6 +52,13 @@ enum t_eval_comparison EVAL_NUM_COMPARISONS, }; +struct t_eval_regex +{ + const char *result; + regmatch_t match[100]; + int last_match; +}; + extern int eval_is_true (const char *value); extern char *eval_expression (const char *expr, struct t_hashtable *pointers, diff --git a/src/core/wee-hdata.c b/src/core/wee-hdata.c index a96956ebb..cd42d7203 100644 --- a/src/core/wee-hdata.c +++ b/src/core/wee-hdata.c @@ -562,11 +562,11 @@ hdata_move (struct t_hdata *hdata, void *pointer, int count) for (i = 0; i < abs_count; i++) { pointer = hdata_pointer (hdata, pointer, ptr_var); - if (pointer) - return pointer; + if (!pointer) + break; } - return NULL; + return pointer; } /* diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index 60d212e0e..5e0f0e77a 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -38,6 +38,7 @@ #include "weechat.h" #include "wee-hook.h" +#include "wee-config.h" #include "wee-hashtable.h" #include "wee-hdata.h" #include "wee-infolist.h" @@ -654,12 +655,14 @@ hook_command (struct t_weechat_plugin *plugin, const char *command, * Executes a command hook. * * Returns: - * 0: command executed and failed - * 1: command executed successfully - * -1: command not found - * -2: command is ambiguous (same command exists for another plugin, and we - * don't know which one to run) - * -3: command is already running + * HOOK_COMMAND_EXEC_OK: command executed successfully + * HOOK_COMMAND_EXEC_ERROR: command executed and failed + * HOOK_COMMAND_EXEC_NOT_FOUND: command not found + * HOOK_COMMAND_EXEC_AMBIGUOUS_PLUGINS: command is ambiguous (same command + * exists for another plugin, and we don't know which one to run) + * HOOK_COMMAND_EXEC_AMBIGUOUS_INCOMPLETE: command is ambiguous (incomplete + * command and multiple commands start with this name) + * HOOK_COMMAND_EXEC_RUNNING: command is already running */ int @@ -668,62 +671,79 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, { struct t_hook *ptr_hook, *next_hook; struct t_hook *hook_plugin, *hook_other_plugin, *hook_other_plugin2; + struct t_hook *hook_incomplete_command; char **argv, **argv_eol, *ptr_command_name; - int argc, rc, count_other_plugin; + int argc, rc, length_command_name, allow_incomplete_commands; + int count_other_plugin, count_incomplete_commands; if (!buffer || !string || !string[0]) - return -1; + return HOOK_COMMAND_EXEC_NOT_FOUND; if (hook_command_run_exec (buffer, string) == WEECHAT_RC_OK_EAT) - return 1; + return HOOK_COMMAND_EXEC_OK; argv = string_split (string, " ", 0, 0, &argc); if (argc == 0) { string_free_split (argv); - return -1; + return HOOK_COMMAND_EXEC_NOT_FOUND; } argv_eol = string_split (string, " ", 1, 0, NULL); ptr_command_name = utf8_next_char (argv[0]); + length_command_name = strlen (ptr_command_name); hook_exec_start (); hook_plugin = NULL; hook_other_plugin = NULL; hook_other_plugin2 = NULL; + hook_incomplete_command = NULL; count_other_plugin = 0; + allow_incomplete_commands = CONFIG_BOOLEAN(config_look_command_incomplete); + count_incomplete_commands = 0; ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; while (ptr_hook) { next_hook = ptr_hook->next_hook; - if (!ptr_hook->deleted - && (string_strcasecmp (ptr_command_name, - HOOK_COMMAND(ptr_hook, command)) == 0)) + if (!ptr_hook->deleted) { - if (ptr_hook->plugin == plugin) - { - if (!hook_plugin) - hook_plugin = ptr_hook; - } - else + if (string_strcasecmp (ptr_command_name, + HOOK_COMMAND(ptr_hook, command)) == 0) { - if (any_plugin) + if (ptr_hook->plugin == plugin) { - if (!hook_other_plugin) - hook_other_plugin = ptr_hook; - else if (!hook_other_plugin2) - hook_other_plugin2 = ptr_hook; - count_other_plugin++; + if (!hook_plugin) + hook_plugin = ptr_hook; } + else + { + if (any_plugin) + { + if (!hook_other_plugin) + hook_other_plugin = ptr_hook; + else if (!hook_other_plugin2) + hook_other_plugin2 = ptr_hook; + count_other_plugin++; + } + } + } + else if (allow_incomplete_commands + && (string_strncasecmp (ptr_command_name, + HOOK_COMMAND(ptr_hook, command), + length_command_name) == 0)) + { + hook_incomplete_command = ptr_hook; + count_incomplete_commands++; } } ptr_hook = next_hook; } - rc = -1; + rc = HOOK_COMMAND_EXEC_NOT_FOUND; + ptr_hook = NULL; if (hook_plugin || hook_other_plugin) { @@ -735,7 +755,7 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, * command was found for other plugins with the same priority * => we don't know which one to run! */ - rc = -2; + rc = HOOK_COMMAND_EXEC_AMBIGUOUS_PLUGINS; } else { @@ -758,24 +778,35 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, */ ptr_hook = (hook_plugin) ? hook_plugin : hook_other_plugin; } + } + } + else if (hook_incomplete_command) + { + if (count_incomplete_commands == 1) + ptr_hook = hook_incomplete_command; + else + rc = HOOK_COMMAND_EXEC_AMBIGUOUS_INCOMPLETE; + } - if (ptr_hook->running >= HOOK_COMMAND_MAX_CALLS) - { - /* loop in execution of command => do NOT execute again */ - rc = -3; - } + /* execute the command for the hook found */ + if (ptr_hook) + { + if (ptr_hook->running >= HOOK_COMMAND_MAX_CALLS) + { + /* loop in execution of command => do NOT execute again */ + rc = HOOK_COMMAND_EXEC_RUNNING; + } + else + { + /* execute the command! */ + ptr_hook->running++; + rc = (int) (HOOK_COMMAND(ptr_hook, callback)) + (ptr_hook->callback_data, buffer, argc, argv, argv_eol); + ptr_hook->running--; + if (rc == WEECHAT_RC_ERROR) + rc = HOOK_COMMAND_EXEC_ERROR; else - { - /* execute the command! */ - ptr_hook->running++; - rc = (int) (HOOK_COMMAND(ptr_hook, callback)) - (ptr_hook->callback_data, buffer, argc, argv, argv_eol); - ptr_hook->running--; - if (rc == WEECHAT_RC_ERROR) - rc = 0; - else - rc = 1; - } + rc = HOOK_COMMAND_EXEC_OK; } } @@ -953,7 +984,8 @@ hook_timer_init (struct t_hook *hook) HOOK_TIMER(hook, next_exec).tv_usec = HOOK_TIMER(hook, last_exec).tv_usec; /* add interval to next call date */ - util_timeval_add (&HOOK_TIMER(hook, next_exec), HOOK_TIMER(hook, interval)); + util_timeval_add (&HOOK_TIMER(hook, next_exec), + ((long long)HOOK_TIMER(hook, interval)) * 1000); } /* @@ -1148,8 +1180,9 @@ hook_timer_exec () HOOK_TIMER(ptr_hook, last_exec).tv_sec = tv_time.tv_sec; HOOK_TIMER(ptr_hook, last_exec).tv_usec = tv_time.tv_usec; - util_timeval_add (&HOOK_TIMER(ptr_hook, next_exec), - HOOK_TIMER(ptr_hook, interval)); + util_timeval_add ( + &HOOK_TIMER(ptr_hook, next_exec), + ((long long)HOOK_TIMER(ptr_hook, interval)) * 1000); if (HOOK_TIMER(ptr_hook, remaining_calls) > 0) { diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h index e033b6639..0e1778ad2 100644 --- a/src/core/wee-hook.h +++ b/src/core/wee-hook.h @@ -82,6 +82,14 @@ enum t_hook_type /* max calls that can be done for a command (recursive calls) */ #define HOOK_COMMAND_MAX_CALLS 5 +/* return code when a command is executed */ +#define HOOK_COMMAND_EXEC_OK 1 +#define HOOK_COMMAND_EXEC_ERROR 0 +#define HOOK_COMMAND_EXEC_NOT_FOUND -1 +#define HOOK_COMMAND_EXEC_AMBIGUOUS_PLUGINS -2 +#define HOOK_COMMAND_EXEC_AMBIGUOUS_INCOMPLETE -3 +#define HOOK_COMMAND_EXEC_RUNNING -4 + /* flags for fd hooks */ #define HOOK_FD_FLAG_READ 1 #define HOOK_FD_FLAG_WRITE 2 diff --git a/src/core/wee-input.c b/src/core/wee-input.c index ad4eb08b6..3c1a5bd29 100644 --- a/src/core/wee-input.c +++ b/src/core/wee-input.c @@ -100,35 +100,22 @@ input_exec_command (struct t_gui_buffer *buffer, /* execute command */ switch (hook_command_exec (buffer, any_plugin, plugin, command)) { - case 0: /* command hooked, KO */ + case HOOK_COMMAND_EXEC_OK: + /* command hooked, OK (executed) */ + break; + case HOOK_COMMAND_EXEC_ERROR: + /* command hooked, error */ gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, _("%sError with command \"%s\" (help on " "command: /help %s)"), gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], command, command_name + 1); break; - case 1: /* command hooked, OK (executed) */ - break; - case -2: /* command is ambiguous (exists for other plugins) */ - gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, - _("%sError: ambiguous command \"%s\": " - "it exists in many plugins and not in " - "\"%s\" plugin"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - command_name, - plugin_get_name (plugin)); - break; - case -3: /* command is running */ - gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, - _("%sError: too much calls to command " - "\"%s\" (looping)"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - command_name); - break; - default: /* no command hooked */ + case HOOK_COMMAND_EXEC_NOT_FOUND: /* - * if unknown commands are accepted by this buffer, just send - * input text as data to buffer, otherwise display error + * command not found: if unknown commands are accepted by this + * buffer, just send input text as data to buffer, + * otherwise display error */ if (buffer->input_get_unknown_commands) { @@ -143,6 +130,38 @@ input_exec_command (struct t_gui_buffer *buffer, command_name); } break; + case HOOK_COMMAND_EXEC_AMBIGUOUS_PLUGINS: + /* command is ambiguous (exists for other plugins) */ + gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, + _("%sError: ambiguous command \"%s\": " + "it exists in many plugins and not in " + "\"%s\" plugin"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + command_name, + plugin_get_name (plugin)); + break; + case HOOK_COMMAND_EXEC_AMBIGUOUS_INCOMPLETE: + /* + * command is ambiguous (incomplete command and multiple commands + * start with this name) + */ + gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, + _("%sError: incomplete command \"%s\" " + "and multiple commands start with " + "this name"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + command_name); + break; + case HOOK_COMMAND_EXEC_RUNNING: + /* command is running */ + gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER, + _("%sError: too many calls to command " + "\"%s\" (looping)"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + command_name); + break; + default: + break; } free (command); free (command_name); diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 6d9af0ede..860f2967f 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -1473,7 +1473,7 @@ string_replace_regex (const char *string, void *regex, const char *replace, * array[1] = "de" * array[2] = "fghi" * array[3] = NULL - * string_split ("abc de fghi", " ", 1, 0, NULL) + * string_split ("abc de fghi", " ", 1, 0, NULL) * ==> array[0] = "abc de fghi" * array[1] = "de fghi" * array[2] = "fghi" @@ -2256,6 +2256,10 @@ string_iconv_fprintf (FILE *file, const char *data, ...) int rc, num_written; rc = 0; + + if (!data) + return rc; + weechat_va_format (data); if (vbuffer) { diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index 5826399a5..6e07b6c65 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -898,7 +898,7 @@ void upgrade_weechat_end () { struct timeval tv_now; - long time_diff; + long long time_diff; /* remove .upgrade files */ util_exec_on_files (weechat_home, @@ -912,7 +912,7 @@ upgrade_weechat_end () gui_chat_printf (NULL, /* TRANSLATORS: %.02fs is a float number + "s" ("seconds") */ _("Upgrade done (%.02fs)"), - ((float)time_diff) / 1000); + ((float)time_diff) / 1000000); /* upgrading ended */ weechat_upgrading = 0; diff --git a/src/core/wee-util.c b/src/core/wee-util.c index 1223b0488..c709d4b25 100644 --- a/src/core/wee-util.c +++ b/src/core/wee-util.c @@ -254,13 +254,13 @@ util_timeval_cmp (struct timeval *tv1, struct timeval *tv2) /* * Calculates difference between two timeval structures. * - * Returns difference in milliseconds. + * Returns difference in microseconds. */ -long +long long util_timeval_diff (struct timeval *tv1, struct timeval *tv2) { - long diff_sec, diff_usec; + long long diff_sec, diff_usec; if (!tv1 || !tv2) return 0; @@ -273,23 +273,24 @@ util_timeval_diff (struct timeval *tv1, struct timeval *tv2) diff_usec += 1000000; diff_sec--; } - return ((diff_usec / 1000) + (diff_sec * 1000)); + + return (diff_sec * 1000000) + diff_usec; } /* - * Adds interval (in milliseconds) to a timeval structure. + * Adds interval (in microseconds) to a timeval structure. */ void -util_timeval_add (struct timeval *tv, long interval) +util_timeval_add (struct timeval *tv, long long interval) { - long usec; + long long usec; if (!tv) return; - tv->tv_sec += (interval / 1000); - usec = tv->tv_usec + ((interval % 1000) * 1000); + tv->tv_sec += (interval / 1000000); + usec = tv->tv_usec + (interval % 1000000); if (usec > 1000000) { tv->tv_usec = usec % 1000000; diff --git a/src/core/wee-util.h b/src/core/wee-util.h index 2471868a6..e0fb631eb 100644 --- a/src/core/wee-util.h +++ b/src/core/wee-util.h @@ -36,8 +36,8 @@ struct t_util_signal extern void util_setrlimit (); extern int util_timeval_cmp (struct timeval *tv1, struct timeval *tv2); -extern long util_timeval_diff (struct timeval *tv1, struct timeval *tv2); -extern void util_timeval_add (struct timeval *tv, long interval); +extern long long util_timeval_diff (struct timeval *tv1, struct timeval *tv2); +extern void util_timeval_add (struct timeval *tv, long long interval); extern char *util_get_time_string (const time_t *date); extern int util_signal_search (const char *name); extern void util_catch_signal (int signum, void (*handler)(int)); diff --git a/src/core/weechat.c b/src/core/weechat.c index 4ca51da53..a6b2a06d4 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -483,6 +483,8 @@ weechat_shutdown (int return_code, int crash) network_end (); + debug_end (); + if (crash) abort(); else if (return_code >= 0) diff --git a/src/gui/curses/CMakeLists.txt b/src/gui/curses/CMakeLists.txt index 57148d31b..23a977a46 100644 --- a/src/gui/curses/CMakeLists.txt +++ b/src/gui/curses/CMakeLists.txt @@ -81,7 +81,7 @@ add_executable(${EXECUTABLE} ${WEECHAT_CURSES_MAIN_SRC}) add_dependencies(${EXECUTABLE} weechat_gui_curses) -# Because of a linker bug, we have to link 2 times with libweechat_core.a +# Due to circular references, we must link two times with libweechat_core.a target_link_libraries(${EXECUTABLE} ${STATIC_LIBS} weechat_gui_curses ${EXTRA_LIBS} ${STATIC_LIBS}) install(TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) diff --git a/src/gui/curses/Makefile.am b/src/gui/curses/Makefile.am index b31073f39..18afc2fd3 100644 --- a/src/gui/curses/Makefile.am +++ b/src/gui/curses/Makefile.am @@ -33,8 +33,8 @@ lib_weechat_gui_curses_a_SOURCES = gui-curses-bar-window.c \ bin_PROGRAMS = weechat -# Because of a linker bug, we have to link 2 times with lib_weechat_core.a -# (and it must be 2 different path/names to be kept by linker) +# Due to circular references, we must link two times with libweechat_core.a +# (and with two different path/names to be kept by linker) weechat_LDADD = ./../../core/lib_weechat_core.a \ ../../plugins/lib_weechat_plugins.a \ ../lib_weechat_gui_common.a \ diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index df8841a9e..bdc14f25a 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -1896,6 +1896,8 @@ gui_chat_get_bare_line (struct t_gui_line *line) str_time[0] = '\0'; if (line->data->buffer->time_for_each_line && (line->data->date > 0) + && CONFIG_STRING(config_look_buffer_time_format) + && CONFIG_STRING(config_look_buffer_time_format)[0] && CONFIG_STRING(config_look_bare_display_time_format) && CONFIG_STRING(config_look_bare_display_time_format)[0]) { diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index 5421aa612..b0befb56f 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -1184,7 +1184,8 @@ gui_color_buffer_assign () { if (!gui_color_buffer) { - gui_color_buffer = gui_buffer_search_by_name (NULL, "color"); + gui_color_buffer = gui_buffer_search_by_name (NULL, + GUI_COLOR_BUFFER_NAME); if (gui_color_buffer) { gui_color_buffer->input_callback = &gui_color_buffer_input_cb; @@ -1202,13 +1203,13 @@ gui_color_buffer_open () { if (!gui_color_buffer) { - gui_color_buffer = gui_buffer_new (NULL, "color", + gui_color_buffer = gui_buffer_new (NULL, GUI_COLOR_BUFFER_NAME, &gui_color_buffer_input_cb, NULL, &gui_color_buffer_close_cb, NULL); if (gui_color_buffer) { if (!gui_color_buffer->short_name) - gui_color_buffer->short_name = strdup ("color"); + gui_color_buffer->short_name = strdup (GUI_COLOR_BUFFER_NAME); gui_buffer_set (gui_color_buffer, "type", "free"); gui_buffer_set (gui_color_buffer, "localvar_set_no_log", "1"); gui_buffer_set (gui_color_buffer, "key_bind_meta-c", "/color switch"); diff --git a/src/gui/curses/gui-curses-mouse.c b/src/gui/curses/gui-curses-mouse.c index 93d7fd125..c62c728a5 100644 --- a/src/gui/curses/gui-curses-mouse.c +++ b/src/gui/curses/gui-curses-mouse.c @@ -89,6 +89,9 @@ gui_mouse_enable () { gui_mouse_enabled = 1; fprintf (stderr, "\033[?1005h\033[?1000h\033[?1002h"); + + (void) hook_signal_send ("mouse_enabled", + WEECHAT_HOOK_SIGNAL_STRING, NULL); } /* @@ -100,6 +103,9 @@ gui_mouse_disable () { gui_mouse_enabled = 0; fprintf (stderr, "\033[?1002l\033[?1000l\033[?1005l"); + + (void) hook_signal_send ("mouse_disabled", + WEECHAT_HOOK_SIGNAL_STRING, NULL); } /* diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 593c7f31d..af0813e86 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -1224,7 +1224,7 @@ gui_window_switch_to_buffer (struct t_gui_window *window, gui_buffer_compute_num_displayed (); if (!weechat_upgrading && (old_buffer != buffer)) - gui_hotlist_remove_buffer (buffer); + gui_hotlist_remove_buffer (buffer, 0); gui_bar_window_remove_unused_bars (window); gui_bar_window_add_missing_bars (window); diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index 1fbeeaee2..ed78db4bc 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -29,6 +29,7 @@ #include <time.h> #include "../core/weechat.h" +#include "../core/wee-arraylist.h" #include "../core/wee-config.h" #include "../core/wee-hashtable.h" #include "../core/wee-hdata.h" @@ -52,6 +53,7 @@ #include "gui-line.h" #include "gui-nicklist.h" #include "gui-window.h" +#include "gui-mouse.h" struct t_gui_bar_item *gui_bar_items = NULL; /* first bar item */ @@ -61,7 +63,7 @@ char *gui_bar_item_names[GUI_BAR_NUM_ITEMS] = "buffer_count", "buffer_last_number", "buffer_plugin", "buffer_number", "buffer_name", "buffer_short_name", "buffer_modes", "buffer_filter", "buffer_zoom", "buffer_nicklist_count", "scroll", "hotlist", "completion", - "buffer_title", "buffer_nicklist", "window_number" + "buffer_title", "buffer_nicklist", "window_number", "mouse_status" }; char *gui_bar_items_default_for_bars[][2] = { { GUI_BAR_DEFAULT_NAME_INPUT, @@ -71,7 +73,7 @@ char *gui_bar_items_default_for_bars[][2] = { GUI_BAR_DEFAULT_NAME_STATUS, "[time],[buffer_last_number],[buffer_plugin],buffer_number+:+" "buffer_name+(buffer_modes)+{buffer_nicklist_count}+buffer_zoom+" - "buffer_filter,[lag],[hotlist],completion,scroll" }, + "buffer_filter,scroll,[lag],[hotlist],completion" }, { GUI_BAR_DEFAULT_NAME_NICKLIST, "buffer_nicklist" }, { NULL, @@ -1484,9 +1486,9 @@ gui_bar_item_default_completion (void *data, struct t_gui_bar_item *item, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { - int length; + int length, i; char *buf, str_number[64]; - struct t_gui_completion_partial *ptr_item; + struct t_gui_completion_word *ptr_completion_word; /* make C compiler happy */ (void) data; @@ -1495,37 +1497,39 @@ gui_bar_item_default_completion (void *data, struct t_gui_bar_item *item, (void) extra_info; if (!buffer || !buffer->completion - || !buffer->completion->partial_completion_list) + || (buffer->completion->partial_list->size == 0)) { return NULL; } length = 1; - for (ptr_item = buffer->completion->partial_completion_list; - ptr_item; ptr_item = ptr_item->next_item) + for (i = 0; i < buffer->completion->partial_list->size; i++) { - length += strlen (ptr_item->word) + 32; + ptr_completion_word = + (struct t_gui_completion_word *)(buffer->completion->partial_list->data[i]); + length += strlen (ptr_completion_word->word) + 32; } buf = malloc (length); if (buf) { buf[0] = '\0'; - for (ptr_item = buffer->completion->partial_completion_list; - ptr_item; ptr_item = ptr_item->next_item) + for (i = 0; i < buffer->completion->partial_list->size; i++) { + ptr_completion_word = + (struct t_gui_completion_word *)(buffer->completion->partial_list->data[i]); strcat (buf, GUI_COLOR_CUSTOM_BAR_FG); - strcat (buf, ptr_item->word); - if (ptr_item->count > 0) + strcat (buf, ptr_completion_word->word); + if (ptr_completion_word->count > 0) { strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM); strcat (buf, "("); snprintf (str_number, sizeof (str_number), - "%d", ptr_item->count); + "%d", ptr_completion_word->count); strcat (buf, str_number); strcat (buf, ")"); } - if (ptr_item->next_item) + if (i < buffer->completion->partial_list->size - 1) strcat (buf, " "); } } @@ -1723,6 +1727,35 @@ gui_bar_item_default_window_number (void *data, struct t_gui_bar_item *item, } /* + * Default item for mouse status. + */ + +char * +gui_bar_item_default_mouse_status (void *data, struct t_gui_bar_item *item, + struct t_gui_window *window, + struct t_gui_buffer *buffer, + struct t_hashtable *extra_info) +{ + char str_mouse[512]; + + /* make C compiler happy */ + (void) data; + (void) item; + (void) window; + (void) extra_info; + + if (!buffer || !gui_mouse_enabled) + return NULL; + + snprintf (str_mouse, sizeof (str_mouse), + "%s%s", + gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_mouse))), + CONFIG_STRING(config_look_item_mouse_status)); + + return strdup (str_mouse); +} + +/* * Focus on nicklist. */ @@ -2131,6 +2164,15 @@ gui_bar_item_init () gui_bar_item_names[GUI_BAR_ITEM_WINDOW_NUMBER]); gui_bar_item_hook_signal ("window_closed", gui_bar_item_names[GUI_BAR_ITEM_WINDOW_NUMBER]); + + /* mouse status */ + gui_bar_item_new (NULL, + gui_bar_item_names[GUI_BAR_ITEM_MOUSE_STATUS], + &gui_bar_item_default_mouse_status, NULL); + gui_bar_item_hook_signal ("mouse_enabled", + gui_bar_item_names[GUI_BAR_ITEM_MOUSE_STATUS]); + gui_bar_item_hook_signal ("mouse_disabled", + gui_bar_item_names[GUI_BAR_ITEM_MOUSE_STATUS]); } /* diff --git a/src/gui/gui-bar-item.h b/src/gui/gui-bar-item.h index 1ea670009..005a799c6 100644 --- a/src/gui/gui-bar-item.h +++ b/src/gui/gui-bar-item.h @@ -43,6 +43,7 @@ enum t_gui_bar_item_weechat GUI_BAR_ITEM_BUFFER_TITLE, GUI_BAR_ITEM_BUFFER_NICKLIST, GUI_BAR_ITEM_WINDOW_NUMBER, + GUI_BAR_ITEM_MOUSE_STATUS, /* number of bar items */ GUI_BAR_NUM_ITEMS, }; diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 4794fd12f..3185c432c 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1730,7 +1730,7 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property, if (error && !error[0]) { if (number < 0) - gui_hotlist_remove_buffer (buffer); + gui_hotlist_remove_buffer (buffer, 0); else (void) gui_hotlist_add (buffer, number, NULL); } @@ -2480,7 +2480,7 @@ gui_buffer_clear (struct t_gui_buffer *buffer) } } - gui_hotlist_remove_buffer (buffer); + gui_hotlist_remove_buffer (buffer, 0); gui_buffer_ask_chat_refresh (buffer, 2); @@ -2601,7 +2601,7 @@ gui_buffer_close (struct t_gui_buffer *buffer) } } - gui_hotlist_remove_buffer (buffer); + gui_hotlist_remove_buffer (buffer, 1); if (gui_hotlist_initial_buffer == buffer) gui_hotlist_initial_buffer = NULL; diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index 4a8ba2660..4920076e1 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -639,7 +639,7 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, const char *tags, const char *message, ...) { time_t date_printed; - int display_time, length, at_least_one_message_printed; + int display_time, length, at_least_one_message_printed, msg_discarded; char *pos, *pos_prefix, *pos_tab, *pos_end, *pos_lines; char *modifier_data, *new_msg, *ptr_msg, *lines_waiting; struct t_gui_line *ptr_line; @@ -693,6 +693,7 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, /* call modifier for message printed ("weechat_print") */ new_msg = NULL; + msg_discarded = 0; if (buffer) { length = strlen (gui_buffer_get_plugin_name (buffer)) + 1 + @@ -718,9 +719,10 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, * print anything */ free (new_msg); - goto end; + new_msg = NULL; + msg_discarded = 1; } - if (strcmp (message, new_msg) == 0) + else if (strcmp (message, new_msg) == 0) { /* no changes in new message */ free (new_msg); @@ -730,89 +732,92 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, } } - pos_prefix = NULL; - display_time = 1; - ptr_msg = (new_msg) ? new_msg : pos; - - /* space followed by tab => prefix ignored */ - if ((ptr_msg[0] == ' ') && (ptr_msg[1] == '\t')) - { - ptr_msg += 2; - } - else + if (!msg_discarded) { - /* if two first chars are tab, then do not display time */ - if ((ptr_msg[0] == '\t') && (ptr_msg[1] == '\t')) + pos_prefix = NULL; + display_time = 1; + ptr_msg = (new_msg) ? new_msg : pos; + + /* space followed by tab => prefix ignored */ + if ((ptr_msg[0] == ' ') && (ptr_msg[1] == '\t')) { - display_time = 0; ptr_msg += 2; } else { - /* if tab found, use prefix (before tab) */ - pos_tab = strchr (ptr_msg, '\t'); - if (pos_tab) + /* if two first chars are tab, then do not display time */ + if ((ptr_msg[0] == '\t') && (ptr_msg[1] == '\t')) { - pos_tab[0] = '\0'; - pos_prefix = ptr_msg; - ptr_msg = pos_tab + 1; + display_time = 0; + ptr_msg += 2; + } + else + { + /* if tab found, use prefix (before tab) */ + pos_tab = strchr (ptr_msg, '\t'); + if (pos_tab) + { + pos_tab[0] = '\0'; + pos_prefix = ptr_msg; + ptr_msg = pos_tab + 1; + } } } - } - if (gui_init_ok) - { - ptr_line = gui_line_add (buffer, (display_time) ? date : 0, - date_printed, tags, pos_prefix, ptr_msg); - if (ptr_line) - { - if (buffer && buffer->print_hooks_enabled) - hook_print_exec (buffer, ptr_line); - if (ptr_line->data->displayed) - at_least_one_message_printed = 1; - } - } - else - { - length = ((pos_prefix) ? strlen (pos_prefix) + 1 : 0) + - strlen (ptr_msg) + 1; - if (gui_chat_lines_waiting_buffer) + if (gui_init_ok) { - length += strlen (gui_chat_lines_waiting_buffer) + 1; - lines_waiting = realloc (gui_chat_lines_waiting_buffer, length); - if (lines_waiting) + ptr_line = gui_line_add (buffer, (display_time) ? date : 0, + date_printed, tags, pos_prefix, ptr_msg); + if (ptr_line) { - gui_chat_lines_waiting_buffer = lines_waiting; - } - else - { - free (gui_chat_lines_waiting_buffer); - gui_chat_lines_waiting_buffer = NULL; + if (buffer && buffer->print_hooks_enabled) + hook_print_exec (buffer, ptr_line); + if (ptr_line->data->displayed) + at_least_one_message_printed = 1; } } else { - gui_chat_lines_waiting_buffer = malloc (length); + length = ((pos_prefix) ? strlen (pos_prefix) + 1 : 0) + + strlen (ptr_msg) + 1; if (gui_chat_lines_waiting_buffer) - gui_chat_lines_waiting_buffer[0] = '\0'; - } - if (gui_chat_lines_waiting_buffer) - { - pos_lines = gui_chat_lines_waiting_buffer + - strlen (gui_chat_lines_waiting_buffer); - if (pos_lines > gui_chat_lines_waiting_buffer) { - pos_lines[0] = '\n'; - pos_lines++; + length += strlen (gui_chat_lines_waiting_buffer) + 1; + lines_waiting = realloc (gui_chat_lines_waiting_buffer, length); + if (lines_waiting) + { + gui_chat_lines_waiting_buffer = lines_waiting; + } + else + { + free (gui_chat_lines_waiting_buffer); + gui_chat_lines_waiting_buffer = NULL; + } + } + else + { + gui_chat_lines_waiting_buffer = malloc (length); + if (gui_chat_lines_waiting_buffer) + gui_chat_lines_waiting_buffer[0] = '\0'; } - if (pos_prefix) + if (gui_chat_lines_waiting_buffer) { - memcpy (pos_lines, pos_prefix, strlen (pos_prefix)); - pos_lines += strlen (pos_prefix); - pos_lines[0] = '\t'; - pos_lines++; + pos_lines = gui_chat_lines_waiting_buffer + + strlen (gui_chat_lines_waiting_buffer); + if (pos_lines > gui_chat_lines_waiting_buffer) + { + pos_lines[0] = '\n'; + pos_lines++; + } + if (pos_prefix) + { + memcpy (pos_lines, pos_prefix, strlen (pos_prefix)); + pos_lines += strlen (pos_prefix); + pos_lines[0] = '\t'; + pos_lines++; + } + memcpy (pos_lines, ptr_msg, strlen (ptr_msg) + 1); } - memcpy (pos_lines, ptr_msg, strlen (ptr_msg) + 1); } } @@ -825,7 +830,6 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, if (gui_init_ok && at_least_one_message_printed) gui_buffer_ask_chat_refresh (buffer, 1); -end: free (vbuffer); } diff --git a/src/gui/gui-color.h b/src/gui/gui-color.h index 578183200..990ec5cc9 100644 --- a/src/gui/gui-color.h +++ b/src/gui/gui-color.h @@ -144,6 +144,8 @@ enum t_gui_color_enum "([<>])|" \ "(\\[[0-9;?]*[A-Za-z]))" +#define GUI_COLOR_BUFFER_NAME "color" + /* color structure */ struct t_gui_color diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index c97192ed1..21a8c6d35 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -33,6 +33,7 @@ #include <unistd.h> #include "../core/weechat.h" +#include "../core/wee-arraylist.h" #include "../core/wee-completion.h" #include "../core/wee-config.h" #include "../core/wee-hdata.h" @@ -51,6 +52,48 @@ int gui_completion_freeze = 0; /* 1 to freeze completions (do not */ /* + * Compares two words in completion list. + */ + +int +gui_completion_word_compare_cb (void *data, struct t_arraylist *arraylist, + void *pointer1, void *pointer2) +{ + struct t_gui_completion_word *completion_word1, *completion_word2; + + /* make C compiler happy */ + (void) data; + (void) arraylist; + + completion_word1 = (struct t_gui_completion_word *)pointer1; + completion_word2 = (struct t_gui_completion_word *)pointer2; + + return string_strcasecmp (completion_word1->word, completion_word2->word); +} + +/* + * Frees a word in completion list. + */ + +void +gui_completion_word_free_cb (void *data, struct t_arraylist *arraylist, + void *pointer) +{ + struct t_gui_completion_word *completion_word; + + /* make C compiler happy */ + (void) data; + (void) arraylist; + + completion_word = (struct t_gui_completion_word *)pointer; + + if (completion_word->word) + free (completion_word->word); + + free (completion_word); +} + +/* * Initializes completion for a buffer. */ @@ -70,7 +113,9 @@ gui_completion_buffer_init (struct t_gui_completion *completion, completion->add_space = 1; completion->force_partial_completion = 0; - completion->completion_list = weelist_new (); + completion->list = arraylist_new (32, 1, 0, + &gui_completion_word_compare_cb, NULL, + &gui_completion_word_free_cb, NULL); completion->word_found = NULL; completion->word_found_is_nick = 0; @@ -78,8 +123,10 @@ gui_completion_buffer_init (struct t_gui_completion *completion, completion->diff_size = 0; completion->diff_length = 0; - completion->partial_completion_list = NULL; - completion->last_partial_completion = NULL; + completion->partial_list = arraylist_new ( + 0, 0, 0, + &gui_completion_word_compare_cb, NULL, + &gui_completion_word_free_cb, NULL); } /* @@ -88,66 +135,23 @@ gui_completion_buffer_init (struct t_gui_completion *completion, * Returns pointer to new item, NULL if error. */ -struct t_gui_completion_partial * +struct t_gui_completion_word * gui_completion_partial_list_add (struct t_gui_completion *completion, const char *word, int count) { - struct t_gui_completion_partial *new_item; + struct t_gui_completion_word *new_completion_word; - new_item = malloc (sizeof (*new_item)); - if (new_item) + new_completion_word = malloc (sizeof (*new_completion_word)); + if (new_completion_word) { - new_item->word = strdup (word); - new_item->count = count; + new_completion_word->word = strdup (word); + new_completion_word->nick_completion = 0; + new_completion_word->count = count; - new_item->prev_item = completion->last_partial_completion; - if (completion->partial_completion_list) - (completion->last_partial_completion)->next_item = new_item; - else - completion->partial_completion_list = new_item; - completion->last_partial_completion = new_item; - new_item->next_item = NULL; + arraylist_add (completion->partial_list, new_completion_word); } - return new_item; -} - -/* - * Removes an item from partial completion list. - */ -void -gui_completion_partial_list_free (struct t_gui_completion *completion, - struct t_gui_completion_partial *item) -{ - /* remove partial completion item from list */ - if (item->prev_item) - (item->prev_item)->next_item = item->next_item; - if (item->next_item) - (item->next_item)->prev_item = item->prev_item; - if (completion->partial_completion_list == item) - completion->partial_completion_list = item->next_item; - if (completion->last_partial_completion == item) - completion->last_partial_completion = item->prev_item; - - /* free data */ - if (item->word) - free (item->word); - - free (item); -} - -/* - * Removes partial completion list. - */ - -void -gui_completion_partial_list_free_all (struct t_gui_completion *completion) -{ - while (completion->partial_completion_list) - { - gui_completion_partial_list_free (completion, - completion->partial_completion_list); - } + return new_completion_word; } /* @@ -169,17 +173,21 @@ gui_completion_free_data (struct t_gui_completion *completion) free (completion->args); completion->args = NULL; - if (completion->completion_list) + if (completion->list) { - weelist_free (completion->completion_list); - completion->completion_list = NULL; + arraylist_free (completion->list); + completion->list = NULL; } if (completion->word_found) free (completion->word_found); completion->word_found = NULL; - gui_completion_partial_list_free_all (completion); + if (completion->partial_list) + { + arraylist_free (completion->partial_list); + completion->partial_list = NULL; + } } /* @@ -206,9 +214,9 @@ gui_completion_stop (struct t_gui_completion *completion) completion->context = GUI_COMPLETION_NULL; completion->position = -1; - if (completion->partial_completion_list) + if (completion->partial_list->size > 0) { - gui_completion_partial_list_free_all (completion); + arraylist_clear (completion->partial_list); (void) hook_signal_send ("partial_completion", WEECHAT_HOOK_SIGNAL_STRING, NULL); } @@ -224,27 +232,45 @@ struct t_hook * gui_completion_search_command (struct t_weechat_plugin *plugin, const char *command) { - struct t_hook *ptr_hook, *hook_for_other_plugin; + struct t_hook *ptr_hook, *hook_for_other_plugin, *hook_incomplete_command; + int length_command, allow_incomplete_commands, count_incomplete_commands; hook_for_other_plugin = NULL; + hook_incomplete_command = NULL; + length_command = strlen (command); + count_incomplete_commands = 0; + allow_incomplete_commands = CONFIG_BOOLEAN(config_look_command_incomplete); for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { if (!ptr_hook->deleted && HOOK_COMMAND(ptr_hook, command) - && HOOK_COMMAND(ptr_hook, command)[0] - && (string_strcasecmp (HOOK_COMMAND(ptr_hook, command), - command) == 0)) + && HOOK_COMMAND(ptr_hook, command)[0]) { - if (ptr_hook->plugin == plugin) - return ptr_hook; - - hook_for_other_plugin = ptr_hook; + if (string_strcasecmp (HOOK_COMMAND(ptr_hook, command), + command) == 0) + { + if (ptr_hook->plugin == plugin) + return ptr_hook; + hook_for_other_plugin = ptr_hook; + } + else if (allow_incomplete_commands + && (string_strncasecmp (HOOK_COMMAND(ptr_hook, command), + command, + length_command) == 0)) + { + hook_incomplete_command = ptr_hook; + count_incomplete_commands++; + } } } - return hook_for_other_plugin; + if (hook_for_other_plugin) + return hook_for_other_plugin; + + return (count_incomplete_commands == 1) ? + hook_incomplete_command : NULL; } /* @@ -351,7 +377,9 @@ void gui_completion_list_add (struct t_gui_completion *completion, const char *word, int nick_completion, const char *where) { + struct t_gui_completion_word *completion_word; char buffer[512]; + int index; if (!word || !word[0]) return; @@ -362,17 +390,37 @@ gui_completion_list_add (struct t_gui_completion *completion, const char *word, || (!nick_completion && (string_strncasecmp (completion->base_word, word, utf8_strlen (completion->base_word)) == 0))) { - if (nick_completion && (completion->base_word_pos == 0)) + completion_word = malloc (sizeof (*completion_word)); + if (completion_word) { - snprintf (buffer, sizeof (buffer), "%s%s", - word, CONFIG_STRING(config_completion_nick_completer)); - weelist_add (completion->completion_list, buffer, where, - (nick_completion) ? (void *)1 : (void *)0); - } - else - { - weelist_add (completion->completion_list, word, where, - (nick_completion) ? (void *)1 : (void *)0); + completion_word->nick_completion = nick_completion; + completion_word->count = 0; + + index = -1; + if (strcmp (where, WEECHAT_LIST_POS_BEGINNING) == 0) + { + completion->list->sorted = 0; + index = 0; + } + else if (strcmp (where, WEECHAT_LIST_POS_END) == 0) + { + completion->list->sorted = 0; + index = -1; + } + + if (nick_completion && (completion->base_word_pos == 0)) + { + snprintf (buffer, sizeof (buffer), "%s%s", + word, + CONFIG_STRING(config_completion_nick_completer)); + completion_word->word = strdup (buffer); + arraylist_insert (completion->list, index, completion_word); + } + else + { + completion_word->word = strdup (word); + arraylist_insert (completion->list, index, completion_word); + } } } } @@ -657,33 +705,77 @@ void gui_completion_find_context (struct t_gui_completion *completion, const char *data, int size, int pos) { - int i, command, command_arg, pos_start, pos_end; + int i, command_arg, pos_start, pos_end; + const char *ptr_command, *ptr_data; char *prev_char; /* look for context */ gui_completion_free_data (completion); gui_completion_buffer_init (completion, completion->buffer); - command = (string_is_command_char (data)) ? 1 : 0; + ptr_command = NULL; command_arg = 0; - i = 0; - while (i < pos) + + /* check if data starts with a command */ + ptr_data = data; + if (string_is_command_char (ptr_data)) { - if (data[i] == ' ') + ptr_data = utf8_next_char (ptr_data); + if (ptr_data < data + pos) { - command_arg++; - i++; - while ((i < pos) && (data[i] == ' ')) + if (string_is_command_char (ptr_data)) + ptr_data = utf8_next_char (ptr_data); + } + if (!string_is_command_char (ptr_data)) + ptr_command = ptr_data; + } + + /* + * search for the last command in data (only if there is no command at + * beginning and if completion of inline commands is enabled) + */ + if (!ptr_command && CONFIG_BOOLEAN(config_completion_command_inline)) + { + ptr_data = data; + while (ptr_data && (ptr_data < data + pos)) + { + ptr_data = strchr (ptr_data, ' '); + if (!ptr_data) + break; + if (ptr_data < data + pos) { - i++; + while ((ptr_data < data + pos) && (ptr_data[0] == ' ')) + { + ptr_data++; + } + } + if ((ptr_data < data + pos) && string_is_command_char (ptr_data)) + { + ptr_data = utf8_next_char (ptr_data); + if (!string_is_command_char (ptr_data)) + ptr_command = ptr_data; } - if (!completion->args) - completion->args = strdup (data + i); } - else - i++; } - if (command) + + if (ptr_command) { + /* search argument number and string with arguments */ + ptr_data = ptr_command; + while (ptr_data < data + pos) + { + ptr_data = strchr (ptr_data, ' '); + if (!ptr_data) + break; + command_arg++; + while ((ptr_data < data + pos) && (ptr_data[0] == ' ')) + { + ptr_data++; + } + if (!completion->args) + completion->args = strdup (ptr_data); + } + + /* set completion context */ if (command_arg > 0) { completion->context = GUI_COMPLETION_COMMAND_ARG; @@ -769,35 +861,29 @@ gui_completion_find_context (struct t_gui_completion *completion, /* find command (for command argument completion only) */ if (completion->context == GUI_COMPLETION_COMMAND_ARG) { - pos_start = 0; - while ((pos_start < size) && !string_is_command_char (data + pos_start)) + pos_start = ptr_command - data; + pos_end = pos_start; + while ((pos_end < size) && (data[pos_end] != ' ')) { - pos_start += utf8_char_size (data + pos_start); + pos_end += utf8_char_size (data + pos_end); } - if (string_is_command_char (data + pos_start)) + if (data[pos_end] == ' ') + { + prev_char = utf8_prev_char (data, data + pos_end); + pos_end -= utf8_char_size (prev_char); + } + if (pos_end >= pos_start) { - pos_start += utf8_char_size (data + pos_start); - if (string_is_command_char (data + pos_start)) - pos_start += utf8_char_size (data + pos_start); - pos_end = pos_start; - while ((pos_end < size) && (data[pos_end] != ' ')) - { - pos_end += utf8_char_size (data + pos_end); - } - if (data[pos_end] == ' ') - { - prev_char = utf8_prev_char (data, data + pos_end); - pos_end -= utf8_char_size (prev_char); - } - completion->base_command = malloc (pos_end - pos_start + 2); for (i = pos_start; i <= pos_end; i++) { completion->base_command[i - pos_start] = data[i]; } completion->base_command[pos_end - pos_start + 1] = '\0'; - gui_completion_build_list (completion); } + else + completion->base_command = strdup (""); + gui_completion_build_list (completion); } /* @@ -824,28 +910,32 @@ gui_completion_find_context (struct t_gui_completion *completion, */ int -gui_completion_common_prefix_size (struct t_weelist *list, +gui_completion_common_prefix_size (struct t_arraylist *list, const char *utf_char) { - struct t_weelist_item *ptr_item; char *ptr_first_item, *ptr_char, *next_char; + struct t_gui_completion_word *ptr_completion_word; + int i; - ptr_first_item = list->items->data; + ptr_first_item = ((struct t_gui_completion_word *)(list->data[0]))->word; ptr_char = ptr_first_item; while (ptr_char && ptr_char[0]) { next_char = utf8_next_char (ptr_char); - for (ptr_item = list->items->next_item; ptr_item; - ptr_item = ptr_item->next_item) + for (i = 1; i < list->size; i++) { + ptr_completion_word = + (struct t_gui_completion_word *)(list->data[i]); if (!utf_char - || (utf8_charcasecmp (utf_char, ptr_item->data) == 0)) + || (utf8_charcasecmp (utf_char, + ptr_completion_word->word) == 0)) { - if ((ptr_item->data[ptr_char - ptr_first_item] == '\0') - || (utf8_charcasecmp (ptr_char, - ptr_item->data + (ptr_char - ptr_first_item)) != 0)) + if ((ptr_completion_word->word[ptr_char - ptr_first_item] == '\0') + || (utf8_charcasecmp ( + ptr_char, + ptr_completion_word->word + (ptr_char - ptr_first_item)) != 0)) { return ptr_char - ptr_first_item; } @@ -865,65 +955,78 @@ void gui_completion_partial_build_list (struct t_gui_completion *completion, int common_prefix_size) { - int char_size, items_count; + int i, char_size, items_count, index; char utf_char[16], *word; - struct t_weelist *weelist_temp; - struct t_weelist_item *ptr_item, *next_item; + struct t_gui_completion_word *ptr_completion_word, *new_completion_word; + struct t_arraylist *list_temp; - gui_completion_partial_list_free_all (completion); + arraylist_clear (completion->partial_list); - if (!completion->completion_list || !completion->completion_list->items) + if (!completion->list || (completion->list->size == 0)) return; - weelist_temp = weelist_new (); - if (!weelist_temp) + list_temp = arraylist_new (completion->list->size, 1, 0, + &gui_completion_word_compare_cb, NULL, + &gui_completion_word_free_cb, NULL); + if (!list_temp) return; - for (ptr_item = completion->completion_list->items; ptr_item; - ptr_item = ptr_item->next_item) + for (i = 0; i < completion->list->size; i++) { - weelist_add (weelist_temp, ptr_item->data + common_prefix_size, - WEECHAT_LIST_POS_END, NULL); + ptr_completion_word = + (struct t_gui_completion_word *)completion->list->data[i]; + new_completion_word = malloc (sizeof (*new_completion_word)); + if (new_completion_word) + { + new_completion_word->word = strdup ( + ptr_completion_word->word + common_prefix_size); + new_completion_word->nick_completion = 0; + new_completion_word->count = 0; + arraylist_add (list_temp, new_completion_word); + } } - while (weelist_temp->items) + while (list_temp->size > 0) { - char_size = utf8_char_size (weelist_temp->items->data); - memcpy (utf_char, weelist_temp->items->data, char_size); + ptr_completion_word = + (struct t_gui_completion_word *)list_temp->data[0]; + char_size = utf8_char_size (ptr_completion_word->word); + memcpy (utf_char, ptr_completion_word->word, char_size); utf_char[char_size] = '\0'; word = NULL; - common_prefix_size = gui_completion_common_prefix_size (weelist_temp, + common_prefix_size = gui_completion_common_prefix_size (list_temp, utf_char); if (common_prefix_size > 0) { - word = string_strndup (weelist_temp->items->data, + word = string_strndup (ptr_completion_word->word, common_prefix_size); } items_count = 0; - ptr_item = weelist_temp->items; - while (ptr_item) + index = 0; + while (index < list_temp->size) { - next_item = ptr_item->next_item; - - if (utf8_charcasecmp (utf_char, ptr_item->data) == 0) + ptr_completion_word = + (struct t_gui_completion_word *)list_temp->data[index]; + if (utf8_charcasecmp (utf_char, ptr_completion_word->word) == 0) { - weelist_remove (weelist_temp, ptr_item); + arraylist_remove (list_temp, index); items_count++; } - - ptr_item = next_item; + else + index++; } if (word) { - gui_completion_partial_list_add (completion, - word, - CONFIG_BOOLEAN(config_completion_partial_completion_count) ? - items_count : -1); + gui_completion_partial_list_add ( + completion, + word, + CONFIG_BOOLEAN(config_completion_partial_completion_count) ? + items_count : -1); free (word); } } - weelist_free (weelist_temp); + arraylist_free (list_temp); } /* @@ -934,8 +1037,8 @@ void gui_completion_complete (struct t_gui_completion *completion) { int length, word_found_seen, other_completion, partial_completion; - int common_prefix_size, item_is_nick; - struct t_weelist_item *ptr_item, *ptr_item2; + int common_prefix_size, index, index2; + struct t_gui_completion_word *ptr_completion_word, *ptr_completion_word2; length = utf8_strlen (completion->base_word); word_found_seen = 0; @@ -959,21 +1062,12 @@ gui_completion_complete (struct t_gui_completion *completion) common_prefix_size = 0; if (partial_completion - && completion->completion_list && completion->completion_list->items) + && completion->list && (completion->list->size > 0)) { - common_prefix_size = gui_completion_common_prefix_size (completion->completion_list, + common_prefix_size = gui_completion_common_prefix_size (completion->list, NULL); } - ptr_item = NULL; - if (completion->completion_list) - { - if (completion->direction < 0) - ptr_item = completion->completion_list->last_item; - else - ptr_item = completion->completion_list->items; - } - if (partial_completion && completion->word_found && (utf8_strlen (completion->word_found) >= common_prefix_size)) @@ -981,59 +1075,68 @@ gui_completion_complete (struct t_gui_completion *completion) return; } - while (ptr_item) + index = -1; + if (completion->list) + { + if (completion->direction < 0) + index = completion->list->size - 1; + else + index = 0; + } + + while ((index >= 0) && (index < completion->list->size)) { - item_is_nick = ((long)(ptr_item->user_data) == 1); - if ((item_is_nick - && (gui_completion_nickncmp (completion->base_word, ptr_item->data, + ptr_completion_word = + (struct t_gui_completion_word *)(completion->list->data[index]); + if ((ptr_completion_word->nick_completion + && (gui_completion_nickncmp (completion->base_word, + ptr_completion_word->word, length) == 0)) - || ((!item_is_nick) - && (string_strncasecmp (completion->base_word, ptr_item->data, + || (!ptr_completion_word->nick_completion + && (string_strncasecmp (completion->base_word, + ptr_completion_word->word, length) == 0))) { if ((!completion->word_found) || word_found_seen) { if (completion->word_found) free (completion->word_found); - completion->word_found = strdup (ptr_item->data); - completion->word_found_is_nick = item_is_nick; - if (item_is_nick + completion->word_found = strdup (ptr_completion_word->word); + completion->word_found_is_nick = + ptr_completion_word->nick_completion; + if (ptr_completion_word->nick_completion && !CONFIG_BOOLEAN(config_completion_nick_add_space)) { completion->add_space = 0; } /* stop after first nick if user asked that */ - if (item_is_nick + if (ptr_completion_word->nick_completion && CONFIG_BOOLEAN(config_completion_nick_first_only)) { gui_completion_stop (completion); return; } - if (completion->direction < 0) - ptr_item2 = ptr_item->prev_item; - else - ptr_item2 = ptr_item->next_item; - - while (ptr_item2) + index2 = (completion->direction < 0) ? index - 1 : index + 1; + while ((index2 >= 0) && (index2 < completion->list->size)) { - if ((item_is_nick + ptr_completion_word2 = + (struct t_gui_completion_word *)(completion->list->data[index2]); + if ((ptr_completion_word->nick_completion && (gui_completion_nickncmp (completion->base_word, - ptr_item2->data, + ptr_completion_word2->word, length) == 0)) - || ((!item_is_nick) + || (!ptr_completion_word->nick_completion && (string_strncasecmp (completion->base_word, - ptr_item2->data, + ptr_completion_word2->word, length) == 0))) { other_completion++; } - if (completion->direction < 0) - ptr_item2 = ptr_item2->prev_item; - else - ptr_item2 = ptr_item2->next_item; + index2 = (completion->direction < 0) ? + index2 - 1 : index2 + 1; } if (other_completion == 0) @@ -1068,20 +1171,17 @@ gui_completion_complete (struct t_gui_completion *completion) return; } - gui_completion_partial_list_free_all (completion); + arraylist_clear (completion->partial_list); return; } other_completion++; } if (completion->word_found && - (strcmp (ptr_item->data, completion->word_found) == 0)) + (strcmp (ptr_completion_word->word, completion->word_found) == 0)) word_found_seen = 1; - if (completion->direction < 0) - ptr_item = ptr_item->prev_item; - else - ptr_item = ptr_item->next_item; + index = (completion->direction < 0) ? index - 1 : index + 1; } /* @@ -1106,7 +1206,7 @@ gui_completion_command (struct t_gui_completion *completion) { struct t_hook *ptr_hook; - if (!completion->completion_list->items) + if (completion->list->size == 0) { for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) @@ -1136,18 +1236,19 @@ gui_completion_auto (struct t_gui_completion *completion) if ((completion->base_word[0] == '/') || (completion->base_word[0] == '~')) { - if (!completion->completion_list->items) + if (completion->list->size == 0) completion_list_add_filename_cb (NULL, NULL, NULL, completion); gui_completion_complete (completion); return; } /* use default template completion */ - if (!completion->completion_list->items) + if (completion->list->size == 0) { - gui_completion_build_list_template (completion, - CONFIG_STRING(config_completion_default_template), - NULL); + gui_completion_build_list_template ( + completion, + CONFIG_STRING(config_completion_default_template), + NULL); } gui_completion_complete (completion); } @@ -1187,7 +1288,7 @@ gui_completion_search (struct t_gui_completion *completion, int direction, gui_completion_command (completion); break; case GUI_COMPLETION_COMMAND_ARG: - if (completion->completion_list->items) + if (completion->list->size > 0) gui_completion_complete (completion); else { @@ -1268,24 +1369,23 @@ gui_completion_hdata_completion_cb (void *data, const char *hdata_name) HDATA_VAR(struct t_gui_completion, direction, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_completion, add_space, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_completion, force_partial_completion, INTEGER, 0, NULL, NULL); - HDATA_VAR(struct t_gui_completion, completion_list, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_gui_completion, list, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_completion, word_found, STRING, 0, NULL, NULL); HDATA_VAR(struct t_gui_completion, word_found_is_nick, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_completion, position_replace, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_completion, diff_size, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_completion, diff_length, INTEGER, 0, NULL, NULL); - HDATA_VAR(struct t_gui_completion, partial_completion_list, POINTER, 0, NULL, "completion_partial"); - HDATA_VAR(struct t_gui_completion, last_partial_completion, POINTER, 0, NULL, "completion_partial"); + HDATA_VAR(struct t_gui_completion, partial_list, POINTER, 0, NULL, NULL); } return hdata; } /* - * Returns hdata for partial completion. + * Returns hdata for completion word. */ struct t_hdata * -gui_completion_hdata_completion_partial_cb (void *data, const char *hdata_name) +gui_completion_hdata_completion_word_cb (void *data, const char *hdata_name) { struct t_hdata *hdata; @@ -1296,23 +1396,41 @@ gui_completion_hdata_completion_partial_cb (void *data, const char *hdata_name) 0, 0, NULL, NULL); if (hdata) { - HDATA_VAR(struct t_gui_completion_partial, word, STRING, 0, NULL, NULL); - HDATA_VAR(struct t_gui_completion_partial, count, INTEGER, 0, NULL, NULL); - HDATA_VAR(struct t_gui_completion_partial, prev_item, POINTER, 0, NULL, hdata_name); - HDATA_VAR(struct t_gui_completion_partial, next_item, POINTER, 0, NULL, hdata_name); + HDATA_VAR(struct t_gui_completion_word, word, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_gui_completion_word, nick_completion, CHAR, 0, NULL, NULL); + HDATA_VAR(struct t_gui_completion_word, count, INTEGER, 0, NULL, NULL); } return hdata; } /* + * Prints list of completion words in WeeChat log file (usually for crash dump). + */ + +void +gui_completion_list_words_print_log (struct t_arraylist *list, + const char *name) +{ + int i; + struct t_gui_completion_word *ptr_completion_word; + + for (i = 0; i < list->size; i++) + { + ptr_completion_word = (struct t_gui_completion_word *)(list->data[i]); + log_printf ("[%s (addr:0x%lx)]", name, ptr_completion_word); + log_printf (" word. . . . . . . . . . : '%s'", ptr_completion_word->word); + log_printf (" nicklist_completion . . : %d", ptr_completion_word->nick_completion); + log_printf (" count . . . . . . . . . : %d", ptr_completion_word->count); + } +} + +/* * Prints completion list in WeeChat log file (usually for crash dump). */ void gui_completion_print_log (struct t_gui_completion *completion) { - struct t_gui_completion_partial *ptr_item; - log_printf ("[completion (addr:0x%lx)]", completion); log_printf (" buffer. . . . . . . . . : 0x%lx", completion->buffer); log_printf (" context . . . . . . . . : %d", completion->context); @@ -1325,29 +1443,22 @@ gui_completion_print_log (struct t_gui_completion *completion) log_printf (" direction . . . . . . . : %d", completion->direction); log_printf (" add_space . . . . . . . : %d", completion->add_space); log_printf (" force_partial_completion: %d", completion->force_partial_completion); - log_printf (" completion_list . . . . : 0x%lx", completion->completion_list); + log_printf (" list. . . . . . . . . . : 0x%lx", completion->list); log_printf (" word_found. . . . . . . : '%s'", completion->word_found); log_printf (" word_found_is_nick. . . : %d", completion->word_found_is_nick); log_printf (" position_replace. . . . : %d", completion->position_replace); log_printf (" diff_size . . . . . . . : %d", completion->diff_size); log_printf (" diff_length . . . . . . : %d", completion->diff_length); - if (completion->completion_list) + if (completion->list) { log_printf (""); - weelist_print_log (completion->completion_list, - "completion list element"); + gui_completion_list_words_print_log (completion->list, + "completion word"); } - if (completion->partial_completion_list) + if (completion->partial_list) { log_printf (""); - for (ptr_item = completion->partial_completion_list; - ptr_item; ptr_item = ptr_item->next_item) - { - log_printf ("[partial completion item (addr:0x%lx)]", ptr_item); - log_printf (" word. . . . . . . . . . : '%s'", ptr_item->word); - log_printf (" count . . . . . . . . . : %d", ptr_item->count); - log_printf (" prev_item . . . . . . . : 0x%lx", ptr_item->prev_item); - log_printf (" next_item . . . . . . . : 0x%lx", ptr_item->next_item); - } + arraylist_print_log (completion->partial_list, + "partial completion word"); } } diff --git a/src/gui/gui-completion.h b/src/gui/gui-completion.h index 7192779de..7c1368937 100644 --- a/src/gui/gui-completion.h +++ b/src/gui/gui-completion.h @@ -25,12 +25,12 @@ #define GUI_COMPLETION_COMMAND_ARG 2 #define GUI_COMPLETION_AUTO 3 -struct t_gui_completion_partial +struct t_gui_completion_word { - char *word; /* (partial) word matching completion */ + char *word; /* word matching completion */ + char nick_completion; /* 1 if it is completion of a nick */ int count; /* number of matching items with this word */ - struct t_gui_completion_partial *prev_item; - struct t_gui_completion_partial *next_item; + /* (for partial completion) */ }; struct t_gui_completion @@ -49,7 +49,7 @@ struct t_gui_completion int force_partial_completion; /* force partial completion? */ /* for command argument completion */ - struct t_weelist *completion_list; /* data list for completion */ + struct t_arraylist *list; /* data list for completion */ /* completion found */ char *word_found; /* word found (to replace base word) */ @@ -59,8 +59,7 @@ struct t_gui_completion int diff_length; /* length difference (<= diff_size) */ /* partial completion */ - struct t_gui_completion_partial *partial_completion_list; - struct t_gui_completion_partial *last_partial_completion; + struct t_arraylist *partial_list; }; /* completion variables */ diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index 4bf71077c..1a154ba0b 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -190,7 +190,7 @@ gui_hotlist_find_pos (struct t_gui_hotlist *hotlist, if ((new_hotlist->priority > ptr_hotlist->priority) || ((new_hotlist->priority == ptr_hotlist->priority) && (util_timeval_diff (&(new_hotlist->creation_time), - &(ptr_hotlist->creation_time)) < 0))) + &(ptr_hotlist->creation_time)) < 0))) return ptr_hotlist; } break; @@ -487,7 +487,8 @@ gui_hotlist_clear () */ void -gui_hotlist_remove_buffer (struct t_gui_buffer *buffer) +gui_hotlist_remove_buffer (struct t_gui_buffer *buffer, + int force_remove_buffer) { int hotlist_changed, hotlist_remove, buffer_to_remove; struct t_gui_hotlist *ptr_hotlist, *next_hotlist; @@ -504,19 +505,22 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer) { next_hotlist = ptr_hotlist->next_hotlist; - buffer_to_remove = 0; + buffer_to_remove = (force_remove_buffer) ? + (ptr_hotlist->buffer == buffer) : 0; + switch (hotlist_remove) { case CONFIG_LOOK_HOTLIST_REMOVE_BUFFER: - buffer_to_remove = (ptr_hotlist->buffer == buffer); + buffer_to_remove |= (ptr_hotlist->buffer == buffer); break; case CONFIG_LOOK_HOTLIST_REMOVE_MERGED: - buffer_to_remove = + buffer_to_remove |= ((ptr_hotlist->buffer->number == buffer->number) && (!ptr_hotlist->buffer->zoomed || (ptr_hotlist->buffer->active == 2))); break; } + if (buffer_to_remove) { gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, ptr_hotlist); diff --git a/src/gui/gui-hotlist.h b/src/gui/gui-hotlist.h index 18cec9702..d53348823 100644 --- a/src/gui/gui-hotlist.h +++ b/src/gui/gui-hotlist.h @@ -59,7 +59,8 @@ extern struct t_gui_hotlist *gui_hotlist_add (struct t_gui_buffer *buffer, struct timeval *creation_time); extern void gui_hotlist_resort (); extern void gui_hotlist_clear (); -extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer); +extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer, + int force_remove_buffer); extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (void *data, const char *hdata_name); extern int gui_hotlist_add_to_infolist (struct t_infolist *infolist, diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c index 6e356da96..e7824dcd8 100644 --- a/src/gui/gui-input.c +++ b/src/gui/gui-input.c @@ -1383,7 +1383,7 @@ gui_input_jump_smart (struct t_gui_buffer *buffer) if (!gui_hotlist_initial_buffer) gui_hotlist_initial_buffer = window->buffer; gui_window_switch_to_buffer (window, gui_hotlist->buffer, 1); - gui_hotlist_remove_buffer (window->buffer); + gui_hotlist_remove_buffer (window->buffer, 0); scroll_to_bottom = 1; } else diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index cc27c64a9..1ea5948ab 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -782,7 +782,16 @@ gui_line_has_highlight (struct t_gui_line *line) { length = strlen (ptr_nick); if (strncmp (ptr_msg_no_color, ptr_nick, length) == 0) + { + /* skip nick at beginning (for example: "FlashCode") */ ptr_msg_no_color += length; + } + else if (ptr_msg_no_color[0] + && (strncmp (ptr_msg_no_color + 1, ptr_nick, length) == 0)) + { + /* skip prefix and nick at beginning (for example: "@FlashCode") */ + ptr_msg_no_color += length + 1; + } } /* @@ -938,6 +947,10 @@ gui_line_add_to_list (struct t_gui_lines *lines, if (prefix_length > lines->prefix_max_length) lines->prefix_max_length = prefix_length; + /* adjust "lines_hidden" if the line is hidden */ + if (!line->data->displayed) + (lines->lines_hidden)++; + lines->lines_count++; } @@ -987,6 +1000,10 @@ gui_line_remove_from_list (struct t_gui_buffer *buffer, gui_buffer_ask_chat_refresh (buffer, 1); } + /* adjust "lines_hidden" if the line was hidden */ + if (!line->data->displayed && (lines->lines_hidden > 0)) + (lines->lines_hidden)--; + /* free data */ if (free_data) { @@ -1278,9 +1295,6 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date, } else { - buffer->own_lines->lines_hidden++; - if (buffer->mixed_lines) - buffer->mixed_lines->lines_hidden++; (void) hook_signal_send ("buffer_lines_hidden", WEECHAT_HOOK_SIGNAL_POINTER, buffer); } diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c index 425c16f36..bc6f556d8 100644 --- a/src/gui/gui-window.c +++ b/src/gui/gui-window.c @@ -1673,7 +1673,7 @@ gui_window_search_stop (struct t_gui_window *window) } window->scroll->start_line = NULL; window->scroll->start_line_pos = 0; - gui_hotlist_remove_buffer (window->buffer); + gui_hotlist_remove_buffer (window->buffer, 0); gui_buffer_ask_chat_refresh (window->buffer, 2); } diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c index 646fa24f7..0e34cb669 100644 --- a/src/plugins/aspell/weechat-aspell.c +++ b/src/plugins/aspell/weechat-aspell.c @@ -1002,15 +1002,19 @@ weechat_aspell_debug_libs_cb (void *data, const char *signal, (void) signal_data; #ifdef USE_ENCHANT +#ifdef HAVE_ENCHANT_GET_VERSION weechat_printf (NULL, " %s: enchant %s", ASPELL_PLUGIN_NAME, enchant_get_version ()); #else + weechat_printf (NULL, " %s: enchant (?)", ASPELL_PLUGIN_NAME); +#endif /* HAVE_ENCHANT_GET_VERSION */ +#else #ifdef HAVE_ASPELL_VERSION_STRING weechat_printf (NULL, " %s: aspell %s", ASPELL_PLUGIN_NAME, aspell_version_string ()); #else weechat_printf (NULL, " %s: aspell (?)", ASPELL_PLUGIN_NAME); -#endif +#endif /* HAVE_ASPELL_VERSION_STRING */ #endif /* USE_ENCHANT */ return WEECHAT_RC_OK; diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c index 155f88393..7d4304d9f 100644 --- a/src/plugins/guile/weechat-guile.c +++ b/src/plugins/guile/weechat-guile.c @@ -19,6 +19,10 @@ * along with WeeChat. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #undef _ #include <libguile.h> @@ -971,12 +975,14 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) guile_stdout = NULL; +#ifdef HAVE_GUILE_GMP_MEMORY_FUNCTIONS /* * prevent guile to use its own gmp allocator, because it can conflict * with other plugins using GnuTLS like relay, which can crash WeeChat * on unload (or exit) */ scm_install_gmp_memory_functions = 0; +#endif scm_init_guile (); diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c index 3ac0d466f..f4dcf1d43 100644 --- a/src/plugins/irc/irc-bar-item.c +++ b/src/plugins/irc/irc-bar-item.c @@ -88,39 +88,6 @@ irc_bar_item_away (void *data, struct t_gui_bar_item *item, } /* - * Returns content of bar item "buffer_title": bar item with buffer title. - */ - -char * -irc_bar_item_buffer_title (void *data, struct t_gui_bar_item *item, - struct t_gui_window *window, - struct t_gui_buffer *buffer, - struct t_hashtable *extra_info) -{ - const char *title; - char *title_color; - - /* make C compiler happy */ - (void) data; - (void) item; - (void) window; - (void) extra_info; - - if (!buffer) - return NULL; - - title = weechat_buffer_get_string (buffer, "title"); - if (!title) - return NULL; - - title_color = irc_color_decode (title, - (weechat_config_boolean (irc_config_look_topic_strip_colors)) ? - 0 : 1); - - return (title_color) ? title_color : strdup (title); -} - -/* * Returns content of bar item "buffer_plugin": bar item with buffer plugin. */ @@ -323,8 +290,8 @@ irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item, pos_space = strchr(channel->modes, ' '); if (pos_space) { - modes_without_args = weechat_strndup (channel->modes, - pos_space - channel->modes); + modes_without_args = weechat_strndup ( + channel->modes, pos_space - channel->modes); } } snprintf (modes, sizeof (modes), @@ -494,10 +461,13 @@ irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item, ptr_nick = irc_nick_search (server, channel, server->nick); if (ptr_nick) { - if (ptr_nick->prefix[0] != ' ') + if (weechat_config_boolean (irc_config_look_nick_mode_empty) + || (ptr_nick->prefix[0] != ' ')) { snprintf (str_prefix, sizeof (str_prefix), "%s%s", - weechat_color (irc_nick_get_prefix_color_name (server, ptr_nick->prefix[0])), + weechat_color ( + irc_nick_get_prefix_color_name ( + server, ptr_nick->prefix[0])), ptr_nick->prefix); } } @@ -634,7 +604,6 @@ irc_bar_item_buffer_switch (void *data, const char *signal, (void) signal_data; weechat_bar_item_update ("away"); - weechat_bar_item_update ("buffer_title"); weechat_bar_item_update ("buffer_name"); weechat_bar_item_update ("buffer_short_name"); weechat_bar_item_update ("buffer_modes"); @@ -666,7 +635,6 @@ void irc_bar_item_init () { weechat_bar_item_new ("away", &irc_bar_item_away, NULL); - weechat_bar_item_new ("buffer_title", &irc_bar_item_buffer_title, NULL); weechat_bar_item_new ("buffer_plugin", &irc_bar_item_buffer_plugin, NULL); weechat_bar_item_new ("buffer_name", &irc_bar_item_buffer_name, NULL); weechat_bar_item_new ("buffer_short_name", &irc_bar_item_buffer_short_name, NULL); diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 739e7cc80..13ef73e80 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -91,8 +91,8 @@ irc_channel_move_near_server (struct t_irc_server *server, int channel_type, { if (ptr_channel->buffer) { - number_channel = weechat_buffer_get_integer (ptr_channel->buffer, - "number"); + number_channel = weechat_buffer_get_integer ( + ptr_channel->buffer, "number"); switch (ptr_channel->type) { case IRC_CHANNEL_TYPE_CHANNEL: @@ -188,8 +188,8 @@ irc_channel_new (struct t_irc_server *server, int channel_type, break; } } - current_buffer_number = weechat_buffer_get_integer (weechat_current_buffer (), - "number"); + current_buffer_number = weechat_buffer_get_integer ( + weechat_current_buffer (), "number"); new_buffer = weechat_buffer_new (buffer_name, &irc_input_data_cb, NULL, &irc_buffer_close_cb, NULL); @@ -216,7 +216,8 @@ irc_channel_new (struct t_irc_server *server, int channel_type, break; case IRC_CONFIG_LOOK_BUFFER_POSITION_NEAR_SERVER: /* move buffer after last channel/pv of server */ - irc_channel_move_near_server (server, channel_type, new_buffer); + irc_channel_move_near_server (server, channel_type, + new_buffer); break; } if (ptr_buffer_for_merge) @@ -235,7 +236,10 @@ irc_channel_new (struct t_irc_server *server, int channel_type, weechat_buffer_set (new_buffer, "localvar_set_server", server->name); weechat_buffer_set (new_buffer, "localvar_set_channel", channel_name); if (server->is_away && server->away_message) - weechat_buffer_set (new_buffer, "localvar_set_away", server->away_message); + { + weechat_buffer_set (new_buffer, "localvar_set_away", + server->away_message); + } (void) weechat_hook_signal_send ("logger_backlog", WEECHAT_HOOK_SIGNAL_POINTER, new_buffer); @@ -250,15 +254,19 @@ irc_channel_new (struct t_irc_server *server, int channel_type, } /* set highlights settings on channel buffer */ - weechat_buffer_set(new_buffer, "highlight_words_add", - (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? - weechat_config_string (irc_config_look_highlight_channel) : - weechat_config_string (irc_config_look_highlight_pv)); + weechat_buffer_set( + new_buffer, + "highlight_words_add", + (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? + weechat_config_string (irc_config_look_highlight_channel) : + weechat_config_string (irc_config_look_highlight_pv)); if (weechat_config_string (irc_config_look_highlight_tags_restrict) && weechat_config_string (irc_config_look_highlight_tags_restrict)[0]) { - weechat_buffer_set (new_buffer, "highlight_tags_restrict", - weechat_config_string (irc_config_look_highlight_tags_restrict)); + weechat_buffer_set ( + new_buffer, + "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } } @@ -270,19 +278,20 @@ irc_channel_new (struct t_irc_server *server, int channel_type, new_channel->limit = 0; if (weechat_hashtable_has_key (server->join_channel_key, channel_name)) { - new_channel->key = strdup (weechat_hashtable_get (server->join_channel_key, - channel_name)); + new_channel->key = strdup ( + weechat_hashtable_get (server->join_channel_key, channel_name)); weechat_hashtable_remove (server->join_channel_key, channel_name); } else { new_channel->key = NULL; } - new_channel->join_msg_received = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + new_channel->join_msg_received = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); new_channel->checking_away = 0; new_channel->away_message = NULL; new_channel->has_quit_server = 0; @@ -351,9 +360,10 @@ irc_channel_new (struct t_irc_server *server, int channel_type, free (channel_name_lower); } - (void) weechat_hook_signal_send ((channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? - "irc_channel_opened" : "irc_pv_opened", - WEECHAT_HOOK_SIGNAL_POINTER, new_buffer); + (void) weechat_hook_signal_send ( + (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? + "irc_channel_opened" : "irc_pv_opened", + WEECHAT_HOOK_SIGNAL_POINTER, new_buffer); /* all is OK, return address of new channel */ return new_channel; @@ -389,6 +399,26 @@ irc_channel_add_nicklist_groups (struct t_irc_server *server, } /* + * Sets the buffer title with the channel topic. + */ + +void +irc_channel_set_buffer_title (struct t_irc_channel *channel) +{ + char *title_color; + + if (channel->topic) + { + title_color = irc_color_decode ( + channel->topic, + (weechat_config_boolean (irc_config_look_topic_strip_colors)) ? 0 : 1); + weechat_buffer_set (channel->buffer, "title", title_color); + } + else + weechat_buffer_set (channel->buffer, "title", ""); +} + +/* * Sets topic for a channel. */ @@ -397,10 +427,9 @@ irc_channel_set_topic (struct t_irc_channel *channel, const char *topic) { if (channel->topic) free (channel->topic); - channel->topic = (topic) ? strdup (topic) : NULL; - weechat_buffer_set (channel->buffer, "title", - (channel->topic) ? channel->topic : ""); + + irc_channel_set_buffer_title (channel); } /* @@ -591,8 +620,9 @@ irc_channel_nick_speaking_add_to_list (struct t_irc_channel *channel, to_remove = size - IRC_CHANNEL_NICKS_SPEAKING_LIMIT; for (i = 0; i < to_remove; i++) { - weechat_list_remove (channel->nicks_speaking[highlight], - weechat_list_get (channel->nicks_speaking[highlight], 0)); + weechat_list_remove ( + channel->nicks_speaking[highlight], + weechat_list_get (channel->nicks_speaking[highlight], 0)); } } } @@ -631,7 +661,8 @@ irc_channel_nick_speaking_rename (struct t_irc_channel *channel, { if (channel->nicks_speaking[i]) { - ptr_item = weechat_list_search (channel->nicks_speaking[i], old_nick); + ptr_item = weechat_list_search (channel->nicks_speaking[i], + old_nick); if (ptr_item) weechat_list_set (ptr_item, new_nick); } @@ -812,7 +843,8 @@ irc_channel_nick_speaking_time_rename (struct t_irc_server *server, if (channel->nicks_speaking_time) { - ptr_nick = irc_channel_nick_speaking_time_search (server, channel, old_nick, 0); + ptr_nick = irc_channel_nick_speaking_time_search (server, channel, + old_nick, 0); if (ptr_nick) { free (ptr_nick->nick); @@ -838,11 +870,12 @@ irc_channel_join_smart_filtered_add (struct t_irc_channel *channel, /* create hashtable if needed */ if (!channel->join_smart_filtered) { - channel->join_smart_filtered = weechat_hashtable_new (64, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_TIME, - NULL, - NULL); + channel->join_smart_filtered = weechat_hashtable_new ( + 64, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_TIME, + NULL, + NULL); } if (!channel->join_smart_filtered) return; @@ -916,7 +949,8 @@ irc_channel_join_smart_filtered_unmask (struct t_irc_channel *channel, return; /* return if unmasking of smart filtered joins is disabled */ - unmask_delay = weechat_config_integer (irc_config_look_smart_filter_join_unmask); + unmask_delay = weechat_config_integer ( + irc_config_look_smart_filter_join_unmask); if (unmask_delay == 0) return; @@ -1154,19 +1188,18 @@ irc_channel_display_nick_back_in_pv (struct t_irc_server *server, { if (weechat_config_boolean (irc_config_look_display_pv_back)) { - weechat_printf_tags (ptr_channel->buffer, - "irc_nick_back", - _("%s%s%s %s(%s%s%s)%s is back on server"), - weechat_prefix ("join"), - irc_nick_color_for_server_message (server, - nick, - nickname), - (nick) ? nick->name : nickname, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - (nick && nick->host) ? nick->host : "", - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_MESSAGE_JOIN); + weechat_printf_tags ( + ptr_channel->buffer, + "irc_nick_back", + _("%s%s%s %s(%s%s%s)%s is back on server"), + weechat_prefix ("join"), + irc_nick_color_for_msg (server, 1, nick, nickname), + (nick) ? nick->name : nickname, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + (nick && nick->host) ? nick->host : "", + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_MESSAGE_JOIN); } ptr_channel->has_quit_server = 0; } diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h index 65d319320..2d91e1907 100644 --- a/src/plugins/irc/irc-channel.h +++ b/src/plugins/irc/irc-channel.h @@ -85,6 +85,7 @@ extern struct t_irc_channel *irc_channel_new (struct t_irc_server *server, int auto_switch); extern void irc_channel_add_nicklist_groups (struct t_irc_server *server, struct t_irc_channel *channel); +extern void irc_channel_set_buffer_title (struct t_irc_channel *channel); extern void irc_channel_set_topic (struct t_irc_channel *channel, const char *topic); extern void irc_channel_set_modes (struct t_irc_channel *channel, diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 109f38b6c..87e9c6cf0 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -92,11 +92,11 @@ irc_command_mode_nicks (struct t_irc_server *server, { if (strcmp (argv[i], "*") == 0) { - weechat_printf (NULL, - _("%s%s: \"-yes\" argument is required for " - "nick \"*\" (security reason), see /help %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - command); + weechat_printf ( + NULL, + _("%s%s: \"-yes\" argument is required for nick \"*\" " + "(security reason), see /help %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, command); return; } } @@ -333,11 +333,11 @@ irc_command_exec_all_channels (struct t_irc_server *server, } if (!excluded) { - cmd_vars_replaced = irc_message_replace_vars (ptr_server, - ptr_channel->name, - str_command); + cmd_vars_replaced = irc_message_replace_vars ( + ptr_server, ptr_channel->name, str_command); weechat_command (ptr_channel->buffer, - (cmd_vars_replaced) ? cmd_vars_replaced : str_command); + (cmd_vars_replaced) ? + cmd_vars_replaced : str_command); if (cmd_vars_replaced) free (cmd_vars_replaced); } @@ -517,7 +517,8 @@ irc_command_exec_all_servers (const char *exclude_servers, const char *command) NULL, str_command); weechat_command (ptr_server->buffer, - (cmd_vars_replaced) ? cmd_vars_replaced : str_command); + (cmd_vars_replaced) ? + cmd_vars_replaced : str_command); if (cmd_vars_replaced) free (cmd_vars_replaced); } @@ -588,19 +589,18 @@ irc_command_me_channel_display (struct t_irc_server *server, irc_color_decode (arguments, weechat_config_boolean (irc_config_network_colors_send)) : NULL; ptr_nick = irc_nick_search (server, channel, server->nick); - weechat_printf_tags (channel->buffer, - irc_protocol_tags ("privmsg", - "irc_action,notify_none,no_highlight", - server->nick, - NULL), - "%s%s%s%s%s%s%s", - weechat_prefix ("action"), - irc_nick_mode_for_display (server, ptr_nick, 0), - IRC_COLOR_CHAT_NICK_SELF, - server->nick, - (string) ? IRC_COLOR_RESET : "", - (string) ? " " : "", - (string) ? string : ""); + weechat_printf_tags ( + channel->buffer, + irc_protocol_tags ("privmsg", "irc_action,notify_none,no_highlight", + server->nick, NULL), + "%s%s%s%s%s%s%s", + weechat_prefix ("action"), + irc_nick_mode_for_display (server, ptr_nick, 0), + IRC_COLOR_CHAT_NICK_SELF, + server->nick, + (string) ? IRC_COLOR_RESET : "", + (string) ? " " : "", + (string) ? string : ""); if (string) free (string); } @@ -619,12 +619,13 @@ irc_command_me_channel (struct t_irc_server *server, char hash_key[32]; const char *str_args; - hashtable = irc_server_sendf (server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_HASHTABLE, - NULL, - "PRIVMSG %s :\01ACTION %s\01", - channel->name, - (arguments && arguments[0]) ? arguments : ""); + hashtable = irc_server_sendf ( + server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_HASHTABLE, + NULL, + "PRIVMSG %s :\01ACTION %s\01", + channel->name, + (arguments && arguments[0]) ? arguments : ""); if (hashtable) { number = 1; @@ -970,11 +971,11 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc, pos_channel = ptr_channel->name; else { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "ban"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "ban"); return WEECHAT_RC_OK; } } @@ -1000,10 +1001,11 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "ban"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "ban"); return WEECHAT_RC_OK; } irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, @@ -1030,20 +1032,18 @@ irc_command_connect_one_server (struct t_irc_server *server, if (server->is_connected) { - weechat_printf (NULL, - _("%s%s: already connected to server " - "\"%s\"!"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->name); + weechat_printf ( + NULL, + _("%s%s: already connected to server \"%s\"!"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, server->name); return 0; } if (server->hook_connect) { - weechat_printf (NULL, - _("%s%s: currently connecting to server " - "\"%s\"!"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->name); + weechat_printf ( + NULL, + _("%s%s: currently connecting to server \"%s\"!"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, server->name); return 0; } @@ -1172,7 +1172,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, connect_ok = 0; } } - else + else if (weechat_config_boolean (irc_config_look_temporary_servers)) { if ((strncmp (argv[i], "irc", 3) == 0) && strstr (argv[i], "://")) @@ -1197,15 +1197,17 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, if (ptr_server) { ptr_server->temp_server = 1; - weechat_config_option_set (ptr_server->options[IRC_SERVER_OPTION_ADDRESSES], - argv[i], 1); - weechat_printf (NULL, - _("%s: server %s%s%s created " - "(temporary server, NOT SAVED!)"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_SERVER, - ptr_server->name, - IRC_COLOR_RESET); + weechat_config_option_set ( + ptr_server->options[IRC_SERVER_OPTION_ADDRESSES], + argv[i], 1); + weechat_printf ( + NULL, + _("%s: server %s%s%s created (temporary " + "server, NOT SAVED!)"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + ptr_server->name, + IRC_COLOR_RESET); irc_server_apply_command_line_options (ptr_server, argc, argv); if (!irc_command_connect_one_server (ptr_server, 0, 0)) @@ -1214,14 +1216,32 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, } if (!ptr_server) { - weechat_printf (NULL, - _("%s%s: unable to create temporary " - "server \"%s\" (check if there is " - "already a server with this name)"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, argv[i]); + weechat_printf ( + NULL, + _("%s%s: unable to create temporary server \"%s\" " + "(check if there is already a server with this " + "name)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[i]); } } + else + { + weechat_printf ( + NULL, + _("%s%s: unable to create temporary server \"%s\" " + "because the creation of temporary servers with " + "command /connect is currently disabled"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[i]); + weechat_printf ( + NULL, + _("%s%s: if you want to create a standard server, " + "use the command \"/server add\" (see /help " + "server); if you really want to create a temporary " + "server (NOT SAVED), turn on the option " + "irc.look.temporary_servers"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME); + } } else { @@ -1274,21 +1294,19 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, "PRIVMSG %s :\01PING %s\01", argv[1], str_time); - weechat_printf (irc_msgbuffer_get_target_buffer (ptr_server, - argv[1], - NULL, "ctcp", - NULL), - _("%sCTCP query to %s%s%s: %s%s%s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_message (ptr_server, - NULL, argv[1]), - argv[1], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - irc_cmd, - IRC_COLOR_RESET, - " ", - str_time); + weechat_printf ( + irc_msgbuffer_get_target_buffer ( + ptr_server, argv[1], NULL, "ctcp", NULL), + _("%sCTCP query to %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (ptr_server, 0, NULL, argv[1]), + argv[1], + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + irc_cmd, + IRC_COLOR_RESET, + " ", + str_time); } else { @@ -1298,21 +1316,19 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, irc_cmd, (argv_eol[3]) ? " " : "", (argv_eol[3]) ? argv_eol[3] : ""); - weechat_printf (irc_msgbuffer_get_target_buffer (ptr_server, - argv[1], - NULL, "ctcp", - NULL), - _("%sCTCP query to %s%s%s: %s%s%s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_message (ptr_server, NULL, - argv[1]), - argv[1], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - irc_cmd, - IRC_COLOR_RESET, - (argv_eol[3]) ? " " : "", - (argv_eol[3]) ? argv_eol[3] : ""); + weechat_printf ( + irc_msgbuffer_get_target_buffer ( + ptr_server, argv[1], NULL, "ctcp", NULL), + _("%sCTCP query to %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (ptr_server, 0, NULL, argv[1]), + argv[1], + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + irc_cmd, + IRC_COLOR_RESET, + (argv_eol[3]) ? " " : "", + (argv_eol[3]) ? argv_eol[3] : ""); } free (irc_cmd); @@ -1365,11 +1381,11 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can not be executed " - "on a server buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "cycle"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can not be executed on a server " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "cycle"); return WEECHAT_RC_OK; } @@ -1386,10 +1402,11 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can not be executed on " - "a server buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "part"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can not be executed on a server " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "part"); return WEECHAT_RC_OK; } @@ -1456,11 +1473,11 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc, sizeof (str_address), NULL, 0, NI_NUMERICHOST); if (rc != 0) { - weechat_printf (ptr_server->buffer, - _("%s%s: unable to resolve local address of server " - "socket: error %d %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - rc, gai_strerror (rc)); + weechat_printf ( + ptr_server->buffer, + _("%s%s: unable to resolve local address of server socket: error " + "%d %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, rc, gai_strerror (rc)); return WEECHAT_RC_OK; } @@ -1543,10 +1560,10 @@ irc_command_dehalfop (void *data, struct t_gui_buffer *buffer, int argc, if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be executed in " - "a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "dehalfop"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "dehalfop"); return WEECHAT_RC_OK; } @@ -1583,10 +1600,10 @@ irc_command_deop (void *data, struct t_gui_buffer *buffer, int argc, if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be executed in " - "a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "deop"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "deop"); return WEECHAT_RC_OK; } @@ -1623,10 +1640,10 @@ irc_command_devoice (void *data, struct t_gui_buffer *buffer, int argc, if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "devoice"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "devoice"); return WEECHAT_RC_OK; } @@ -1725,17 +1742,18 @@ irc_command_disconnect_one_server (struct t_irc_server *server, if ((!server->is_connected) && (!server->hook_connect) && (!server->hook_fd) && (server->reconnect_start == 0)) { - weechat_printf (server->buffer, - _("%s%s: not connected to server \"%s\"!"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->name); + weechat_printf ( + server->buffer, + _("%s%s: not connected to server \"%s\"!"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, server->name); return 0; } if (server->reconnect_start > 0) { - weechat_printf (server->buffer, - _("%s: auto-reconnection is cancelled"), - IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s: auto-reconnection is cancelled"), + IRC_PLUGIN_NAME); } irc_command_quit_server (server, reason); irc_server_disconnect (server, 0, 0); @@ -1810,10 +1828,10 @@ irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc, } else { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[1]); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[1]); disconnect_ok = 0; } } @@ -1840,10 +1858,10 @@ irc_command_halfop (void *data, struct t_gui_buffer *buffer, int argc, if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "halfop"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "halfop"); return WEECHAT_RC_OK; } @@ -1874,16 +1892,17 @@ irc_command_ignore_display (struct t_irc_ignore *ignore) mask = weechat_strndup (ignore->mask + 1, strlen (ignore->mask) - 2); - weechat_printf (NULL, - _(" %s[%s%d%s]%s mask: %s / server: %s / channel: %s"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - ignore->number, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (mask) ? mask : ignore->mask, - (ignore->server) ? ignore->server : "*", - (ignore->channel) ? ignore->channel : "*"); + weechat_printf ( + NULL, + _(" %s[%s%d%s]%s mask: %s / server: %s / channel: %s"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + ignore->number, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (mask) ? mask : ignore->mask, + (ignore->server) ? ignore->server : "*", + (ignore->channel) ? ignore->channel : "*"); if (mask) free (mask); @@ -2141,11 +2160,10 @@ irc_command_invite (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_OK; error: - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "invite"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "invite"); return WEECHAT_RC_OK; } @@ -2184,16 +2202,15 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments, char *new_args, **channels, **keys, *pos_space, *pos_keys, *pos_channel; char *channel_name; int i, num_channels, num_keys, length; - int time_now; + time_t time_now; struct t_irc_channel *ptr_channel; if (server->sock < 0) { - weechat_printf (NULL, - _("%s%s: command \"%s\" must be executed on " - "connected irc server"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "join"); + weechat_printf ( + NULL, + _("%s%s: command \"%s\" must be executed on connected irc server"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "join"); return; } @@ -2247,7 +2264,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments, } } new_args[0] = '\0'; - time_now = (int)time (NULL); + time_now = time (NULL); for (i = 0; i < num_channels; i++) { if (i > 0) @@ -2435,11 +2452,11 @@ irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "kick"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "kick"); return WEECHAT_RC_OK; } pos_channel = ptr_channel->name; @@ -2486,11 +2503,11 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "kickban"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "kickban"); return WEECHAT_RC_OK; } pos_channel = ptr_channel->name; @@ -2512,9 +2529,10 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc, if (strcmp (nick_only, "*") == 0) { - weechat_printf (ptr_server->buffer, - _("%s%s: mask must begin with nick"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + ptr_server->buffer, + _("%s%s: mask must begin with nick"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); free (nick_only); return WEECHAT_RC_OK; } @@ -2667,28 +2685,31 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc, { if (ptr_regex) { - ptr_server->cmd_list_regexp = malloc (sizeof (*ptr_server->cmd_list_regexp)); + ptr_server->cmd_list_regexp = malloc ( + sizeof (*ptr_server->cmd_list_regexp)); if (ptr_server->cmd_list_regexp) { - if ((ret = weechat_string_regcomp (ptr_server->cmd_list_regexp, ptr_regex, - REG_EXTENDED | REG_ICASE | REG_NOSUB)) != 0) + if ((ret = weechat_string_regcomp ( + ptr_server->cmd_list_regexp, ptr_regex, + REG_EXTENDED | REG_ICASE | REG_NOSUB)) != 0) { regerror (ret, ptr_server->cmd_list_regexp, buf, sizeof(buf)); - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" is not a valid regular " - "expression (%s)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv_eol[1], buf); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" is not a valid regular expression " + "(%s)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + argv_eol[1], buf); return WEECHAT_RC_OK; } } else { - weechat_printf (ptr_server->buffer, - _("%s%s: not enough memory for regular " - "expression"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + ptr_server->buffer, + _("%s%s: not enough memory for regular expression"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return WEECHAT_RC_OK; } } @@ -2785,10 +2806,10 @@ irc_command_me (void *data, struct t_gui_buffer *buffer, int argc, char **argv, if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can not be executed " - "on a server buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "me"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can not be executed on a server buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "me"); return WEECHAT_RC_OK; } @@ -2804,21 +2825,24 @@ irc_command_me (void *data, struct t_gui_buffer *buffer, int argc, char **argv, void irc_command_mode_server (struct t_irc_server *server, - struct t_irc_channel *channel, const char *arguments, + const char *command, + struct t_irc_channel *channel, + const char *arguments, int flags) { - if (server && (channel || arguments)) + if (server && command && (channel || arguments)) { if (channel && arguments) { irc_server_sendf (server, flags, NULL, - "MODE %s %s", - channel->name, arguments); + "%s %s %s", + command, channel->name, arguments); } else { irc_server_sendf (server, flags, NULL, - "MODE %s", + "%s %s", + command, (channel) ? channel->name : arguments); } } @@ -2845,20 +2869,21 @@ irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc, /* channel not specified, check we are on channel and use it */ if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: you must specify channel for \"%s\" " - "command if you're not in a channel"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "mode"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: you must specify channel for \"%s\" command if " + "you're not in a channel"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "mode"); return WEECHAT_RC_OK; } - irc_command_mode_server (ptr_server, ptr_channel, argv_eol[1], + irc_command_mode_server (ptr_server, "MODE", ptr_channel, + argv_eol[1], IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } else { /* user gives channel, use arguments as-is */ - irc_command_mode_server (ptr_server, NULL, argv_eol[1], + irc_command_mode_server (ptr_server, "MODE", NULL, argv_eol[1], IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } } @@ -2866,12 +2891,13 @@ irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc, { if (ptr_channel) { - irc_command_mode_server (ptr_server, ptr_channel, NULL, + irc_command_mode_server (ptr_server, "MODE", ptr_channel, NULL, IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } else { - irc_command_mode_server (ptr_server, NULL, ptr_server->nick, + irc_command_mode_server (ptr_server, "MODE", NULL, + ptr_server->nick, IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } } @@ -2954,12 +2980,11 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, || ((ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) && (ptr_channel->type != IRC_CHANNEL_TYPE_PRIVATE))) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel or private " - "buffer"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "msg *"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "or private buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "msg *"); return WEECHAT_RC_OK; } string = irc_color_decode (argv_eol[arg_text], @@ -2997,31 +3022,34 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, { if (ptr_channel) { - string = irc_color_decode (argv_eol[arg_text], - weechat_config_boolean (irc_config_network_colors_send)); + string = irc_color_decode ( + argv_eol[arg_text], + weechat_config_boolean (irc_config_network_colors_send)); if (status_msg) { /* * message to channel ops/voiced * (to "@#channel" or "+#channel") */ - weechat_printf_tags (ptr_channel->buffer, - "notify_none,no_highlight", - "%s%s%s -> %s%s%s: %s", - weechat_prefix ("network"), - "Msg", - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - targets[i], - IRC_COLOR_RESET, - (string) ? string : argv_eol[arg_text]); + weechat_printf_tags ( + ptr_channel->buffer, + "notify_none,no_highlight", + "%s%s%s -> %s%s%s: %s", + weechat_prefix ("network"), + "Msg", + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + targets[i], + IRC_COLOR_RESET, + (string) ? string : argv_eol[arg_text]); } else { /* standard message (to "#channel") */ - irc_input_user_message_display (ptr_channel->buffer, - 0, - (string) ? string : argv_eol[arg_text]); + irc_input_user_message_display ( + ptr_channel->buffer, + 0, + (string) ? string : argv_eol[arg_text]); } if (string) free (string); @@ -3050,25 +3078,26 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, if (hide_password) { /* hide password in message displayed using modifier */ - msg_pwd_hidden = weechat_hook_modifier_exec ("irc_message_auth", - ptr_server->name, - argv_eol[arg_text]); + msg_pwd_hidden = weechat_hook_modifier_exec ( + "irc_message_auth", + ptr_server->name, + argv_eol[arg_text]); string = irc_color_decode ( (msg_pwd_hidden) ? msg_pwd_hidden : argv_eol[arg_text], weechat_config_boolean (irc_config_network_colors_send)); - weechat_printf (ptr_server->buffer, - "%sMSG%s(%s%s%s)%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_message (ptr_server, - NULL, - targets[i]), - targets[i], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (string) ? - string : ((msg_pwd_hidden) ? - msg_pwd_hidden : argv_eol[arg_text])); + weechat_printf ( + ptr_server->buffer, + "%sMSG%s(%s%s%s)%s: %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (ptr_server, 0, NULL, + targets[i]), + targets[i], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (string) ? + string : ((msg_pwd_hidden) ? + msg_pwd_hidden : argv_eol[arg_text])); if (string) free (string); if (msg_pwd_hidden) @@ -3076,33 +3105,34 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, } else { - string = irc_color_decode (argv_eol[arg_text], - weechat_config_boolean (irc_config_network_colors_send)); + string = irc_color_decode ( + argv_eol[arg_text], + weechat_config_boolean (irc_config_network_colors_send)); ptr_channel = irc_channel_search (ptr_server, targets[i]); if (ptr_channel) { - irc_input_user_message_display (ptr_channel->buffer, - 0, - (string) ? string : argv_eol[arg_text]); + irc_input_user_message_display ( + ptr_channel->buffer, + 0, + (string) ? string : argv_eol[arg_text]); } else { - weechat_printf_tags (ptr_server->buffer, - irc_protocol_tags ("privmsg", - "notify_none,no_highlight", - ptr_server->nick, - NULL), - "%sMSG%s(%s%s%s)%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_message (ptr_server, - NULL, - targets[i]), - targets[i], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (string) ? string : argv_eol[arg_text]); + weechat_printf_tags ( + ptr_server->buffer, + irc_protocol_tags ( + "privmsg", "notify_none,no_highlight", + ptr_server->nick, NULL), + "%sMSG%s(%s%s%s)%s: %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg ( + ptr_server, 0, NULL, targets[i]), + targets[i], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (string) ? string : argv_eol[arg_text]); } if (string) free (string); @@ -3144,11 +3174,11 @@ irc_command_names (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "names"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "names"); return WEECHAT_RC_OK; } irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, @@ -3255,11 +3285,12 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, if (ptr_channel) is_channel = 1; } - hashtable = irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_HASHTABLE, - NULL, - "NOTICE %s :%s", - argv[arg_target], argv_eol[arg_text]); + hashtable = irc_server_sendf ( + ptr_server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_HASHTABLE, + NULL, + "NOTICE %s :%s", + argv[arg_target], argv_eol[arg_text]); if (hashtable) { number = 1; @@ -3269,24 +3300,24 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, str_args = weechat_hashtable_get (hashtable, hash_key); if (!str_args) break; - string = irc_color_decode (str_args, - weechat_config_boolean (irc_config_network_colors_send)); - weechat_printf_tags (irc_msgbuffer_get_target_buffer (ptr_server, - argv[arg_target], - "notice", - NULL, - (ptr_channel) ? ptr_channel->buffer : NULL), - "notify_none,no_highlight", - "%s%s%s%s -> %s%s%s: %s", - weechat_prefix ("network"), - IRC_COLOR_NOTICE, - /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ - _("Notice"), - IRC_COLOR_RESET, - (is_channel) ? IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_message (ptr_server, NULL, argv[arg_target]), - argv[arg_target], - IRC_COLOR_RESET, - (string) ? string : str_args); + string = irc_color_decode ( + str_args, + weechat_config_boolean (irc_config_network_colors_send)); + weechat_printf_tags ( + irc_msgbuffer_get_target_buffer ( + ptr_server, argv[arg_target], "notice", NULL, + (ptr_channel) ? ptr_channel->buffer : NULL), + "notify_none,no_highlight", + "%s%s%s%s -> %s%s%s: %s", + weechat_prefix ("network"), + IRC_COLOR_NOTICE, + /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ + _("Notice"), + IRC_COLOR_RESET, + (is_channel) ? IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (ptr_server, 0, NULL, argv[arg_target]), + argv[arg_target], + IRC_COLOR_RESET, + (string) ? string : str_args); if (string) free (string); number++; @@ -3335,20 +3366,21 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, ptr_server = irc_server_search (argv[3]); if (!ptr_server) { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[3]); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[3]); return WEECHAT_RC_OK; } } if (!ptr_server) { - weechat_printf (NULL, - _("%s%s: server must be specified because you are " - "not on an irc server or channel"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: server must be specified because you are not on an " + "irc server or channel"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return WEECHAT_RC_OK; } @@ -3364,18 +3396,20 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, ptr_notify = irc_notify_search (ptr_server, argv[2]); if (ptr_notify) { - weechat_printf (NULL, - _("%s%s: notify already exists"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: notify already exists"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); 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); + weechat_printf ( + ptr_server->buffer, + _("%sMonitor list is full (%d)"), + weechat_prefix ("error"), ptr_server->monitor); return WEECHAT_RC_OK; } @@ -3383,20 +3417,21 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, if (ptr_notify) { irc_notify_set_server_option (ptr_server); - weechat_printf (ptr_server->buffer, - _("%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, - weechat_color ("reset")); + weechat_printf ( + ptr_server->buffer, + _("%s: notification added for %s%s%s"), + IRC_PLUGIN_NAME, + irc_nick_color_for_msg (ptr_server, 1, NULL, ptr_notify->nick), + ptr_notify->nick, + weechat_color ("reset")); irc_notify_check_now (ptr_notify); } else { - weechat_printf (NULL, _("%s%s: error adding notification"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: error adding notification"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); } return WEECHAT_RC_OK; @@ -3413,20 +3448,21 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, ptr_server = irc_server_search (argv[3]); if (!ptr_server) { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[3]); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[3]); return WEECHAT_RC_OK; } } if (!ptr_server) { - weechat_printf (NULL, - _("%s%s: server must be specified because you are " - "not on an irc server or channel"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: server must be specified because you are not on an " + "irc server or channel"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return WEECHAT_RC_OK; } @@ -3436,13 +3472,17 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, { irc_notify_free_all (ptr_server); irc_notify_set_server_option (ptr_server); - weechat_printf (NULL, _("%s: all notifications deleted"), - IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s: all notifications deleted"), + IRC_PLUGIN_NAME); } else { - weechat_printf (NULL, _("%s: no notification in list"), - IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s: no notification in list"), + IRC_PLUGIN_NAME); } } else @@ -3450,22 +3490,23 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, ptr_notify = irc_notify_search (ptr_server, argv[2]); if (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")); + weechat_printf ( + ptr_server->buffer, + _("%s: notification deleted for %s%s%s"), + IRC_PLUGIN_NAME, + irc_nick_color_for_msg (ptr_server, 1, 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); } else { - weechat_printf (NULL, - _("%s%s: notification not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: notification not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return WEECHAT_RC_OK; } } @@ -3493,10 +3534,10 @@ irc_command_op (void *data, struct t_gui_buffer *buffer, int argc, char **argv, if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "op"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "op"); return WEECHAT_RC_OK; } @@ -3601,12 +3642,11 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel or " - "private buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "part"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "or private buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "part"); return WEECHAT_RC_OK; } channel_name = ptr_channel->name; @@ -3617,11 +3657,11 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel or private " - "buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "part"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel or " + "private buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "part"); return WEECHAT_RC_OK; } if (!ptr_channel->nicks) @@ -3731,11 +3771,10 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc, nicks[i], 1, 0); if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: cannot create new private " - "buffer \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - nicks[i]); + weechat_printf ( + ptr_server->buffer, + _("%s%s: cannot create new private buffer \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, nicks[i]); } } @@ -3804,11 +3843,11 @@ irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc, pos_channel = ptr_channel->name; else { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "quiet"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "quiet"); return WEECHAT_RC_OK; } } @@ -3835,10 +3874,11 @@ irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc, { if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "quiet"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "quiet"); return WEECHAT_RC_OK; } irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, @@ -3996,10 +4036,10 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, } else { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[i]); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[i]); reconnect_ok = 0; } } @@ -4078,11 +4118,10 @@ irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc, if (!ptr_channel_name) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "remove"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "remove"); return WEECHAT_RC_OK; } @@ -4177,11 +4216,48 @@ irc_command_samode (void *data, struct t_gui_buffer *buffer, int argc, /* make C compiler happy */ (void) data; - if (argc < 3) - return WEECHAT_RC_ERROR; - - irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "SAMODE %s %s", argv[1], argv_eol[2]); + if (argc > 1) + { + if ((argv[1][0] == '+') || (argv[1][0] == '-')) + { + /* channel not specified, check we are on channel and use it */ + if (!ptr_channel) + { + weechat_printf ( + ptr_server->buffer, + _("%s%s: you must specify channel for \"%s\" command if " + "you're not in a channel"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "samode"); + return WEECHAT_RC_OK; + } + irc_command_mode_server (ptr_server, "SAMODE", ptr_channel, + argv_eol[1], + IRC_SERVER_SEND_OUTQ_PRIO_HIGH); + } + else + { + /* user gives channel, use arguments as-is */ + irc_command_mode_server (ptr_server, "SAMODE", NULL, argv_eol[1], + IRC_SERVER_SEND_OUTQ_PRIO_HIGH); + } + } + else + { + if (ptr_channel) + { + irc_command_mode_server (ptr_server, "SAMODE", ptr_channel, NULL, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH); + } + else + { + weechat_printf ( + ptr_server->buffer, + _("%s%s: you must specify channel for \"%s\" command if " + "you're not in a channel"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "samode"); + return WEECHAT_RC_OK; + } + } return WEECHAT_RC_OK; } @@ -4597,28 +4673,32 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) { num_channels = irc_server_get_channel_count (server); num_pv = irc_server_get_pv_count (server); - weechat_printf (NULL, " %s %s%s %s[%s%s%s]%s%s, %d %s, %d pv", - (server->is_connected) ? "*" : " ", - IRC_COLOR_CHAT_SERVER, - server->name, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (server->is_connected) ? - _("connected") : _("not connected"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (server->temp_server) ? _(" (temporary)") : "", - num_channels, - NG_("channel", "channels", num_channels), - num_pv); + weechat_printf ( + NULL, + " %s %s%s %s[%s%s%s]%s%s, %d %s, %d pv", + (server->is_connected) ? "*" : " ", + IRC_COLOR_CHAT_SERVER, + server->name, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (server->is_connected) ? + _("connected") : _("not connected"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (server->temp_server) ? _(" (temporary)") : "", + num_channels, + NG_("channel", "channels", num_channels), + num_pv); } else { - weechat_printf (NULL, " %s%s%s%s", - IRC_COLOR_CHAT_SERVER, - server->name, - IRC_COLOR_RESET, - (server->temp_server) ? _(" (temporary)") : ""); + weechat_printf ( + NULL, + " %s%s%s%s", + IRC_COLOR_CHAT_SERVER, + server->name, + IRC_COLOR_RESET, + (server->temp_server) ? _(" (temporary)") : ""); } } } @@ -4709,33 +4789,34 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, ptr_server2 = irc_server_casesearch (argv[2]); if (ptr_server2) { - weechat_printf (NULL, - _("%s%s: server \"%s\" already exists, " - "can't create it!"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - ptr_server2->name); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" already exists, can't create it!"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, ptr_server2->name); return WEECHAT_RC_OK; } new_server = irc_server_alloc (argv[2]); if (!new_server) { - weechat_printf (NULL, - _("%s%s: unable to create server"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: unable to create server"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return WEECHAT_RC_OK; } - weechat_config_option_set (new_server->options[IRC_SERVER_OPTION_ADDRESSES], - argv[3], 1); + weechat_config_option_set ( + new_server->options[IRC_SERVER_OPTION_ADDRESSES], argv[3], 1); irc_server_apply_command_line_options (new_server, argc, argv); - weechat_printf (NULL, - _("%s: server %s%s%s created"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_SERVER, - new_server->name, - IRC_COLOR_RESET); + weechat_printf ( + NULL, + _("%s: server %s%s%s created"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + new_server->name, + IRC_COLOR_RESET); /* do not connect to server after creating it */ /* @@ -4755,11 +4836,11 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, server_found = irc_server_search (argv[2]); if (!server_found) { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[2], "server copy"); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + argv[2], "server copy"); return WEECHAT_RC_OK; } @@ -4767,11 +4848,11 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, ptr_server2 = irc_server_casesearch (argv[3]); if (ptr_server2) { - weechat_printf (NULL, - _("%s%s: server \"%s\" already exists for " - "\"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - ptr_server2->name, "server copy"); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" already exists for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + ptr_server2->name, "server copy"); return WEECHAT_RC_OK; } @@ -4779,16 +4860,16 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, new_server = irc_server_copy (server_found, argv[3]); if (new_server) { - weechat_printf (NULL, - _("%s: server %s%s%s has been copied to " - "%s%s%s"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_SERVER, - argv[2], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_SERVER, - argv[3], - IRC_COLOR_RESET); + weechat_printf ( + NULL, + _("%s: server %s%s%s has been copied to %s%s%s"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + argv[2], + IRC_COLOR_RESET, + IRC_COLOR_CHAT_SERVER, + argv[3], + IRC_COLOR_RESET); return WEECHAT_RC_OK; } @@ -4804,11 +4885,11 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, server_found = irc_server_search (argv[2]); if (!server_found) { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[2], "server rename"); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + argv[2], "server rename"); return WEECHAT_RC_OK; } @@ -4816,27 +4897,27 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, ptr_server2 = irc_server_casesearch (argv[3]); if (ptr_server2) { - weechat_printf (NULL, - _("%s%s: server \"%s\" already exists for " - "\"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - ptr_server2->name, "server rename"); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" already exists for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + ptr_server2->name, "server rename"); return WEECHAT_RC_OK; } /* rename server */ if (irc_server_rename (server_found, argv[3])) { - weechat_printf (NULL, - _("%s: server %s%s%s has been renamed to " - "%s%s%s"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_SERVER, - argv[2], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_SERVER, - argv[3], - IRC_COLOR_RESET); + weechat_printf ( + NULL, + _("%s: server %s%s%s has been renamed to %s%s%s"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + argv[2], + IRC_COLOR_RESET, + IRC_COLOR_CHAT_SERVER, + argv[3], + IRC_COLOR_RESET); return WEECHAT_RC_OK; } @@ -4852,33 +4933,35 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, server_found = irc_server_search (argv[2]); if (!server_found) { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[2], "server keep"); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + argv[2], "server keep"); return WEECHAT_RC_OK; } /* check that is it temporary server */ if (!server_found->temp_server) { - weechat_printf (NULL, - _("%s%s: server \"%s\" is not a temporary server"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[2], "server keep"); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" is not a temporary server"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + argv[2], "server keep"); return WEECHAT_RC_OK; } /* remove temporary flag on server */ server_found->temp_server = 0; - weechat_printf (NULL, - _("%s: server %s%s%s is not temporary any more"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_SERVER, - argv[2], - IRC_COLOR_RESET); + weechat_printf ( + NULL, + _("%s: server %s%s%s is not temporary any more"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + argv[2], + IRC_COLOR_RESET); return WEECHAT_RC_OK; } @@ -4892,32 +4975,32 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, server_found = irc_server_search (argv[2]); if (!server_found) { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for " - "\"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[2], "server del"); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + argv[2], "server del"); return WEECHAT_RC_OK; } if (server_found->is_connected) { - weechat_printf (NULL, - _("%s%s: you can not delete server \"%s\" " - "because you are connected to. " - "Try \"/disconnect %s\" before."), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[2], argv[2]); + weechat_printf ( + NULL, + _("%s%s: you can not delete server \"%s\" because you are " + "connected to. Try \"/disconnect %s\" before."), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[2], argv[2]); return WEECHAT_RC_OK; } server_name = strdup (server_found->name); irc_server_free (server_found); - weechat_printf (NULL, - _("%s: server %s%s%s has been deleted"), - IRC_PLUGIN_NAME, - IRC_COLOR_CHAT_SERVER, - (server_name) ? server_name : "???", - IRC_COLOR_RESET); + weechat_printf ( + NULL, + _("%s: server %s%s%s has been deleted"), + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + (server_name) ? server_name : "???", + IRC_COLOR_RESET); if (server_name) free (server_name); @@ -4934,11 +5017,11 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, irc_server_outqueue_free_all (ptr_server2, i); } } - weechat_printf (NULL, - _("%s: messages outqueue DELETED for all " - "servers. Some messages from you or " - "WeeChat may have been lost!"), - IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s: messages outqueue DELETED for all servers. Some messages " + "from you or WeeChat may have been lost!"), + IRC_PLUGIN_NAME); return WEECHAT_RC_OK; } @@ -5211,11 +5294,11 @@ irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc, } else { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "topic"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "topic"); return WEECHAT_RC_OK; } } @@ -5229,8 +5312,9 @@ irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc, } else { - new_topic_color = irc_color_encode (new_topic, - weechat_config_boolean (irc_config_network_colors_send)); + new_topic_color = irc_color_encode ( + new_topic, + weechat_config_boolean (irc_config_network_colors_send)); irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, "TOPIC %s :%s", channel_name, @@ -5316,11 +5400,11 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc, pos_channel = ptr_channel->name; else { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "unban"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "unban"); return WEECHAT_RC_OK; } } @@ -5375,11 +5459,11 @@ irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc, pos_channel = ptr_channel->name; else { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "unquiet"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "unquiet"); return WEECHAT_RC_OK; } } @@ -5515,10 +5599,10 @@ irc_command_voice (void *data, struct t_gui_buffer *buffer, int argc, if (!ptr_channel || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)) { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "voice"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "voice"); return WEECHAT_RC_OK; } @@ -5578,11 +5662,11 @@ irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc, pos_channel = ptr_channel->name; else { - weechat_printf (ptr_server->buffer, - _("%s%s: \"%s\" command can only be " - "executed in a channel buffer"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "wallchops"); + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "wallchops"); return WEECHAT_RC_OK; } } @@ -5590,24 +5674,25 @@ irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc, ptr_channel = irc_channel_search (ptr_server, pos_channel); if (!ptr_channel) { - weechat_printf (ptr_server->buffer, - _("%s%s: you are not on channel \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - pos_channel); + weechat_printf ( + ptr_server->buffer, + _("%s%s: you are not on channel \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, pos_channel); return WEECHAT_RC_OK; } - weechat_printf (ptr_channel->buffer, - "%s%s%sOp%s -> %s%s%s: %s", - weechat_prefix ("network"), - IRC_COLOR_NOTICE, - /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ - _("Notice"), - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - ptr_channel->name, - IRC_COLOR_RESET, - argv_eol[pos_args]); + weechat_printf ( + ptr_channel->buffer, + "%s%s%sOp%s -> %s%s%s: %s", + weechat_prefix ("network"), + IRC_COLOR_NOTICE, + /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ + _("Notice"), + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + ptr_channel->name, + IRC_COLOR_RESET, + argv_eol[pos_args]); support_wallchops = irc_server_get_isupport_value (ptr_server, "WALLCHOPS"); @@ -5873,10 +5958,11 @@ irc_command_init () N_(" server: server name, which can be:\n" " - internal server name (created by /server add, " "recommended usage)\n" - " - hostname/port or IP/port (this will create a TEMPORARY " - "server), port is 6667 by default\n" + " - hostname/port or IP/port, port is 6667 by default\n" " - URL with format: irc[6][s]://[nickname[:password]@]" "irc.example.org[:port][/#channel1][,#channel2[...]]\n" + " Note: for an address/IP/URL, a temporary server is " + "created (NOT SAVED), see /help irc.look.temporary_servers\n" " option: set option for server (for boolean option, value can be " "omitted)\n" " nooption: set boolean option to 'off' (for example: -nossl)\n" @@ -6176,7 +6262,7 @@ irc_command_init () N_("server: send to this server (internal name)\n" "target: nick or channel (may be mask, '*' = current channel)\n" " text: text to send"), - "-server %(irc_servers)" + "-server %(irc_servers) %(nicks)" " || %(nicks)", &irc_command_msg, NULL); weechat_hook_command ( @@ -6201,7 +6287,9 @@ irc_command_init () N_("server: send to this server (internal name)\n" "target: nick or channel name\n" " text: text to send"), - "%(nicks)|-server %(irc_servers)", &irc_command_notice, NULL); + "-server %(irc_servers) %(nicks)" + " || %(nicks)", + &irc_command_notice, NULL); weechat_hook_command ( "notify", N_("add a notification for presence or away status of nicks on servers"), @@ -6270,7 +6358,9 @@ irc_command_init () N_("server: send to this server (internal name)\n" " nick: nick\n" " text: text to send"), - "%(nicks)|-server %(irc_servers)", &irc_command_query, NULL); + "-server %(irc_servers) %(nicks)" + " || %(nicks)", + &irc_command_query, NULL); weechat_hook_command ( "quiet", N_("quiet nicks or hosts"), @@ -6331,7 +6421,7 @@ irc_command_init () weechat_hook_command ( "samode", N_("change mode on channel, without having operator status"), - N_("<channel> <mode>"), + N_("[<channel>] <mode>"), N_("channel: channel name\n" " mode: mode for channel"), "%(irc_server_channels)", &irc_command_samode, NULL); diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h index bb5c5342a..6ea8c2f08 100644 --- a/src/plugins/irc/irc-command.h +++ b/src/plugins/irc/irc-command.h @@ -51,6 +51,7 @@ extern void irc_command_join_server (struct t_irc_server *server, int manual_join, int noswitch); extern void irc_command_mode_server (struct t_irc_server *server, + const char *command, struct t_irc_channel *channel, const char *arguments, int flags); diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c index f667f1b9a..4c508af88 100644 --- a/src/plugins/irc/irc-completion.c +++ b/src/plugins/irc/irc-completion.c @@ -262,7 +262,8 @@ irc_completion_channel_nicks_add_speakers (struct t_gui_completion *completion, list_size = weechat_list_size (channel->nicks_speaking[highlight]); for (i = 0; i < list_size; i++) { - nick = weechat_list_string (weechat_list_get (channel->nicks_speaking[highlight], i)); + nick = weechat_list_string ( + weechat_list_get (channel->nicks_speaking[highlight], i)); if (nick && irc_nick_search (server, channel, nick)) { weechat_hook_completion_list_add (completion, @@ -379,20 +380,16 @@ irc_completion_channel_nicks_hosts_cb (void *data, const char *completion_item, { snprintf (buf, length, "%s!%s", ptr_nick->name, ptr_nick->host); - weechat_hook_completion_list_add (completion, - buf, - 0, - WEECHAT_LIST_POS_SORT); + weechat_hook_completion_list_add ( + completion, buf, 0, WEECHAT_LIST_POS_SORT); free (buf); } } } break; case IRC_CHANNEL_TYPE_PRIVATE: - weechat_hook_completion_list_add (completion, - ptr_channel->name, - 1, - WEECHAT_LIST_POS_SORT); + weechat_hook_completion_list_add ( + completion, ptr_channel->name, 1, WEECHAT_LIST_POS_SORT); break; } } diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 891571829..81c4742ab 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -103,6 +103,7 @@ struct t_config_option *irc_config_look_smart_filter_join_unmask; struct t_config_option *irc_config_look_smart_filter_mode; struct t_config_option *irc_config_look_smart_filter_nick; struct t_config_option *irc_config_look_smart_filter_quit; +struct t_config_option *irc_config_look_temporary_servers; struct t_config_option *irc_config_look_topic_strip_colors; /* IRC config, color section */ @@ -242,9 +243,11 @@ irc_config_set_nick_colors () } irc_config_nick_colors = - weechat_string_split (weechat_config_string (weechat_config_get ("weechat.color.chat_nick_colors")), - ",", 0, 0, - &irc_config_num_nick_colors); + weechat_string_split ( + weechat_config_string ( + weechat_config_get ("weechat.color.chat_nick_colors")), + ",", 0, 0, + &irc_config_num_nick_colors); } /* @@ -337,17 +340,19 @@ irc_config_change_look_display_join_message (void *data, if (!irc_config_hashtable_display_join_message) { - irc_config_hashtable_display_join_message = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + irc_config_hashtable_display_join_message = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); } else weechat_hashtable_remove_all (irc_config_hashtable_display_join_message); - items = weechat_string_split (weechat_config_string (irc_config_look_display_join_message), - ",", 0, 0, &num_items); + items = weechat_string_split ( + weechat_config_string (irc_config_look_display_join_message), + ",", 0, 0, &num_items); if (items) { for (i = 0; i < num_items; i++) @@ -519,16 +524,18 @@ irc_config_change_look_highlight_tags_restrict (void *data, { if (ptr_server->buffer) { - weechat_buffer_set (ptr_server->buffer, "highlight_tags_restrict", - weechat_config_string (irc_config_look_highlight_tags_restrict)); + weechat_buffer_set ( + ptr_server->buffer, "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { if (ptr_channel->buffer) { - weechat_buffer_set (ptr_channel->buffer, "highlight_tags_restrict", - weechat_config_string (irc_config_look_highlight_tags_restrict)); + weechat_buffer_set ( + ptr_channel->buffer, "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } } } @@ -551,17 +558,19 @@ irc_config_change_look_nick_color_force (void *data, if (!irc_config_hashtable_nick_color_force) { - irc_config_hashtable_nick_color_force = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + irc_config_hashtable_nick_color_force = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); } else weechat_hashtable_remove_all (irc_config_hashtable_nick_color_force); - items = weechat_string_split (weechat_config_string (irc_config_look_nick_color_force), - ";", 0, 0, &num_items); + items = weechat_string_split ( + weechat_config_string (irc_config_look_nick_color_force), + ";", 0, 0, &num_items); if (items) { for (i = 0; i < num_items; i++) @@ -637,9 +646,9 @@ irc_config_change_look_nicks_hide_password (void *data, nicks_hide_password = weechat_config_string (irc_config_look_nicks_hide_password); if (nicks_hide_password && nicks_hide_password[0]) { - irc_config_nicks_hide_password = weechat_string_split (nicks_hide_password, - ",", 0, 0, - &irc_config_num_nicks_hide_password); + irc_config_nicks_hide_password = weechat_string_split ( + nicks_hide_password, ",", 0, 0, + &irc_config_num_nicks_hide_password); } } @@ -651,11 +660,23 @@ void irc_config_change_look_topic_strip_colors (void *data, struct t_config_option *option) { + struct t_irc_server *ptr_server; + struct t_irc_channel *ptr_channel; + /* make C compiler happy */ (void) data; (void) option; - weechat_bar_item_update ("buffer_title"); + for (ptr_server = irc_servers; ptr_server; + ptr_server = ptr_server->next_server) + { + for (ptr_channel = ptr_server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) + { + if (ptr_channel->buffer) + irc_channel_set_buffer_title (ptr_channel); + } + } } /* @@ -751,17 +772,19 @@ irc_config_change_color_mirc_remap (void *data, struct t_config_option *option) if (!irc_config_hashtable_color_mirc_remap) { - irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + irc_config_hashtable_color_mirc_remap = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); } else weechat_hashtable_remove_all (irc_config_hashtable_color_mirc_remap); - items = weechat_string_split (weechat_config_string (irc_config_color_mirc_remap), - ";", 0, 0, &num_items); + items = weechat_string_split ( + weechat_config_string (irc_config_color_mirc_remap), + ";", 0, 0, &num_items); if (items) { for (i = 0; i < num_items; i++) @@ -796,17 +819,19 @@ irc_config_change_color_nick_prefixes (void *data, if (!irc_config_hashtable_nick_prefixes) { - irc_config_hashtable_nick_prefixes = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + irc_config_hashtable_nick_prefixes = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); } else weechat_hashtable_remove_all (irc_config_hashtable_nick_prefixes); - items = weechat_string_split (weechat_config_string (irc_config_color_nick_prefixes), - ";", 0, 0, &num_items); + items = weechat_string_split ( + weechat_config_string (irc_config_color_nick_prefixes), + ";", 0, 0, &num_items); if (items) { for (i = 0; i < num_items; i++) @@ -1056,7 +1081,8 @@ irc_config_server_check_value_cb (void *data, { while (weechat_infolist_next (infolist)) { - proxy_name = weechat_infolist_string (infolist, "name"); + proxy_name = weechat_infolist_string (infolist, + "name"); if (proxy_name && (strcmp (value, proxy_name) == 0)) { proxy_found = 1; @@ -1067,12 +1093,11 @@ irc_config_server_check_value_cb (void *data, } if (!proxy_found) { - weechat_printf (NULL, - _("%s%s: warning: proxy \"%s\" does not " - "exist (you can create it with command " - "/proxy)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - value); + weechat_printf ( + NULL, + _("%s%s: warning: proxy \"%s\" does not exist " + "(you can create it with command /proxy)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, value); } } break; @@ -1080,18 +1105,19 @@ irc_config_server_check_value_cb (void *data, pos_error = irc_config_check_gnutls_priorities (value); if (pos_error) { - weechat_printf (NULL, - _("%s%s: invalid priorities string, error " - "at this position in string: \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - pos_error); + weechat_printf ( + NULL, + _("%s%s: invalid priorities string, error at this " + "position in string: \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, pos_error); return 0; } break; case IRC_SERVER_OPTION_SSL_FINGERPRINT: if (value && value[0] && (strlen (value) != 40)) { - fingerprints = weechat_string_split (value, ",", 0, 0, NULL); + fingerprints = weechat_string_split (value, ",", 0, 0, + NULL); if (fingerprints) { rc = 1; @@ -1106,12 +1132,11 @@ irc_config_server_check_value_cb (void *data, weechat_string_free_split (fingerprints); if (!rc) { - weechat_printf (NULL, - _("%s%s: fingerprint must have " - "exactly 40 hexadecimal " - "digits"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: fingerprint must have exactly 40 " + "hexadecimal digits"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return 0; } } @@ -1144,14 +1169,16 @@ irc_config_server_change_cb (void *data, struct t_config_option *option) switch (index_option) { case IRC_SERVER_OPTION_ADDRESSES: - irc_server_set_addresses (ptr_server, - IRC_SERVER_OPTION_STRING(ptr_server, - IRC_SERVER_OPTION_ADDRESSES)); + irc_server_set_addresses ( + ptr_server, + IRC_SERVER_OPTION_STRING(ptr_server, + IRC_SERVER_OPTION_ADDRESSES)); break; case IRC_SERVER_OPTION_NICKS: - irc_server_set_nicks (ptr_server, - IRC_SERVER_OPTION_STRING(ptr_server, - IRC_SERVER_OPTION_NICKS)); + irc_server_set_nicks ( + ptr_server, + IRC_SERVER_OPTION_STRING(ptr_server, + IRC_SERVER_OPTION_NICKS)); break; case IRC_SERVER_OPTION_AWAY_CHECK: case IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS: @@ -1234,12 +1261,13 @@ irc_config_reload (void *data, struct t_config_file *config_file) { if (ptr_server->is_connected) { - weechat_printf (NULL, - _("%s%s: warning: server \"%s\" not found " - "in configuration file, not deleted in " - "memory because it's currently used"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - ptr_server->name); + weechat_printf ( + NULL, + _("%s%s: warning: server \"%s\" not found in " + "configuration file, not deleted in memory because it's " + "currently used"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + ptr_server->name); } else irc_server_free (ptr_server); @@ -1295,7 +1323,8 @@ irc_config_msgbuffer_create_option (void *data, "weechat|server|current|private", 0, 0, value, value, 0, NULL, NULL, NULL, NULL, NULL, NULL); rc = (ptr_option) ? - WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; + WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : + WEECHAT_CONFIG_OPTION_SET_ERROR; } else rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; @@ -1304,10 +1333,10 @@ irc_config_msgbuffer_create_option (void *data, if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) { - weechat_printf (NULL, - _("%s%s: error creating \"%s\" => \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - option_name, value); + weechat_printf ( + NULL, + _("%s%s: error creating \"%s\" => \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, option_name, value); } return rc; @@ -1374,7 +1403,8 @@ irc_config_ctcp_create_option (void *data, struct t_config_file *config_file, NULL, 0, 0, default_value, value, 0, NULL, NULL, NULL, NULL, NULL, NULL); rc = (ptr_option) ? - WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; + WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : + WEECHAT_CONFIG_OPTION_SET_ERROR; } else rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; @@ -1383,10 +1413,10 @@ irc_config_ctcp_create_option (void *data, struct t_config_file *config_file, if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) { - weechat_printf (NULL, - _("%s%s: error creating CTCP \"%s\" => \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - option_name, value); + weechat_printf ( + NULL, + _("%s%s: error creating CTCP \"%s\" => \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, option_name, value); } return rc; @@ -1540,7 +1570,8 @@ irc_config_server_new_option (struct t_config_file *config_file, new_option = weechat_config_new_option ( config_file, section, option_name, "string", - N_("list of hostname/port or IP/port for server (separated by comma)"), + N_("list of hostname/port or IP/port for server (separated by " + "comma)"), NULL, 0, 0, default_value, value, null_value_allowed, @@ -1552,8 +1583,8 @@ irc_config_server_new_option (struct t_config_file *config_file, new_option = weechat_config_new_option ( config_file, section, option_name, "string", - N_("name of proxy used for this server (optional, proxy must be " - "defined with command /proxy)"), + N_("name of proxy used for this server (optional, proxy must " + "be defined with command /proxy)"), NULL, 0, 0, default_value, value, null_value_allowed, @@ -1619,7 +1650,8 @@ irc_config_server_new_option (struct t_config_file *config_file, new_option = weechat_config_new_option ( config_file, section, option_name, "integer", - N_("size of the key used during the Diffie-Hellman Key Exchange"), + N_("size of the key used during the Diffie-Hellman Key " + "Exchange"), NULL, 0, INT_MAX, default_value, value, null_value_allowed, @@ -1676,8 +1708,8 @@ irc_config_server_new_option (struct t_config_file *config_file, /* TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) */ N_("comma-separated list of client capabilities to enable for " "server if they are available; capabilities supported by " - "WeeChat are: away-notify, multi-prefix, server-time, " - "userhost-in-names, (example: " + "WeeChat are: away-notify, extended-join, multi-prefix, " + "server-time, userhost-in-names (example: " "\"away-notify,multi-prefix\")"), NULL, 0, 0, default_value, value, @@ -1768,7 +1800,8 @@ irc_config_server_new_option (struct t_config_file *config_file, new_option = weechat_config_new_option ( config_file, section, option_name, "integer", - N_("delay (in seconds) before trying again to reconnect to server"), + N_("delay (in seconds) before trying again to reconnect to " + "server"), NULL, 1, 65535, default_value, value, null_value_allowed, @@ -2077,21 +2110,21 @@ irc_config_server_read_cb (void *data, struct t_config_file *config_file, { for (i = 0; i < IRC_SERVER_NUM_OPTIONS; i++) { - weechat_config_option_set (ptr_server->options[i], - NULL, 1); + weechat_config_option_set ( + ptr_server->options[i], NULL, 1); } ptr_server->reloaded_from_config = 1; } - rc = weechat_config_option_set (ptr_server->options[index_option], - value, 1); + rc = weechat_config_option_set ( + ptr_server->options[index_option], value, 1); } else { - weechat_printf (NULL, - _("%s%s: error creating server " - "\"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server_name); + weechat_printf ( + NULL, + _("%s%s: error creating server \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + server_name); } } free (server_name); @@ -2101,10 +2134,10 @@ irc_config_server_read_cb (void *data, struct t_config_file *config_file, if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR) { - weechat_printf (NULL, - _("%s%s: error creating server option \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - option_name); + weechat_printf ( + NULL, + _("%s%s: error creating server option \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, option_name); } return rc; @@ -2235,26 +2268,30 @@ irc_config_init () { struct t_config_section *ptr_section; - irc_config_hashtable_display_join_message = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); - irc_config_hashtable_nick_color_force = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); - irc_config_hashtable_nick_prefixes = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); - irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + irc_config_hashtable_display_join_message = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); + irc_config_hashtable_nick_color_force = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); + irc_config_hashtable_nick_prefixes = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); + irc_config_hashtable_color_mirc_remap = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); irc_config_file = weechat_config_new (IRC_CONFIG_NAME, &irc_config_reload, NULL); @@ -2519,9 +2556,9 @@ irc_config_init () irc_config_look_nick_color_hash = weechat_config_new_option ( irc_config_file, ptr_section, "nick_color_hash", "integer", - N_("hash algorithm used to find the color for a nick: djb2 = variant of " - "djb2 (position of letters matters: anagrams of a nick have different " - "color), sum = sum of letters"), + N_("hash algorithm used to find the color for a nick: djb2 = variant " + "of djb2 (position of letters matters: anagrams of a nick have " + "different color), sum = sum of letters"), "djb2|sum", 0, 0, "sum", NULL, 0, NULL, NULL, &irc_config_change_look_nick_colors, NULL, NULL, NULL); irc_config_look_nick_color_stop_chars = weechat_config_new_option ( @@ -2555,7 +2592,7 @@ irc_config_init () N_("display a space if nick mode is enabled but nick has no mode (not " "op, voice, ...)"), NULL, 0, 0, "off", NULL, 0, NULL, NULL, - NULL, NULL, NULL, NULL); + &irc_config_change_bar_item_input_prompt, NULL, NULL, NULL); irc_config_look_notice_as_pv = weechat_config_new_option ( irc_config_file, ptr_section, "notice_as_pv", "integer", @@ -2678,6 +2715,12 @@ irc_config_init () /* TRANSLATORS: please do not translate "part" and "quit" */ N_("enable smart filter for \"part\" and \"quit\" messages"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_temporary_servers = weechat_config_new_option ( + irc_config_file, ptr_section, + "temporary_servers", "boolean", + N_("enable creation of temporary servers with command " + "/connect"), + NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_topic_strip_colors = weechat_config_new_option ( irc_config_file, ptr_section, "topic_strip_colors", "boolean", @@ -2986,8 +3029,9 @@ irc_config_init () } irc_config_section_server = ptr_section; - irc_config_hook_config_nick_colors = weechat_hook_config ("weechat.color.chat_nick_colors", - &irc_config_change_nick_colors_cb, NULL); + irc_config_hook_config_nick_colors = weechat_hook_config ( + "weechat.color.chat_nick_colors", + &irc_config_change_nick_colors_cb, NULL); return 1; } diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 7da924010..75dd374fd 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -151,6 +151,7 @@ extern struct t_config_option *irc_config_look_smart_filter_join_unmask; extern struct t_config_option *irc_config_look_smart_filter_mode; extern struct t_config_option *irc_config_look_smart_filter_nick; extern struct t_config_option *irc_config_look_smart_filter_quit; +extern struct t_config_option *irc_config_look_temporary_servers; extern struct t_config_option *irc_config_look_topic_strip_colors; extern struct t_config_option *irc_config_color_input_nick; diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c index a3c180c0e..42c61e7af 100644 --- a/src/plugins/irc/irc-ctcp.c +++ b/src/plugins/irc/irc-ctcp.c @@ -124,23 +124,23 @@ irc_ctcp_display_request (struct t_irc_server *server, && !weechat_config_boolean (irc_config_look_display_ctcp_blocked)) return; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, nick, - NULL, "ctcp", - (channel) ? channel->buffer : NULL), - date, - irc_protocol_tags (command, "irc_ctcp", NULL, - address), - _("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_message (server, NULL, nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - ctcp, - IRC_COLOR_RESET, - (arguments) ? " " : "", - (arguments) ? arguments : "", - (reply && !reply[0]) ? _(" (blocked)") : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, nick, NULL, "ctcp", + (channel) ? channel->buffer : NULL), + date, + irc_protocol_tags (command, "irc_ctcp", NULL, address), + _("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 0, NULL, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + ctcp, + IRC_COLOR_RESET, + (arguments) ? " " : "", + (arguments) ? arguments : "", + (reply && !reply[0]) ? _(" (blocked)") : ""); } /* @@ -187,14 +187,14 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date, difftime = ((sec2 * 1000000) + usec2) - ((sec1 * 1000000) + usec1); weechat_printf_date_tags ( - irc_msgbuffer_get_target_buffer (server, nick, NULL, - "ctcp", NULL), + irc_msgbuffer_get_target_buffer ( + server, nick, NULL, "ctcp", NULL), date, irc_protocol_tags (command, "irc_ctcp", NULL, NULL), /* TRANSLATORS: %.3fs is a float number + "s" ("seconds") */ _("%sCTCP reply from %s%s%s: %s%s%s %.3fs"), weechat_prefix ("network"), - irc_nick_color_for_message (server, NULL, nick), + irc_nick_color_for_msg (server, 0, NULL, nick), nick, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -207,48 +207,41 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date, } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, - nick, - NULL, - "ctcp", - NULL), - date, - irc_protocol_tags (command, - "irc_ctcp", - NULL, address), - _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_message (server, NULL, - nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - arguments + 1, - IRC_COLOR_RESET, - " ", - pos_args); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, nick, NULL, "ctcp", NULL), + date, + irc_protocol_tags (command, "irc_ctcp", NULL, address), + _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 0, NULL, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + arguments + 1, + IRC_COLOR_RESET, + " ", + pos_args); } pos_space[0] = ' '; } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, nick, - NULL, "ctcp", - NULL), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_message (server, NULL, - nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - arguments + 1, - "", - "", - ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, nick, NULL, "ctcp", NULL), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%sCTCP reply from %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 0, NULL, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + arguments + 1, + "", + "", + ""); } if (pos_end) @@ -275,13 +268,14 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server, const char *str_args; char *str_args_color; - hashtable = irc_server_sendf (server, - IRC_SERVER_SEND_OUTQ_PRIO_LOW | IRC_SERVER_SEND_RETURN_HASHTABLE, - NULL, - "NOTICE %s :\01%s%s%s\01", - nick, ctcp, - (arguments) ? " " : "", - (arguments) ? arguments : ""); + hashtable = irc_server_sendf ( + server, + IRC_SERVER_SEND_OUTQ_PRIO_LOW | IRC_SERVER_SEND_RETURN_HASHTABLE, + NULL, + "NOTICE %s :\01%s%s%s\01", + nick, ctcp, + (arguments) ? " " : "", + (arguments) ? arguments : ""); if (hashtable) { @@ -297,26 +291,24 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server, str_args_color = irc_color_decode (str_args, 1); if (!str_args_color) break; - weechat_printf_tags (irc_msgbuffer_get_target_buffer (server, - nick, - NULL, - "ctcp", - (channel) ? channel->buffer : NULL), - irc_protocol_tags (command, - "irc_ctcp,irc_ctcp_reply," - "notify_none,no_highlight", - NULL, NULL), - _("%sCTCP reply to %s%s%s: %s%s%s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_message (server, NULL, - nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - ctcp, - (str_args_color[0]) ? IRC_COLOR_RESET : "", - (str_args_color[0]) ? " " : "", - str_args_color); + weechat_printf_tags ( + irc_msgbuffer_get_target_buffer ( + server, nick, NULL, "ctcp", + (channel) ? channel->buffer : NULL), + irc_protocol_tags ( + command, + "irc_ctcp,irc_ctcp_reply,notify_none,no_highlight", + NULL, NULL), + _("%sCTCP reply to %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 0, NULL, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + ctcp, + (str_args_color[0]) ? IRC_COLOR_RESET : "", + (str_args_color[0]) ? " " : "", + str_args_color); free (str_args_color); number++; } @@ -343,9 +335,9 @@ irc_ctcp_replace_variables (struct t_irc_server *server, const char *format) * $clientinfo: supported CTCP, example: * ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION */ - temp = weechat_string_replace (format, "$clientinfo", - "ACTION DCC CLIENTINFO FINGER PING SOURCE " - "TIME USERINFO VERSION"); + temp = weechat_string_replace ( + format, "$clientinfo", + "ACTION DCC CLIENTINFO FINGER PING SOURCE TIME USERINFO VERSION"); if (!temp) return NULL; res = temp; @@ -549,11 +541,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, if (!dcc_args) { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: not enough memory for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); return; } @@ -568,10 +559,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_size = strrchr (pos_file, ' '); if (!pos_size) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -588,10 +579,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_port = strrchr (pos_file, ' '); if (!pos_port) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -608,10 +599,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_addr = strrchr (pos_file, ' '); if (!pos_addr) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -674,11 +665,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, if (!dcc_args) { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: not enough memory for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); return; } @@ -693,10 +683,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_start_resume = strrchr (pos_file, ' '); if (!pos_start_resume) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -712,10 +702,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_port = strrchr (pos_file, ' '); if (!pos_port) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -771,11 +761,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, if (!dcc_args) { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: not enough memory for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); return; } @@ -790,10 +779,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_start_resume = strrchr (pos_file, ' '); if (!pos_start_resume) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -809,10 +798,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_port = strrchr (pos_file, ' '); if (!pos_port) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -868,11 +857,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, if (!dcc_args) { - weechat_printf (server->buffer, - _("%s%s: not enough memory for \"%s\" " - "command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: not enough memory for \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); return; } @@ -887,10 +875,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_addr = strchr (pos_file, ' '); if (!pos_addr) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -905,10 +893,10 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, pos_port = strchr (pos_addr, ' '); if (!pos_port) { - weechat_printf (server->buffer, - _("%s%s: cannot parse \"%s\" command"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "privmsg"); + weechat_printf ( + server->buffer, + _("%s%s: cannot parse \"%s\" command"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "privmsg"); free (dcc_args); return; } @@ -921,15 +909,15 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick, if (weechat_strcasecmp (pos_file, "chat") != 0) { - weechat_printf (server->buffer, - _("%s%s: unknown DCC CHAT type " - "received from %s%s%s: \"%s\""), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, - irc_nick_color_for_message (server, NULL, nick), - nick, - IRC_COLOR_RESET, - pos_file); + weechat_printf ( + server->buffer, + _("%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\""), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, + irc_nick_color_for_msg (server, 0, NULL, nick), + nick, + IRC_COLOR_RESET, + pos_file); free (dcc_args); return; } @@ -1018,21 +1006,22 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command, irc_channel_nick_speaking_time_remove_old (channel); irc_channel_nick_speaking_time_add (server, channel, nick, time (NULL)); - weechat_printf_date_tags (channel->buffer, - date, - irc_protocol_tags (command, - (nick_is_me) ? - "irc_action,notify_none,no_highlight" : - "irc_action,notify_message", - nick, address), - "%s%s%s%s%s%s%s", - weechat_prefix ("action"), - irc_nick_mode_for_display (server, ptr_nick, 0), - (ptr_nick) ? ptr_nick->color : ((nick) ? irc_nick_find_color (nick) : IRC_COLOR_CHAT_NICK), - nick, - (pos_args) ? IRC_COLOR_RESET : "", - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + channel->buffer, + date, + irc_protocol_tags (command, + (nick_is_me) ? + "irc_action,notify_none,no_highlight" : + "irc_action,notify_message", + nick, address), + "%s%s%s%s%s%s%s", + weechat_prefix ("action"), + irc_nick_mode_for_display (server, ptr_nick, 0), + (ptr_nick) ? ptr_nick->color : ((nick) ? irc_nick_find_color (nick) : IRC_COLOR_CHAT_NICK), + nick, + (pos_args) ? IRC_COLOR_RESET : "", + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); } else { @@ -1044,11 +1033,11 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command, remote_nick, 0, 0); if (!ptr_channel) { - weechat_printf (server->buffer, - _("%s%s: cannot create new " - "private buffer \"%s\""), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, remote_nick); + weechat_printf ( + server->buffer, + _("%s%s: cannot create new private buffer \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + remote_nick); } } if (ptr_channel) @@ -1056,21 +1045,22 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command, if (!ptr_channel->topic) irc_channel_set_topic (ptr_channel, address); - weechat_printf_date_tags (ptr_channel->buffer, - date, - irc_protocol_tags (command, - (nick_is_me) ? - "irc_action,notify_none,no_highlight" : - "irc_action,notify_private", - nick, address), - "%s%s%s%s%s%s", - weechat_prefix ("action"), - (nick_is_me) ? - IRC_COLOR_CHAT_NICK_SELF : irc_nick_color_for_pv (ptr_channel, nick), - nick, - (pos_args) ? IRC_COLOR_RESET : "", - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + ptr_channel->buffer, + date, + irc_protocol_tags (command, + (nick_is_me) ? + "irc_action,notify_none,no_highlight" : + "irc_action,notify_private", + nick, address), + "%s%s%s%s%s%s", + weechat_prefix ("action"), + (nick_is_me) ? + IRC_COLOR_CHAT_NICK_SELF : irc_nick_color_for_pv (ptr_channel, nick), + nick, + (pos_args) ? IRC_COLOR_RESET : "", + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); (void) weechat_hook_signal_send ("irc_pv", WEECHAT_HOOK_SIGNAL_STRING, message); @@ -1119,28 +1109,22 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command, { if (weechat_config_boolean (irc_config_look_display_ctcp_unknown)) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, - nick, - NULL, - "ctcp", - (channel) ? channel->buffer : NULL), - date, - irc_protocol_tags (command, - "irc_ctcp", - NULL, address), - _("%sUnknown CTCP requested by %s%s%s: " - "%s%s%s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_message (server, - NULL, - nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - arguments + 1, - (pos_args) ? IRC_COLOR_RESET : "", - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, nick, NULL, "ctcp", + (channel) ? channel->buffer : NULL), + date, + irc_protocol_tags (command, "irc_ctcp", NULL, address), + _("%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 0, NULL, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + arguments + 1, + (pos_args) ? IRC_COLOR_RESET : "", + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); } } } diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c index ad5c91097..0abc1f788 100644 --- a/src/plugins/irc/irc-info.c +++ b/src/plugins/irc/irc-info.c @@ -613,28 +613,24 @@ irc_info_init () &irc_info_get_info_cb, NULL); /* info_hashtable hooks */ - weechat_hook_info_hashtable ("irc_message_parse", - N_("parse an IRC message"), - N_("\"message\": IRC message, " - "\"server\": server name (optional)"), - /* TRANSLATORS: please do not translate key names (enclosed by quotes) */ - N_("\"tags\": tags, \"message_without_tags\": " - "message without the tags, \"nick\": nick, " - "\"host\": host, \"command\": command, " - "\"channel\": channel, \"arguments\": " - "arguments (includes channel)"), - &irc_info_get_info_hashtable_cb, NULL); - weechat_hook_info_hashtable ("irc_message_split", - N_("split an IRC message (to fit in 512 bytes)"), - N_("\"message\": IRC message, " - "\"server\": server name (optional)"), - /* TRANSLATORS: please do not translate key names (enclosed by quotes) */ - N_("\"msg1\" ... \"msgN\": messages to send " - "(without final \"\\r\\n\"), " - "\"args1\" ... \"argsN\": arguments of " - "messages, " - "\"count\": number of messages"), - &irc_info_get_info_hashtable_cb, NULL); + weechat_hook_info_hashtable ( + "irc_message_parse", + N_("parse an IRC message"), + N_("\"message\": IRC message, \"server\": server name (optional)"), + /* TRANSLATORS: please do not translate key names (enclosed by quotes) */ + N_("\"tags\": tags, \"message_without_tags\": message without the " + "tags, \"nick\": nick, \"host\": host, \"command\": command, " + "\"channel\": channel, \"arguments\": arguments (includes channel)"), + &irc_info_get_info_hashtable_cb, NULL); + weechat_hook_info_hashtable ( + "irc_message_split", + N_("split an IRC message (to fit in 512 bytes)"), + N_("\"message\": IRC message, \"server\": server name (optional)"), + /* TRANSLATORS: please do not translate key names (enclosed by quotes) */ + N_("\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), " + "\"args1\" ... \"argsN\": arguments of messages, \"count\": number " + "of messages"), + &irc_info_get_info_hashtable_cb, NULL); /* infolist hooks */ weechat_hook_infolist ("irc_server", diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c index 39f467bd1..eb9d7f7f5 100644 --- a/src/plugins/irc/irc-input.c +++ b/src/plugins/irc/irc-input.c @@ -64,8 +64,9 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, int action, else text2 = strdup (text); - text_decoded = irc_color_decode ((text2) ? text2 : text, - weechat_config_boolean (irc_config_network_colors_send)); + text_decoded = irc_color_decode ( + (text2) ? text2 : text, + weechat_config_boolean (irc_config_network_colors_send)); IRC_BUFFER_GET_SERVER_CHANNEL(buffer); @@ -85,7 +86,9 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, int action, } else { - str_color = irc_color_for_tags (weechat_config_color (weechat_config_get ("weechat.color.chat_nick_self"))); + str_color = irc_color_for_tags ( + weechat_config_color ( + weechat_config_get ("weechat.color.chat_nick_self"))); snprintf (str_tags, sizeof (str_tags), "notify_none,no_highlight,prefix_nick_%s", (str_color) ? str_color : "default"); @@ -95,32 +98,35 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, int action, ptr_text = (text_decoded) ? text_decoded : ((text2) ? text2 : text); if (action) { - weechat_printf_tags (buffer, - irc_protocol_tags ("privmsg", - str_tags, - (ptr_nick) ? ptr_nick->name : ptr_server->nick, - NULL), - "%s%s%s%s%s %s", - weechat_prefix ("action"), - irc_nick_mode_for_display (ptr_server, ptr_nick, 0), - IRC_COLOR_CHAT_NICK_SELF, - ptr_server->nick, - IRC_COLOR_RESET, - ptr_text); + weechat_printf_tags ( + buffer, + irc_protocol_tags ( + "privmsg", str_tags, + (ptr_nick) ? ptr_nick->name : ptr_server->nick, + NULL), + "%s%s%s%s%s %s", + weechat_prefix ("action"), + irc_nick_mode_for_display (ptr_server, ptr_nick, 0), + IRC_COLOR_CHAT_NICK_SELF, + ptr_server->nick, + IRC_COLOR_RESET, + ptr_text); } else { - weechat_printf_tags (buffer, - irc_protocol_tags ("privmsg", - str_tags, - (ptr_nick) ? ptr_nick->name : ptr_server->nick, - NULL), - "%s%s", - irc_nick_as_prefix (ptr_server, - (ptr_nick) ? ptr_nick : NULL, - (ptr_nick) ? NULL : ptr_server->nick, - IRC_COLOR_CHAT_NICK_SELF), - ptr_text); + weechat_printf_tags ( + buffer, + irc_protocol_tags ( + "privmsg", str_tags, + (ptr_nick) ? ptr_nick->name : ptr_server->nick, + NULL), + "%s%s", + irc_nick_as_prefix ( + ptr_server, + (ptr_nick) ? ptr_nick : NULL, + (ptr_nick) ? NULL : ptr_server->nick, + IRC_COLOR_CHAT_NICK_SELF), + ptr_text); } } @@ -217,8 +223,9 @@ irc_input_data (struct t_gui_buffer *buffer, const char *input_data, int flags) ptr_data = weechat_string_input_for_buffer (input_data); if (!ptr_data) ptr_data = input_data; - data_with_colors = irc_color_encode (ptr_data, - weechat_config_boolean (irc_config_network_colors_send)); + data_with_colors = irc_color_encode ( + ptr_data, + weechat_config_boolean (irc_config_network_colors_send)); msg = strdup ((data_with_colors) ? data_with_colors : ptr_data); if (msg) @@ -368,10 +375,12 @@ irc_input_send_cb (void *data, const char *signal, else { /* command */ - data_with_colors = irc_color_encode (ptr_message, - weechat_config_boolean (irc_config_network_colors_send)); - weechat_command (ptr_buffer, - (data_with_colors) ? data_with_colors : ptr_message); + data_with_colors = irc_color_encode ( + ptr_message, + weechat_config_boolean (irc_config_network_colors_send)); + weechat_command ( + ptr_buffer, + (data_with_colors) ? data_with_colors : ptr_message); if (data_with_colors) free (data_with_colors); } diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index 7721c57b3..e062b4e31 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -248,13 +248,20 @@ irc_message_parse_to_hashtable (struct t_irc_server *server, if (!hashtable) return NULL; - weechat_hashtable_set (hashtable, "tags", (tags) ? tags : empty_str); - weechat_hashtable_set (hashtable, "message_without_tags", (message_without_tags) ? message_without_tags : empty_str); - weechat_hashtable_set (hashtable, "nick", (nick) ? nick : empty_str); - weechat_hashtable_set (hashtable, "host", (host) ? host : empty_str); - weechat_hashtable_set (hashtable, "command", (command) ? command : empty_str); - weechat_hashtable_set (hashtable, "channel", (channel) ? channel : empty_str); - weechat_hashtable_set (hashtable, "arguments", (arguments) ? arguments : empty_str); + weechat_hashtable_set (hashtable, "tags", + (tags) ? tags : empty_str); + weechat_hashtable_set (hashtable, "message_without_tags", + (message_without_tags) ? message_without_tags : empty_str); + weechat_hashtable_set (hashtable, "nick", + (nick) ? nick : empty_str); + weechat_hashtable_set (hashtable, "host", + (host) ? host : empty_str); + weechat_hashtable_set (hashtable, "command", + (command) ? command : empty_str); + weechat_hashtable_set (hashtable, "channel", + (channel) ? channel : empty_str); + weechat_hashtable_set (hashtable, "arguments", + (arguments) ? arguments : empty_str); if (tags) free (tags); @@ -888,11 +895,11 @@ irc_message_split (struct t_irc_server *server, const char *message) * 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); + 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) { @@ -905,18 +912,17 @@ irc_message_split (struct t_irc_server *server, const char *message) { 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); + 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); + 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) @@ -938,12 +944,11 @@ irc_message_split (struct t_irc_server *server, const char *message) */ if (index_args + 1 <= argc - 1) { - split_ok = irc_message_split_privmsg_notice (hashtable, tags, host, - command, - argv[index_args], - (argv_eol[index_args + 1][0] == ':') ? - argv_eol[index_args + 1] + 1 : argv_eol[index_args + 1], - max_length_host); + split_ok = irc_message_split_privmsg_notice ( + hashtable, tags, host, command, argv[index_args], + (argv_eol[index_args + 1][0] == ':') ? + argv_eol[index_args + 1] + 1 : argv_eol[index_args + 1], + max_length_host); } } else if (weechat_strcasecmp (command, "005") == 0) @@ -951,10 +956,10 @@ irc_message_split (struct t_irc_server *server, const char *message) /* :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, - argv[index_args], - (argv_eol[index_args + 1][0] == ':') ? - argv_eol[index_args + 1] + 1 : argv_eol[index_args + 1]); + split_ok = irc_message_split_005 ( + hashtable, tags, host, command, argv[index_args], + (argv_eol[index_args + 1][0] == ':') ? + argv_eol[index_args + 1] + 1 : argv_eol[index_args + 1]); } } else if (weechat_strcasecmp (command, "353") == 0) @@ -969,11 +974,11 @@ irc_message_split (struct t_irc_server *server, const char *message) { snprintf (target, sizeof (target), "%s %s", argv[index_args], argv[index_args + 1]); - split_ok = irc_message_split_string (hashtable, tags, host, - command, target, ":", - (argv_eol[index_args + 2][0] == ':') ? - argv_eol[index_args + 2] + 1 : argv_eol[index_args + 2], - NULL, ' ', -1); + split_ok = irc_message_split_string ( + hashtable, tags, host, command, target, ":", + (argv_eol[index_args + 2][0] == ':') ? + argv_eol[index_args + 2] + 1 : argv_eol[index_args + 2], + NULL, ' ', -1); } else { @@ -982,11 +987,11 @@ irc_message_split (struct t_irc_server *server, const char *message) snprintf (target, sizeof (target), "%s %s %s", argv[index_args], argv[index_args + 1], argv[index_args + 2]); - split_ok = irc_message_split_string (hashtable, tags, host, - command, target, ":", - (argv_eol[index_args + 3][0] == ':') ? - argv_eol[index_args + 3] + 1 : argv_eol[index_args + 3], - NULL, ' ', -1); + split_ok = irc_message_split_string ( + hashtable, tags, host, command, target, ":", + (argv_eol[index_args + 3][0] == ':') ? + argv_eol[index_args + 3] + 1 : argv_eol[index_args + 3], + NULL, ' ', -1); } } } diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index a3f800a45..bd14631cf 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -959,12 +959,13 @@ irc_nick_mode_for_display (struct t_irc_server *server, struct t_irc_nick *nick, { str_prefix[0] = '\0'; } - str_prefix_color = weechat_color (irc_nick_get_prefix_color_name (server, - nick->prefix[0])); + str_prefix_color = weechat_color ( + irc_nick_get_prefix_color_name (server, nick->prefix[0])); } else { - str_prefix[0] = (prefix && weechat_config_boolean (irc_config_look_nick_mode_empty)) ? + str_prefix[0] = (prefix + && weechat_config_boolean (irc_config_look_nick_mode_empty)) ? ' ' : '\0'; str_prefix_color = IRC_COLOR_RESET; } @@ -1004,10 +1005,15 @@ irc_nick_as_prefix (struct t_irc_server *server, struct t_irc_nick *nick, */ const char * -irc_nick_color_for_message (struct t_irc_server *server, - struct t_irc_nick *nick, - const char *nickname) +irc_nick_color_for_msg (struct t_irc_server *server, int server_message, + struct t_irc_nick *nick, const char *nickname) { + if (server_message + && !weechat_config_boolean (irc_config_look_color_nicks_in_server_messages)) + { + return IRC_COLOR_CHAT_NICK; + } + if (nick) return nick->color; @@ -1025,21 +1031,6 @@ irc_nick_color_for_message (struct t_irc_server *server, } /* - * Returns WeeChat color code for a nick (used in a server message). - */ - -const char * -irc_nick_color_for_server_message (struct t_irc_server *server, - struct t_irc_nick *nick, - const char *nickname) -{ - if (!weechat_config_boolean(irc_config_look_color_nicks_in_server_messages)) - return IRC_COLOR_CHAT_NICK; - - return irc_nick_color_for_message (server, nick, nickname); -} - -/* * Returns string with color of nick for private. */ diff --git a/src/plugins/irc/irc-nick.h b/src/plugins/irc/irc-nick.h index 211f40f1f..d30bd0d67 100644 --- a/src/plugins/irc/irc-nick.h +++ b/src/plugins/irc/irc-nick.h @@ -93,12 +93,10 @@ extern const char *irc_nick_as_prefix (struct t_irc_server *server, struct t_irc_nick *nick, const char *nickname, const char *force_color); -extern const char *irc_nick_color_for_message (struct t_irc_server *server, - struct t_irc_nick *nick, - const char *nickname); -extern const char *irc_nick_color_for_server_message (struct t_irc_server *server, - struct t_irc_nick *nick, - const char *nickname); +extern const char *irc_nick_color_for_msg (struct t_irc_server *server, + int server_message, + struct t_irc_nick *nick, + const char *nickname); extern const char * irc_nick_color_for_pv (struct t_irc_channel *channel, const char *nickname); extern char *irc_nick_default_ban_mask (struct t_irc_nick *nick); diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c index 881cd9c72..d8438a442 100644 --- a/src/plugins/irc/irc-notify.c +++ b/src/plugins/irc/irc-notify.c @@ -505,40 +505,40 @@ irc_notify_display (struct t_irc_server *server, struct t_gui_buffer *buffer, if ((notify->is_on_server < 0) || (!notify->is_on_server && !notify->away_message)) { - weechat_printf (buffer, - " %s%s%s @ %s%s%s: %s%s", - irc_nick_color_for_server_message (server, NULL, - notify->nick), - notify->nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_SERVER, - notify->server->name, - IRC_COLOR_RESET, - (notify->is_on_server < 0) ? "" : IRC_COLOR_MESSAGE_QUIT, - (notify->is_on_server < 0) ? - /* TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) */ - _("unknown") : - _("offline")); + weechat_printf ( + buffer, + " %s%s%s @ %s%s%s: %s%s", + irc_nick_color_for_msg (server, 1, NULL, notify->nick), + notify->nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_SERVER, + notify->server->name, + IRC_COLOR_RESET, + (notify->is_on_server < 0) ? "" : IRC_COLOR_MESSAGE_QUIT, + (notify->is_on_server < 0) ? + /* TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) */ + _("unknown") : + _("offline")); } else { - weechat_printf (buffer, - " %s%s%s @ %s%s%s: %s%s %s%s%s%s%s%s", - irc_nick_color_for_server_message (server, NULL, - notify->nick), - notify->nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_SERVER, - notify->server->name, - IRC_COLOR_RESET, - IRC_COLOR_MESSAGE_JOIN, - _("online"), - IRC_COLOR_RESET, - (notify->away_message) ? " (" : "", - (notify->away_message) ? _("away") : "", - (notify->away_message) ? ": \"" : "", - (notify->away_message) ? notify->away_message : "", - (notify->away_message) ? "\")" : ""); + weechat_printf ( + buffer, + " %s%s%s @ %s%s%s: %s%s %s%s%s%s%s%s", + irc_nick_color_for_msg (server, 1, NULL, notify->nick), + notify->nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_SERVER, + notify->server->name, + IRC_COLOR_RESET, + IRC_COLOR_MESSAGE_JOIN, + _("online"), + IRC_COLOR_RESET, + (notify->away_message) ? " (" : "", + (notify->away_message) ? _("away") : "", + (notify->away_message) ? ": \"" : "", + (notify->away_message) ? notify->away_message : "", + (notify->away_message) ? "\")" : ""); } } @@ -672,29 +672,28 @@ irc_notify_set_is_on_server (struct t_irc_notify *notify, const char *host, if (notify->is_on_server == is_on_server) return; - weechat_printf_tags (notify->server->buffer, - irc_notify_get_tags (irc_config_look_notify_tags_ison, - (is_on_server) ? "join" : "quit", - notify->nick), - (notify->is_on_server < 0) ? - ((is_on_server) ? - _("%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%s%s%s%s%s%s has connected") : - _("%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, - (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); + weechat_printf_tags ( + notify->server->buffer, + irc_notify_get_tags (irc_config_look_notify_tags_ison, + (is_on_server) ? "join" : "quit", + notify->nick), + (notify->is_on_server < 0) ? + ((is_on_server) ? + _("%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%s%s%s%s%s%s has connected") : + _("%snotify: %s%s%s%s%s%s%s%s%s has quit")), + weechat_prefix ("network"), + irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick), + notify->nick, + (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; @@ -720,49 +719,43 @@ irc_notify_set_away_message (struct t_irc_notify *notify, if (!notify->away_message && away_message) { - weechat_printf_tags (notify->server->buffer, - irc_notify_get_tags (irc_config_look_notify_tags_whois, - "away", - notify->nick), - _("%snotify: %s%s%s is now away: \"%s\""), - weechat_prefix ("network"), - irc_nick_color_for_server_message (notify->server, - NULL, - notify->nick), - notify->nick, - IRC_COLOR_RESET, - away_message); + weechat_printf_tags ( + notify->server->buffer, + irc_notify_get_tags ( + irc_config_look_notify_tags_whois, "away", notify->nick), + _("%snotify: %s%s%s is now away: \"%s\""), + weechat_prefix ("network"), + irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick), + notify->nick, + IRC_COLOR_RESET, + away_message); irc_notify_send_signal (notify, "away", away_message); } else if (notify->away_message && !away_message) { - weechat_printf_tags (notify->server->buffer, - irc_notify_get_tags (irc_config_look_notify_tags_whois, - "back", - notify->nick), - _("%snotify: %s%s%s is back"), - weechat_prefix ("network"), - irc_nick_color_for_server_message (notify->server, - NULL, - notify->nick), - notify->nick, - IRC_COLOR_RESET); + weechat_printf_tags ( + notify->server->buffer, + irc_notify_get_tags ( + irc_config_look_notify_tags_whois, "back", notify->nick), + _("%snotify: %s%s%s is back"), + weechat_prefix ("network"), + irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick), + notify->nick, + IRC_COLOR_RESET); irc_notify_send_signal (notify, "back", NULL); } else if (notify->away_message && away_message) { - weechat_printf_tags (notify->server->buffer, - irc_notify_get_tags (irc_config_look_notify_tags_whois, - "still_away", - notify->nick), - _("%snotify: %s%s%s is still away: \"%s\""), - weechat_prefix ("network"), - irc_nick_color_for_server_message (notify->server, - NULL, - notify->nick), - notify->nick, - IRC_COLOR_RESET, - away_message); + weechat_printf_tags ( + notify->server->buffer, + irc_notify_get_tags ( + irc_config_look_notify_tags_whois, "still_away", notify->nick), + _("%snotify: %s%s%s is still away: \"%s\""), + weechat_prefix ("network"), + irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick), + notify->nick, + IRC_COLOR_RESET, + away_message); irc_notify_send_signal (notify, "still_away", away_message); } diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index fcf25d05b..3ba40e417 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -147,12 +147,16 @@ irc_protocol_tags (const char *command, const char *tags, const char *nick, /* * Builds a string with nick and optional address. * + * If server_message is 1, the nick is colored according to option + * irc.look.color_nicks_in_server_messages. + * * 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, + int server_message, struct t_irc_nick *nick, const char *nickname, const char *address) @@ -166,9 +170,8 @@ irc_protocol_nick_address (struct t_irc_server *server, /* 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), + irc_nick_color_for_msg (server, server_message, nick, + nickname), nickname, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, @@ -181,9 +184,8 @@ irc_protocol_nick_address (struct t_irc_server *server, /* 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), + irc_nick_color_for_msg (server, server_message, nick, + nickname), nickname, IRC_COLOR_RESET); } @@ -208,14 +210,14 @@ IRC_PROTOCOL_CALLBACK(authenticate) if (irc_server_sasl_enabled (server)) { - sasl_mechanism = IRC_SERVER_OPTION_INTEGER(server, - IRC_SERVER_OPTION_SASL_MECHANISM); - sasl_username = weechat_string_eval_expression (IRC_SERVER_OPTION_STRING(server, - IRC_SERVER_OPTION_SASL_USERNAME), - NULL, NULL, NULL); - sasl_password = weechat_string_eval_expression (IRC_SERVER_OPTION_STRING(server, - IRC_SERVER_OPTION_SASL_PASSWORD), - NULL, NULL, NULL); + sasl_mechanism = IRC_SERVER_OPTION_INTEGER( + server, IRC_SERVER_OPTION_SASL_MECHANISM); + sasl_username = weechat_string_eval_expression ( + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SASL_USERNAME), + NULL, NULL, NULL); + sasl_password = weechat_string_eval_expression ( + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SASL_PASSWORD), + NULL, NULL, NULL); answer = NULL; switch (sasl_mechanism) { @@ -245,11 +247,12 @@ IRC_PROTOCOL_CALLBACK(authenticate) } else { - weechat_printf (server->buffer, - _("%s%s: error building answer for " - "SASL authentication, using mechanism \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - irc_sasl_mechanism_string[IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SASL_MECHANISM)]); + weechat_printf ( + server->buffer, + _("%s%s: error building answer for SASL authentication, " + "using mechanism \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + irc_sasl_mechanism_string[IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SASL_MECHANISM)]); irc_server_sendf (server, 0, NULL, "CAP END"); } if (sasl_username) @@ -311,12 +314,12 @@ IRC_PROTOCOL_CALLBACK(cap) if (argc > 4) { ptr_caps = (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]; - weechat_printf_date_tags (server->buffer, date, NULL, - _("%s%s: client capability, server " - "supports: %s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - ptr_caps); + weechat_printf_date_tags ( + server->buffer, date, NULL, + _("%s%s: client capability, server supports: %s"), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + ptr_caps); /* auto-enable capabilities only when connecting to server */ if (!server->is_connected) @@ -368,11 +371,11 @@ IRC_PROTOCOL_CALLBACK(cap) weechat_string_free_split (caps_supported); if (cap_req[0]) { - weechat_printf (server->buffer, - _("%s%s: client capability, requesting: %s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - cap_req); + weechat_printf ( + server->buffer, + _("%s%s: client capability, requesting: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, + cap_req); irc_server_sendf (server, 0, NULL, "CAP REQ :%s", cap_req); } @@ -380,10 +383,10 @@ IRC_PROTOCOL_CALLBACK(cap) irc_server_sendf (server, 0, NULL, "CAP END"); if (sasl_requested && !sasl_to_do) { - weechat_printf (server->buffer, - _("%s%s: client capability: sasl not supported"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: client capability: sasl not supported"), + weechat_prefix ("network"), IRC_PLUGIN_NAME); } } if (cap_option) @@ -398,12 +401,10 @@ IRC_PROTOCOL_CALLBACK(cap) if (argc > 4) { ptr_caps = (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]; - weechat_printf_date_tags (server->buffer, date, NULL, - _("%s%s: client capability, currently " - "enabled: %s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - ptr_caps); + weechat_printf_date_tags ( + server->buffer, date, NULL, + _("%s%s: client capability, currently enabled: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, ptr_caps); } } else if (strcmp (argv[3], "ACK") == 0) @@ -411,11 +412,10 @@ IRC_PROTOCOL_CALLBACK(cap) if (argc > 4) { ptr_caps = (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]; - weechat_printf_date_tags (server->buffer, date, NULL, - _("%s%s: client capability, enabled: %s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - ptr_caps); + weechat_printf_date_tags ( + server->buffer, date, NULL, + _("%s%s: client capability, enabled: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, ptr_caps); sasl_to_do = 0; caps_supported = weechat_string_split (ptr_caps, " ", 0, 0, &num_caps_supported); @@ -474,10 +474,10 @@ IRC_PROTOCOL_CALLBACK(cap) if (argc > 4) { ptr_caps = (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]; - weechat_printf_date_tags (server->buffer, date, NULL, - _("%s%s: client capability, refused: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - ptr_caps); + weechat_printf_date_tags ( + server->buffer, date, NULL, + _("%s%s: client capability, refused: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, ptr_caps); if (!server->is_connected) irc_server_sendf (server, 0, NULL, "CAP END"); } @@ -501,14 +501,13 @@ IRC_PROTOCOL_CALLBACK(error) ptr_args = (argv_eol[1][0] == ':') ? argv_eol[1] + 1 : argv_eol[1]; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - NULL), - date, - irc_protocol_tags (command, NULL, NULL, NULL), - "%s%s", - weechat_prefix ("error"), - ptr_args); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, NULL, NULL, NULL), + "%s%s", + weechat_prefix ("error"), + ptr_args); if (strncmp (ptr_args, "Closing Link", 12) == 0) { @@ -558,11 +557,9 @@ IRC_PROTOCOL_CALLBACK(generic_error) weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer ( - server, - NULL, - command, - ((strcmp (command, "401") == 0) || (strcmp (command, "402") == 0)) ? - "whois" : NULL, + server, NULL, command, + ((strcmp (command, "401") == 0) + || (strcmp (command, "402") == 0)) ? "whois" : NULL, ptr_buffer), date, irc_protocol_tags (command, NULL, NULL, NULL), @@ -592,24 +589,22 @@ IRC_PROTOCOL_CALLBACK(invite) IRC_PROTOCOL_MIN_ARGS(4); IRC_PROTOCOL_CHECK_HOST; - if (!ignored) - { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, nick, - command, NULL, - NULL), - date, - irc_protocol_tags (command, "notify_highlight", - NULL, address), - _("%sYou have been invited to %s%s%s by " - "%s%s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - (argv[3][0] == ':') ? argv[3] + 1 : argv[3], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, nick), - nick, - IRC_COLOR_RESET); - } + if (ignored) + return WEECHAT_RC_OK; + + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL), + date, + irc_protocol_tags (command, "notify_highlight", nick, address), + _("%sYou have been invited to %s%s%s by %s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + (argv[3][0] == ':') ? argv[3] + 1 : argv[3], + IRC_COLOR_RESET, + irc_nick_color_for_msg (server, 1, NULL, nick), + nick, + IRC_COLOR_RESET); + return WEECHAT_RC_OK; } @@ -618,6 +613,10 @@ IRC_PROTOCOL_CALLBACK(invite) * * Message looks like: * :nick!user@host JOIN :#channel + * + * With extended-join capability: + * :nick!user@host JOIN :#channel * :real name + * *nick!user@host JOIN :#channel account :real name */ IRC_PROTOCOL_CALLBACK(join) @@ -625,7 +624,8 @@ IRC_PROTOCOL_CALLBACK(join) struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; struct t_irc_channel_speaking *ptr_nick_speaking; - char *pos_channel; + char *pos_channel, *pos_account, *pos_realname; + char str_account[512], str_realname[512]; int local_join, display_host, smart_filter; IRC_PROTOCOL_MIN_ARGS(3); @@ -634,6 +634,32 @@ IRC_PROTOCOL_CALLBACK(join) local_join = (irc_server_strcasecmp (server, nick, server->nick) == 0); pos_channel = (argv[2][0] == ':') ? argv[2] + 1 : argv[2]; + pos_account = ((argc > 3) && (strcmp (argv[3], "*") != 0)) ? + argv[3] : NULL; + pos_realname = (argc > 4) ? + ((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : NULL; + + str_account[0] = '\0'; + if (pos_account) + { + snprintf (str_account, sizeof (str_account), + "%s [%s%s%s]", + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + pos_account, + IRC_COLOR_CHAT_DELIMITERS); + } + + str_realname[0] = '\0'; + if (pos_realname) + { + snprintf (str_realname, sizeof (str_realname), + "%s (%s%s%s)", + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + pos_realname, + IRC_COLOR_CHAT_DELIMITERS); + } ptr_channel = irc_channel_search (server, pos_channel); if (ptr_channel) @@ -708,27 +734,29 @@ IRC_PROTOCOL_CALLBACK(join) && !ptr_nick_speaking); /* display the join */ - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, - smart_filter ? "irc_smart_filter" : NULL, - nick, address), - _("%s%s%s%s%s%s%s%s%s%s has joined %s%s%s"), - weechat_prefix ("join"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? " (" : "", - IRC_COLOR_CHAT_HOST, - (display_host) ? address : "", - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? ")" : "", - IRC_COLOR_MESSAGE_JOIN, - IRC_COLOR_CHAT_CHANNEL, - pos_channel, - IRC_COLOR_MESSAGE_JOIN); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, + ptr_channel->buffer), + date, + irc_protocol_tags (command, + smart_filter ? "irc_smart_filter" : NULL, + nick, address), + _("%s%s%s%s%s%s%s%s%s%s%s%s has joined %s%s%s"), + weechat_prefix ("join"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + str_account, + str_realname, + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? " (" : "", + IRC_COLOR_CHAT_HOST, + (display_host) ? address : "", + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? ")" : "", + IRC_COLOR_MESSAGE_JOIN, + IRC_COLOR_CHAT_CHANNEL, + pos_channel, + IRC_COLOR_MESSAGE_JOIN); /* * if join is smart filtered, save the nick in hashtable, and if nick @@ -736,7 +764,10 @@ IRC_PROTOCOL_CALLBACK(join) * (option irc.look.smart_filter_join_unmask) */ if (smart_filter) - irc_channel_join_smart_filtered_add (ptr_channel, nick, time (NULL)); + { + irc_channel_join_smart_filtered_add (ptr_channel, nick, + time (NULL)); + } /* display message in private if private has flag "has_quit_server" */ if (!local_join) @@ -779,41 +810,39 @@ IRC_PROTOCOL_CALLBACK(kick) if (pos_comment) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%s%s%s has kicked %s%s%s %s(%s%s%s)"), - weechat_prefix ("quit"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (server, ptr_nick_kicked, argv[3]), - argv[3], - IRC_COLOR_MESSAGE_QUIT, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_comment, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, + ptr_channel->buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%s%s%s has kicked %s%s%s %s(%s%s%s)"), + weechat_prefix ("quit"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_MESSAGE_QUIT, + irc_nick_color_for_msg (server, 1, ptr_nick_kicked, argv[3]), + argv[3], + IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_comment, + IRC_COLOR_CHAT_DELIMITERS); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%s%s%s has kicked %s%s%s"), - weechat_prefix ("quit"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (server, ptr_nick_kicked, argv[3]), - argv[3], - IRC_COLOR_MESSAGE_QUIT); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, + ptr_channel->buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%s%s%s has kicked %s%s%s"), + weechat_prefix ("quit"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_MESSAGE_QUIT, + irc_nick_color_for_msg (server, 1, ptr_nick_kicked, argv[3]), + argv[3], + IRC_COLOR_MESSAGE_QUIT); } if (irc_server_strcasecmp (server, argv[3], server->nick) == 0) @@ -838,7 +867,8 @@ IRC_PROTOCOL_CALLBACK(kick) if (rejoin) { - if (IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AUTOREJOIN_DELAY) == 0) + if (IRC_SERVER_OPTION_INTEGER(server, + IRC_SERVER_OPTION_AUTOREJOIN_DELAY) == 0) { /* immediately rejoin if delay is 0 */ irc_channel_rejoin (server, ptr_channel); @@ -847,10 +877,12 @@ IRC_PROTOCOL_CALLBACK(kick) { /* rejoin channel later, according to delay */ ptr_channel->hook_autorejoin = - weechat_hook_timer (IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AUTOREJOIN_DELAY) * 1000, - 0, 1, - &irc_channel_autorejoin_cb, - ptr_channel); + weechat_hook_timer ( + IRC_SERVER_OPTION_INTEGER(server, + IRC_SERVER_OPTION_AUTOREJOIN_DELAY) * 1000, + 0, 1, + &irc_channel_autorejoin_cb, + ptr_channel); } } @@ -896,37 +928,35 @@ IRC_PROTOCOL_CALLBACK(kill) if (pos_comment) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%sYou were killed by %s%s%s %s(%s%s%s)"), - weechat_prefix ("quit"), - IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_MESSAGE_QUIT, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_comment, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, + ptr_channel->buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%sYou were killed by %s%s%s %s(%s%s%s)"), + weechat_prefix ("quit"), + IRC_COLOR_MESSAGE_QUIT, + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_comment, + IRC_COLOR_CHAT_DELIMITERS); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%sYou were killed by %s%s%s"), - weechat_prefix ("quit"), - IRC_COLOR_MESSAGE_QUIT, - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_MESSAGE_QUIT); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, + ptr_channel->buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%sYou were killed by %s%s%s"), + weechat_prefix ("quit"), + IRC_COLOR_MESSAGE_QUIT, + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_MESSAGE_QUIT); } if (irc_server_strcasecmp (server, argv[2], server->nick) == 0) @@ -985,43 +1015,41 @@ IRC_PROTOCOL_CALLBACK(mode) local_mode = (irc_server_strcasecmp (server, nick, server->nick) == 0); ptr_nick = irc_nick_search (server, ptr_channel, nick); ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, - (smart_filter && !local_mode) ? - "irc_smart_filter" : NULL, - NULL, address), - _("%sMode %s%s %s[%s%s%s]%s by %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - (ptr_channel) ? ptr_channel->name : argv[2], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_modes, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, + ptr_buffer), + date, + irc_protocol_tags (command, + (smart_filter && !local_mode) ? + "irc_smart_filter" : NULL, + NULL, address), + _("%sMode %s%s %s[%s%s%s]%s by %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + (ptr_channel) ? ptr_channel->name : argv[2], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_modes, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - NULL), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%sUser mode %s[%s%s%s]%s by %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_modes, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, nick), - nick); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%sUser mode %s[%s%s%s]%s by %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_modes, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + irc_nick_color_for_msg (server, 1, NULL, nick), + nick); irc_mode_user_set (server, pos_modes, 0); } @@ -1055,6 +1083,30 @@ IRC_PROTOCOL_CALLBACK(nick) ptr_nick_found = NULL; + /* first display message in server buffer if it's local nick */ + if (local_nick) + { + /* temporary disable hotlist */ + weechat_buffer_set (NULL, "hotlist", "-"); + + snprintf (str_tags, sizeof (str_tags), + "irc_nick1_%s,irc_nick2_%s", + nick, + new_nick); + weechat_printf_date_tags ( + server->buffer, + date, + irc_protocol_tags (command, str_tags, NULL, address), + _("%sYou are now known as %s%s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK_SELF, + new_nick, + IRC_COLOR_RESET); + + /* enable hotlist */ + weechat_buffer_set (NULL, "hotlist", "+"); + } + for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { @@ -1072,12 +1124,15 @@ IRC_PROTOCOL_CALLBACK(nick) free (ptr_channel->pv_remote_nick_color); ptr_channel->pv_remote_nick_color = NULL; } - buffer_name = irc_buffer_build_name (server->name, ptr_channel->name); - weechat_buffer_set (ptr_channel->buffer, "name", buffer_name); - weechat_buffer_set (ptr_channel->buffer, "short_name", - ptr_channel->name); + buffer_name = irc_buffer_build_name (server->name, + ptr_channel->name); + weechat_buffer_set (ptr_channel->buffer, + "name", buffer_name); weechat_buffer_set (ptr_channel->buffer, - "localvar_set_channel", ptr_channel->name); + "short_name", ptr_channel->name); + weechat_buffer_set (ptr_channel->buffer, + "localvar_set_channel", + ptr_channel->name); } break; case IRC_CHANNEL_TYPE_CHANNEL: @@ -1094,7 +1149,7 @@ IRC_PROTOCOL_CALLBACK(nick) if (!ptr_nick->host) ptr_nick->host = strdup (address); - /* change nick and display message on all channels */ + /* change nick and display message on channel */ old_color = strdup (ptr_nick->color); irc_nick_change (server, ptr_channel, ptr_nick, new_nick); if (local_nick) @@ -1132,29 +1187,30 @@ IRC_PROTOCOL_CALLBACK(nick) (smart_filter) ? "irc_smart_filter," : "", nick, new_nick); - weechat_printf_date_tags (ptr_channel->buffer, - date, - irc_protocol_tags (command, - str_tags, - NULL, - address), - _("%s%s%s%s is now known as " - "%s%s%s"), - weechat_prefix ("network"), - weechat_config_boolean(irc_config_look_color_nicks_in_server_messages) ? - old_color : IRC_COLOR_CHAT_NICK, - nick, - IRC_COLOR_RESET, - irc_nick_color_for_message (server, ptr_nick, new_nick), - new_nick, - IRC_COLOR_RESET); + weechat_printf_date_tags ( + ptr_channel->buffer, + date, + irc_protocol_tags (command, str_tags, NULL, + address), + _("%s%s%s%s is now known as %s%s%s"), + weechat_prefix ("network"), + weechat_config_boolean(irc_config_look_color_nicks_in_server_messages) ? + old_color : IRC_COLOR_CHAT_NICK, + nick, + IRC_COLOR_RESET, + irc_nick_color_for_msg (server, 0, ptr_nick, + new_nick), + new_nick, + IRC_COLOR_RESET); } irc_channel_nick_speaking_rename (ptr_channel, nick, new_nick); - irc_channel_nick_speaking_time_rename (server, ptr_channel, + irc_channel_nick_speaking_time_rename (server, + ptr_channel, nick, new_nick); irc_channel_join_smart_filtered_rename (ptr_channel, - nick, new_nick); + nick, + new_nick); } if (old_color) @@ -1265,7 +1321,8 @@ IRC_PROTOCOL_CALLBACK(notice) pos = strchr (pos_args, end_char); if (pos && (pos > pos_args + 1)) { - channel = weechat_strndup (pos_args + 1, pos - pos_args - 1); + channel = weechat_strndup (pos_args + 1, + pos - pos_args - 1); if (channel && irc_channel_search (server, channel)) { is_channel = 1; @@ -1292,27 +1349,28 @@ IRC_PROTOCOL_CALLBACK(notice) irc_channel_join_smart_filtered_unmask (ptr_channel, nick); ptr_nick = irc_nick_search (server, ptr_channel, nick); - weechat_printf_date_tags ((ptr_channel) ? ptr_channel->buffer : server->buffer, - date, - irc_protocol_tags (command, - (is_channel_orig) ? - "notify_message" : - weechat_config_string (irc_config_look_notice_welcome_tags), - nick, address), - "%s%s%s%s%s%s%s(%s%s%s)%s: %s", - weechat_prefix ("network"), - IRC_COLOR_NOTICE, - (is_channel_orig) ? "" : "Pv", - /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ - _("Notice"), - (status_notice[0]) ? ":" : "", - status_notice, - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_message (server, ptr_nick, nick), - (nick && nick[0]) ? nick : "?", - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_args); + weechat_printf_date_tags ( + (ptr_channel) ? ptr_channel->buffer : server->buffer, + date, + irc_protocol_tags (command, + (is_channel_orig) ? + "notify_message" : + weechat_config_string (irc_config_look_notice_welcome_tags), + nick, address), + "%s%s%s%s%s%s%s(%s%s%s)%s: %s", + weechat_prefix ("network"), + IRC_COLOR_NOTICE, + (is_channel_orig) ? "" : "Pv", + /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ + _("Notice"), + (status_notice[0]) ? ":" : "", + status_notice, + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 0, ptr_nick, nick), + (nick && nick[0]) ? nick : "?", + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_args); } else { @@ -1335,7 +1393,8 @@ IRC_PROTOCOL_CALLBACK(notice) } ptr_channel = NULL; - if (nick && weechat_config_integer (irc_config_look_notice_as_pv) != IRC_CONFIG_LOOK_NOTICE_AS_PV_NEVER) + if (nick + && weechat_config_integer (irc_config_look_notice_as_pv) != IRC_CONFIG_LOOK_NOTICE_AS_PV_NEVER) { ptr_channel = irc_channel_search (server, nick); if (!ptr_channel @@ -1360,18 +1419,17 @@ IRC_PROTOCOL_CALLBACK(notice) if (!ptr_channel->topic) irc_channel_set_topic (ptr_channel, address); - weechat_printf_date_tags (ptr_channel->buffer, - date, - irc_protocol_tags (command, - "notify_private", - nick, address), - "%s%s%s%s: %s", - weechat_prefix ("network"), - irc_nick_color_for_message (server, NULL, - nick), - nick, - IRC_COLOR_RESET, - pos_args); + weechat_printf_date_tags ( + ptr_channel->buffer, + date, + irc_protocol_tags (command, "notify_private", nick, + address), + "%s%s%s%s: %s", + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 0, NULL, nick), + nick, + IRC_COLOR_RESET, + pos_args); if ((ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) && ptr_channel->has_quit_server) { @@ -1389,36 +1447,33 @@ IRC_PROTOCOL_CALLBACK(notice) */ if (nick && (irc_server_strcasecmp (server, server->nick, nick) == 0)) { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, - (notify_private) ? "notify_private" : NULL, - server->nick, - address), - "%s%s%s%s -> %s%s%s: %s", - weechat_prefix ("network"), - IRC_COLOR_NOTICE, - /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ - _("Notice"), - IRC_COLOR_RESET, - irc_nick_color_for_message (server, - NULL, - pos_target), - pos_target, - IRC_COLOR_RESET, - pos_args); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, + (notify_private) ? "notify_private" : NULL, + server->nick, address), + "%s%s%s%s -> %s%s%s: %s", + weechat_prefix ("network"), + IRC_COLOR_NOTICE, + /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ + _("Notice"), + IRC_COLOR_RESET, + irc_nick_color_for_msg (server, 0, NULL, pos_target), + pos_target, + IRC_COLOR_RESET, + pos_args); } else { - nick_address = irc_protocol_nick_address (server, NULL, + nick_address = irc_protocol_nick_address (server, 0, NULL, nick, address); weechat_printf_date_tags ( ptr_buffer, date, irc_protocol_tags (command, (notify_private) ? "notify_private" : NULL, - nick, - address), + nick, address), "%s%s%s%s", weechat_prefix ("network"), nick_address, @@ -1481,69 +1536,65 @@ IRC_PROTOCOL_CALLBACK(part) display_host = weechat_config_boolean (irc_config_look_display_host_quit); if (pos_comment) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, - (local_part - || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) - || !weechat_config_boolean (irc_config_look_smart_filter) - || !weechat_config_boolean (irc_config_look_smart_filter_quit) - || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - nick, - address), - _("%s%s%s%s%s%s%s%s%s%s has left %s%s%s " - "%s(%s%s%s)"), - weechat_prefix ("quit"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? " (" : "", - IRC_COLOR_CHAT_HOST, - (display_host) ? address : "", - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? ")" : "", - IRC_COLOR_MESSAGE_QUIT, - IRC_COLOR_CHAT_CHANNEL, - ptr_channel->name, - IRC_COLOR_MESSAGE_QUIT, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_REASON_QUIT, - pos_comment, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags (command, + (local_part + || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) + || !weechat_config_boolean (irc_config_look_smart_filter) + || !weechat_config_boolean (irc_config_look_smart_filter_quit) + || ptr_nick_speaking) ? + NULL : "irc_smart_filter", + nick, address), + _("%s%s%s%s%s%s%s%s%s%s has left %s%s%s %s(%s%s%s)"), + weechat_prefix ("quit"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? " (" : "", + IRC_COLOR_CHAT_HOST, + (display_host) ? address : "", + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? ")" : "", + IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_CHAT_CHANNEL, + ptr_channel->name, + IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_REASON_QUIT, + pos_comment, + IRC_COLOR_CHAT_DELIMITERS); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, - (local_part - || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) - || !weechat_config_boolean (irc_config_look_smart_filter) - || !weechat_config_boolean (irc_config_look_smart_filter_quit) - || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - nick, - address), - _("%s%s%s%s%s%s%s%s%s%s has left " - "%s%s%s"), - weechat_prefix ("quit"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? " (" : "", - IRC_COLOR_CHAT_HOST, - (display_host) ? address : "", - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? ")" : "", - IRC_COLOR_MESSAGE_QUIT, - IRC_COLOR_CHAT_CHANNEL, - ptr_channel->name, - IRC_COLOR_MESSAGE_QUIT); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags (command, + (local_part + || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) + || !weechat_config_boolean (irc_config_look_smart_filter) + || !weechat_config_boolean (irc_config_look_smart_filter_quit) + || ptr_nick_speaking) ? + NULL : "irc_smart_filter", + nick, address), + _("%s%s%s%s%s%s%s%s%s%s has left %s%s%s"), + weechat_prefix ("quit"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? " (" : "", + IRC_COLOR_CHAT_HOST, + (display_host) ? address : "", + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? ")" : "", + IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_CHAT_CHANNEL, + ptr_channel->name, + IRC_COLOR_MESSAGE_QUIT); } } @@ -1570,10 +1621,12 @@ IRC_PROTOCOL_CALLBACK(part) free (join_string); } else - irc_command_join_server (server, ptr_channel->name, 1, 1); + irc_command_join_server (server, ptr_channel->name, + 1, 1); } else - irc_command_join_server (server, ptr_channel->name, 1, 1); + irc_command_join_server (server, ptr_channel->name, + 1, 1); } else { @@ -1633,8 +1686,8 @@ IRC_PROTOCOL_CALLBACK(pong) /* calculate lag (time diff with lag check) */ old_lag = server->lag; gettimeofday (&tv, NULL); - server->lag = (int) weechat_util_timeval_diff (&(server->lag_check_time), - &tv); + server->lag = (int)(weechat_util_timeval_diff (&(server->lag_check_time), + &tv) / 1000); if (old_lag != server->lag) weechat_bar_item_update ("lag"); @@ -1646,14 +1699,14 @@ IRC_PROTOCOL_CALLBACK(pong) } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, NULL), - date, - irc_protocol_tags (command, NULL, NULL, NULL), - "PONG%s%s", - (argc >= 4) ? ": " : "", - (argc >= 4) ? ((argv_eol[3][0] == ':') ? - argv_eol[3] + 1 : argv_eol[3]) : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, NULL, NULL, NULL), + "PONG%s%s", + (argc >= 4) ? ": " : "", + (argc >= 4) ? ((argv_eol[3][0] == ':') ? + argv_eol[3] + 1 : argv_eol[3]) : ""); } return WEECHAT_RC_OK; @@ -1732,47 +1785,49 @@ IRC_PROTOCOL_CALLBACK(privmsg) if (status_msg[0]) { /* message to channel ops/voiced (to "@#channel" or "+#channel") */ - weechat_printf_date_tags (ptr_channel->buffer, - date, - irc_protocol_tags (command, - "notify_message", - nick, address), - "%s%s%s%s%s(%s%s%s)%s: %s", - weechat_prefix ("network"), - "Msg", - (status_msg[0]) ? ":" : "", - status_msg, - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_message (server, ptr_nick, nick), - (nick && nick[0]) ? nick : "?", - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_args); + weechat_printf_date_tags ( + ptr_channel->buffer, + date, + irc_protocol_tags (command, "notify_message", nick, + address), + "%s%s%s%s%s(%s%s%s)%s: %s", + weechat_prefix ("network"), + "Msg", + (status_msg[0]) ? ":" : "", + status_msg, + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 0, ptr_nick, nick), + (nick && nick[0]) ? nick : "?", + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_args); } else { /* standard message (to "#channel") */ - str_color = irc_color_for_tags (irc_nick_find_color_name ((ptr_nick) ? ptr_nick->name : nick)); + str_color = irc_color_for_tags ( + irc_nick_find_color_name ((ptr_nick) ? ptr_nick->name : nick)); snprintf (str_tags, sizeof (str_tags), "notify_message,prefix_nick_%s", (str_color) ? str_color : "default"); if (str_color) free (str_color); - weechat_printf_date_tags (ptr_channel->buffer, - date, - irc_protocol_tags (command, str_tags, - nick, address), - "%s%s", - irc_nick_as_prefix (server, ptr_nick, - (ptr_nick) ? NULL : nick, - NULL), - pos_args); + weechat_printf_date_tags ( + ptr_channel->buffer, + date, + irc_protocol_tags (command, str_tags, nick, address), + "%s%s", + irc_nick_as_prefix (server, ptr_nick, + (ptr_nick) ? NULL : nick, + NULL), + pos_args); } - irc_channel_nick_speaking_add (ptr_channel, - nick, - weechat_string_has_highlight (pos_args, - server->nick)); + irc_channel_nick_speaking_add ( + ptr_channel, + nick, + weechat_string_has_highlight (pos_args, + server->nick)); irc_channel_nick_speaking_time_remove_old (ptr_channel); irc_channel_nick_speaking_time_add (server, ptr_channel, nick, time (NULL)); @@ -1813,13 +1868,24 @@ IRC_PROTOCOL_CALLBACK(privmsg) irc_channel_set_topic (ptr_channel, address); if (nick_is_me) - str_color = irc_color_for_tags (weechat_config_color (weechat_config_get ("weechat.color.chat_nick_self"))); + { + str_color = irc_color_for_tags ( + weechat_config_color ( + weechat_config_get ("weechat.color.chat_nick_self"))); + } else { if (weechat_config_boolean (irc_config_look_color_pv_nick_like_channel)) - str_color = irc_color_for_tags (irc_nick_find_color_name (nick)); + { + str_color = irc_color_for_tags ( + irc_nick_find_color_name (nick)); + } else - str_color = irc_color_for_tags (weechat_config_color (weechat_config_get ("weechat.color.chat_nick_other"))); + { + str_color = irc_color_for_tags ( + weechat_config_color ( + weechat_config_get ("weechat.color.chat_nick_other"))); + } } if (nick_is_me) { @@ -1838,15 +1904,16 @@ IRC_PROTOCOL_CALLBACK(privmsg) } if (str_color) free (str_color); - weechat_printf_date_tags (ptr_channel->buffer, - date, - irc_protocol_tags (command, str_tags, nick, - address), - "%s%s", - irc_nick_as_prefix (server, NULL, nick, - (nick_is_me) ? - IRC_COLOR_CHAT_NICK_SELF : irc_nick_color_for_pv (ptr_channel, nick)), - pos_args); + weechat_printf_date_tags ( + ptr_channel->buffer, + date, + irc_protocol_tags (command, str_tags, nick, address), + "%s%s", + irc_nick_as_prefix ( + server, NULL, nick, + (nick_is_me) ? + IRC_COLOR_CHAT_NICK_SELF : irc_nick_color_for_pv (ptr_channel, nick)), + pos_args); if (ptr_channel->has_quit_server) ptr_channel->has_quit_server = 0; @@ -1909,64 +1976,63 @@ IRC_PROTOCOL_CALLBACK(quit) display_host = weechat_config_boolean (irc_config_look_display_host_quit); if (pos_comment && pos_comment[0]) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, - (local_quit - || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) - || !weechat_config_boolean (irc_config_look_smart_filter) - || !weechat_config_boolean (irc_config_look_smart_filter_quit) - || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - nick, - address), - _("%s%s%s%s%s%s%s%s%s%s has quit " - "%s(%s%s%s)"), - weechat_prefix ("quit"), - (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? - irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? " (" : "", - IRC_COLOR_CHAT_HOST, - (display_host) ? address : "", - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? ")" : "", - IRC_COLOR_MESSAGE_QUIT, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_REASON_QUIT, - pos_comment, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags ( + command, + (local_quit + || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) + || !weechat_config_boolean (irc_config_look_smart_filter) + || !weechat_config_boolean (irc_config_look_smart_filter_quit) + || ptr_nick_speaking) ? + NULL : "irc_smart_filter", + nick, address), + _("%s%s%s%s%s%s%s%s%s%s has quit %s(%s%s%s)"), + weechat_prefix ("quit"), + (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? + irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? " (" : "", + IRC_COLOR_CHAT_HOST, + (display_host) ? address : "", + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? ")" : "", + IRC_COLOR_MESSAGE_QUIT, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_REASON_QUIT, + pos_comment, + IRC_COLOR_CHAT_DELIMITERS); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, - (local_quit - || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) - || !weechat_config_boolean (irc_config_look_smart_filter) - || !weechat_config_boolean (irc_config_look_smart_filter_quit) - || ptr_nick_speaking) ? - NULL : "irc_smart_filter", - nick, - address), - _("%s%s%s%s%s%s%s%s%s%s has quit"), - weechat_prefix ("quit"), - (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? - irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? " (" : "", - IRC_COLOR_CHAT_HOST, - (display_host) ? address : "", - IRC_COLOR_CHAT_DELIMITERS, - (display_host) ? ")" : "", - IRC_COLOR_MESSAGE_QUIT); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags ( + command, + (local_quit + || (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) + || !weechat_config_boolean (irc_config_look_smart_filter) + || !weechat_config_boolean (irc_config_look_smart_filter_quit) + || ptr_nick_speaking) ? + NULL : "irc_smart_filter", + nick, address), + _("%s%s%s%s%s%s%s%s%s%s has quit"), + weechat_prefix ("quit"), + (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ? + irc_nick_color_for_pv (ptr_channel, nick) : irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? " (" : "", + IRC_COLOR_CHAT_HOST, + (display_host) ? address : "", + IRC_COLOR_CHAT_DELIMITERS, + (display_host) ? ")" : "", + IRC_COLOR_MESSAGE_QUIT); } } if (!local_quit && ptr_nick) @@ -1996,24 +2062,24 @@ IRC_PROTOCOL_CALLBACK(server_mode_reason) if (irc_server_strcasecmp (server, server->nick, argv[2]) == 0) { pos_mode = argv[3]; - pos_args = (argc > 4) ? ((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : NULL; + pos_args = (argc > 4) ? + ((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : NULL; } else { pos_mode = argv[2]; - pos_args = (argc > 3) ? ((argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]) : NULL; + 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, NULL, - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s: %s", - weechat_prefix ("network"), - pos_mode, - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s: %s", + weechat_prefix ("network"), + pos_mode, + (pos_args) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -2038,15 +2104,13 @@ IRC_PROTOCOL_CALLBACK(numeric) pos_args = (argv_eol[2][0] == ':') ? argv_eol[2] + 1 : argv_eol[2]; } - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s", - weechat_prefix ("network"), - pos_args); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + pos_args); return WEECHAT_RC_OK; } @@ -2091,57 +2155,56 @@ IRC_PROTOCOL_CALLBACK(topic) if (pos_topic && pos_topic[0]) { - topic_color = irc_color_decode (pos_topic, - weechat_config_boolean (irc_config_network_colors_receive)); + topic_color = irc_color_decode ( + pos_topic, + weechat_config_boolean (irc_config_network_colors_receive)); 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_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%s%s%s has changed topic for %s%s%s " - "from \"%s%s%s\" to \"%s%s%s\""), - weechat_prefix ("network"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - argv[2], - IRC_COLOR_RESET, - IRC_COLOR_TOPIC_OLD, - (old_topic_color) ? old_topic_color : ptr_channel->topic, - IRC_COLOR_RESET, - IRC_COLOR_TOPIC_NEW, - (topic_color) ? topic_color : pos_topic, - IRC_COLOR_RESET); + old_topic_color = irc_color_decode ( + ptr_channel->topic, + weechat_config_boolean (irc_config_network_colors_receive)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%s%s%s has changed topic for %s%s%s from \"%s%s%s\" to " + "\"%s%s%s\""), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_RESET, + IRC_COLOR_TOPIC_OLD, + (old_topic_color) ? old_topic_color : ptr_channel->topic, + IRC_COLOR_RESET, + IRC_COLOR_TOPIC_NEW, + (topic_color) ? topic_color : pos_topic, + IRC_COLOR_RESET); if (old_topic_color) free (old_topic_color); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%s%s%s has changed topic for %s%s%s " - "to \"%s%s%s\""), - weechat_prefix ("network"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - argv[2], - IRC_COLOR_RESET, - IRC_COLOR_TOPIC_NEW, - (topic_color) ? topic_color : pos_topic, - IRC_COLOR_RESET); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%s%s%s has changed topic for %s%s%s to \"%s%s%s\""), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_RESET, + IRC_COLOR_TOPIC_NEW, + (topic_color) ? topic_color : pos_topic, + IRC_COLOR_RESET); } if (topic_color) free (topic_color); @@ -2151,45 +2214,44 @@ IRC_PROTOCOL_CALLBACK(topic) 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_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%s%s%s has unset topic for %s%s%s " - "(old topic: \"%s%s%s\")"), - weechat_prefix ("network"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - argv[2], - IRC_COLOR_RESET, - IRC_COLOR_TOPIC_OLD, - (old_topic_color) ? old_topic_color : ptr_channel->topic, - IRC_COLOR_RESET); + old_topic_color = irc_color_decode ( + ptr_channel->topic, + weechat_config_boolean (irc_config_network_colors_receive)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%s%s%s has unset topic for %s%s%s (old topic: " + "\"%s%s%s\")"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_RESET, + IRC_COLOR_TOPIC_OLD, + (old_topic_color) ? old_topic_color : ptr_channel->topic, + IRC_COLOR_RESET); if (old_topic_color) free (old_topic_color); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, NULL, NULL, - address), - _("%s%s%s%s has unset topic for %s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_server_message (server, ptr_nick, nick), - nick, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - argv[2], - IRC_COLOR_RESET); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_buffer), + date, + irc_protocol_tags (command, NULL, NULL, address), + _("%s%s%s%s has unset topic for %s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 1, ptr_nick, nick), + nick, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + argv[2], + IRC_COLOR_RESET); } } @@ -2215,16 +2277,15 @@ IRC_PROTOCOL_CALLBACK(wallops) 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"), - weechat_prefix ("network"), - (nick_address[0]) ? nick_address : "?", - (argv_eol[2][0] == ':') ? argv_eol[2] + 1 : argv_eol[2]); + nick_address = irc_protocol_nick_address (server, 0, 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"), + weechat_prefix ("network"), + (nick_address[0]) ? nick_address : "?", + (argv_eol[2][0] == ':') ? argv_eol[2] + 1 : argv_eol[2]); return WEECHAT_RC_OK; } @@ -2470,27 +2531,26 @@ IRC_PROTOCOL_CALLBACK(221) { IRC_PROTOCOL_MIN_ARGS(4); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[2], - command, NULL, NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - address), - _("%sUser mode for %s%s%s is %s[%s%s%s]"), - weechat_prefix ("network"), - irc_nick_color_for_server_message (server, NULL, - argv[2]), - argv[2], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3], - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, argv[2], command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, address), + _("%sUser mode for %s%s%s is %s[%s%s%s]"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 1, NULL, argv[2]), + argv[2], + IRC_COLOR_RESET, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3], + IRC_COLOR_CHAT_DELIMITERS); if (irc_server_strcasecmp (server, argv[2], server->nick) == 0) { - irc_mode_user_set (server, - (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3], - 1); + irc_mode_user_set ( + server, + (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3], + 1); } return WEECHAT_RC_OK; @@ -2526,22 +2586,19 @@ IRC_PROTOCOL_CALLBACK(301) || (strcmp (ptr_channel->away_message, pos_away_msg) != 0)) { ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whois", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, address), - _("%s%s[%s%s%s]%s is away: %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, - NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_away_msg); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whois", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, address), + _("%s%s[%s%s%s]%s is away: %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_away_msg); if (ptr_channel) { if (ptr_channel->away_message) @@ -2565,15 +2622,14 @@ IRC_PROTOCOL_CALLBACK(303) { IRC_PROTOCOL_MIN_ARGS(4); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - _("%sUsers online: %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_NICK, - (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%sUsers online: %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_NICK, + (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]); return WEECHAT_RC_OK; } @@ -2591,15 +2647,14 @@ IRC_PROTOCOL_CALLBACK(305) if (argc > 3) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "unaway", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s", - weechat_prefix ("network"), - (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "unaway", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]); } server->is_away = 0; @@ -2623,15 +2678,14 @@ IRC_PROTOCOL_CALLBACK(306) if (argc > 3) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "away", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s", - weechat_prefix ("network"), - (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "away", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]); } server->is_away = 1; @@ -2653,21 +2707,19 @@ IRC_PROTOCOL_CALLBACK(whois_nick_msg) { IRC_PROTOCOL_MIN_ARGS(5); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whois", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s] %s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whois", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); return WEECHAT_RC_OK; } @@ -2683,21 +2735,19 @@ IRC_PROTOCOL_CALLBACK(whowas_nick_msg) { IRC_PROTOCOL_MIN_ARGS(5); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whowas", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s] %s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whowas", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); return WEECHAT_RC_OK; } @@ -2713,25 +2763,23 @@ IRC_PROTOCOL_CALLBACK(311) { IRC_PROTOCOL_MIN_ARGS(8); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whois", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s] (%s%s@%s%s)%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - argv[5], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[7][0] == ':') ? argv_eol[7] + 1 : argv_eol[7]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whois", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] (%s%s@%s%s)%s: %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + argv[5], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[7][0] == ':') ? argv_eol[7] + 1 : argv_eol[7]); return WEECHAT_RC_OK; } @@ -2747,25 +2795,23 @@ IRC_PROTOCOL_CALLBACK(312) { IRC_PROTOCOL_MIN_ARGS(6); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whois", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s] %s%s %s(%s%s%s)", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - argv[4], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whois", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s %s(%s%s%s)", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + argv[4], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], + IRC_COLOR_CHAT_DELIMITERS); return WEECHAT_RC_OK; } @@ -2781,25 +2827,23 @@ IRC_PROTOCOL_CALLBACK(314) { IRC_PROTOCOL_MIN_ARGS(8); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whowas", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - _("%s%s[%s%s%s] (%s%s@%s%s)%s was %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - argv[5], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[7][0] == ':') ? argv_eol[7] + 1 : argv_eol[7]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whowas", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s] (%s%s@%s%s)%s was %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + argv[5], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[7][0] == ':') ? argv_eol[7] + 1 : argv_eol[7]); return WEECHAT_RC_OK; } @@ -2824,20 +2868,19 @@ IRC_PROTOCOL_CALLBACK(315) } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "who", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s[%s%s%s]%s %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "who", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s]%s %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); } return WEECHAT_RC_OK; @@ -2871,69 +2914,65 @@ IRC_PROTOCOL_CALLBACK(317) if (day > 0) { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%s%s[%s%s%s]%s idle: %s%d %s%s, " - "%s%02d %s%s %s%02d %s%s %s%02d " - "%s%s, signon at: %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - day, - IRC_COLOR_RESET, - NG_("day", "days", day), - IRC_COLOR_CHAT_CHANNEL, - hour, - IRC_COLOR_RESET, - NG_("hour", "hours", hour), - IRC_COLOR_CHAT_CHANNEL, - min, - IRC_COLOR_RESET, - NG_("minute", "minutes", min), - IRC_COLOR_CHAT_CHANNEL, - sec, - IRC_COLOR_RESET, - NG_("second", "seconds", sec), - IRC_COLOR_CHAT_CHANNEL, - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s]%s idle: %s%d %s%s, %s%02d %s%s %s%02d %s%s %s%02d " + "%s%s, signon at: %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + day, + IRC_COLOR_RESET, + NG_("day", "days", day), + IRC_COLOR_CHAT_CHANNEL, + hour, + IRC_COLOR_RESET, + NG_("hour", "hours", hour), + IRC_COLOR_CHAT_CHANNEL, + min, + IRC_COLOR_RESET, + NG_("minute", "minutes", min), + IRC_COLOR_CHAT_CHANNEL, + sec, + IRC_COLOR_RESET, + NG_("second", "seconds", sec), + IRC_COLOR_CHAT_CHANNEL, + weechat_util_get_time_string (&datetime)); } else { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%s%s[%s%s%s]%s idle: %s%02d %s%s " - "%s%02d %s%s %s%02d %s%s, " - "signon at: %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - hour, - IRC_COLOR_RESET, - NG_("hour", "hours", hour), - IRC_COLOR_CHAT_CHANNEL, - min, - IRC_COLOR_RESET, - NG_("minute", "minutes", min), - IRC_COLOR_CHAT_CHANNEL, - sec, - IRC_COLOR_RESET, - NG_("second", "seconds", sec), - IRC_COLOR_CHAT_CHANNEL, - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s]%s idle: %s%02d %s%s %s%02d %s%s %s%02d %s%s, " + "signon at: %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + hour, + IRC_COLOR_RESET, + NG_("hour", "hours", hour), + IRC_COLOR_CHAT_CHANNEL, + min, + IRC_COLOR_RESET, + NG_("minute", "minutes", min), + IRC_COLOR_CHAT_CHANNEL, + sec, + IRC_COLOR_RESET, + NG_("second", "seconds", sec), + IRC_COLOR_CHAT_CHANNEL, + weechat_util_get_time_string (&datetime)); } return WEECHAT_RC_OK; @@ -2955,17 +2994,16 @@ IRC_PROTOCOL_CALLBACK(321) pos_args = (argc > 4) ? ((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : NULL; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "list", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s%s%s", - weechat_prefix ("network"), - argv[3], - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "list", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s%s%s", + weechat_prefix ("network"), + argv[3], + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -2989,23 +3027,22 @@ IRC_PROTOCOL_CALLBACK(322) if (!server->cmd_list_regexp || (regexec (server->cmd_list_regexp, argv[3], 0, NULL, 0) == 0)) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "list", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s%s%s(%s%s%s)%s%s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - argv[4], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (pos_topic && pos_topic[0]) ? ": " : "", - (pos_topic && pos_topic[0]) ? pos_topic : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "list", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s%s%s(%s%s%s)%s%s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + argv[4], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (pos_topic && pos_topic[0]) ? ": " : "", + (pos_topic && pos_topic[0]) ? pos_topic : ""); } return WEECHAT_RC_OK; @@ -3027,15 +3064,13 @@ IRC_PROTOCOL_CALLBACK(323) 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, "list", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s", - weechat_prefix ("network"), - (pos_args && pos_args[0]) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, "list", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + (pos_args && pos_args[0]) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -3069,12 +3104,10 @@ IRC_PROTOCOL_CALLBACK(324) { weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer ( - server, NULL, - command, NULL, + server, NULL, command, NULL, (ptr_channel) ? ptr_channel->buffer : NULL), date, - irc_protocol_tags (command, "irc_numeric", NULL, - address), + irc_protocol_tags (command, "irc_numeric", NULL, address), _("%sMode %s%s %s[%s%s%s]"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, @@ -3114,41 +3147,39 @@ IRC_PROTOCOL_CALLBACK(327) if (pos_realname && pos_realname[0]) { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s[%s%s%s] %s%s %s %s(%s%s%s)", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - argv[5], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - pos_realname, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s %s %s(%s%s%s)", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + argv[5], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + pos_realname, + IRC_COLOR_CHAT_DELIMITERS); } else { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s[%s%s%s] %s%s %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - argv[5]); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + argv[5]); } return WEECHAT_RC_OK; @@ -3170,19 +3201,18 @@ IRC_PROTOCOL_CALLBACK(328) ptr_channel = irc_channel_search (server, argv[3]); if (ptr_channel) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%sURL for %s%s%s: %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - (argv_eol[4][0] == ':') ? - argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%sURL for %s%s%s: %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + (argv_eol[4][0] == ':') ? + argv_eol[4] + 1 : argv_eol[4]); } return WEECHAT_RC_OK; @@ -3212,33 +3242,31 @@ IRC_PROTOCOL_CALLBACK(329) if (weechat_hashtable_has_key (ptr_channel->join_msg_received, command) || weechat_hashtable_has_key (irc_config_hashtable_display_join_message, command)) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "created on" is a date */ - _("%sChannel created on %s"), - weechat_prefix ("network"), - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags (command, "irc_numeric", + NULL, NULL), + /* TRANSLATORS: "%s" after "created on" is a date */ + _("%sChannel created on %s"), + weechat_prefix ("network"), + weechat_util_get_time_string (&datetime)); } } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "created on" is a date */ - _("%sChannel %s%s%s created on %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "created on" is a date */ + _("%sChannel %s%s%s created on %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + weechat_util_get_time_string (&datetime)); } if (ptr_channel) @@ -3266,45 +3294,40 @@ IRC_PROTOCOL_CALLBACK(330_343) if (argc >= 6) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whois", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s[%s%s%s] %s%s %s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], - irc_nick_color_for_server_message (server, NULL, - argv[4]), - argv[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whois", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s %s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], + irc_nick_color_for_msg (server, 1, NULL, argv[4]), + argv[4]); } else { ptr_channel = (irc_channel_is_channel (server, argv[3])) ? irc_channel_search (server, argv[3]) : NULL; ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whois", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s[%s%s%s] %s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whois", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); } return WEECHAT_RC_OK; @@ -3326,16 +3349,15 @@ IRC_PROTOCOL_CALLBACK(331) ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - _("%sNo topic set for channel %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, NULL, ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%sNo topic set for channel %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3]); return WEECHAT_RC_OK; } @@ -3388,19 +3410,18 @@ IRC_PROTOCOL_CALLBACK(332) || (weechat_hashtable_has_key (ptr_channel->join_msg_received, command)) || weechat_hashtable_has_key (irc_config_hashtable_display_join_message, command)) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%sTopic for %s%s%s is \"%s%s\""), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - (topic_color) ? topic_color : ((pos_topic) ? pos_topic : ""), - IRC_COLOR_RESET); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%sTopic for %s%s%s is \"%s%s\""), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + (topic_color) ? topic_color : ((pos_topic) ? pos_topic : ""), + IRC_COLOR_RESET); } if (topic_color) @@ -3452,40 +3473,36 @@ IRC_PROTOCOL_CALLBACK(333) { if (topic_nick) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, - "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%sTopic set by %s%s%s%s%s%s%s%s%s on %s"), - weechat_prefix ("network"), - irc_nick_color_for_server_message (server, ptr_nick, topic_nick), - topic_nick, - IRC_COLOR_CHAT_DELIMITERS, - (topic_address && topic_address[0]) ? " (" : "", - IRC_COLOR_CHAT_HOST, - (topic_address) ? topic_address : "", - IRC_COLOR_CHAT_DELIMITERS, - (topic_address && topic_address[0]) ? ")" : "", - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%sTopic set by %s%s%s%s%s%s%s%s%s on %s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 1, ptr_nick, topic_nick), + topic_nick, + IRC_COLOR_CHAT_DELIMITERS, + (topic_address && topic_address[0]) ? " (" : "", + IRC_COLOR_CHAT_HOST, + (topic_address) ? topic_address : "", + IRC_COLOR_CHAT_DELIMITERS, + (topic_address && topic_address[0]) ? ")" : "", + IRC_COLOR_RESET, + weechat_util_get_time_string (&datetime)); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - ptr_channel->buffer), - date, - irc_protocol_tags (command, - "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%sTopic set on %s"), - weechat_prefix ("network"), - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, ptr_channel->buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%sTopic set on %s"), + weechat_prefix ("network"), + weechat_util_get_time_string (&datetime)); } } } @@ -3493,44 +3510,42 @@ IRC_PROTOCOL_CALLBACK(333) { if (topic_nick) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%sTopic for %s%s%s set by %s%s%s%s%s%s%s%s%s on %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, ptr_nick, topic_nick), - topic_nick, - IRC_COLOR_CHAT_DELIMITERS, - (topic_address && topic_address[0]) ? " (" : "", - IRC_COLOR_CHAT_HOST, - (topic_address) ? topic_address : "", - IRC_COLOR_CHAT_DELIMITERS, - (topic_address && topic_address[0]) ? ")" : "", - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%sTopic for %s%s%s set by %s%s%s%s%s%s%s%s%s on %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + irc_nick_color_for_msg (server, 1, ptr_nick, topic_nick), + topic_nick, + IRC_COLOR_CHAT_DELIMITERS, + (topic_address && topic_address[0]) ? " (" : "", + IRC_COLOR_CHAT_HOST, + (topic_address) ? topic_address : "", + IRC_COLOR_CHAT_DELIMITERS, + (topic_address && topic_address[0]) ? ")" : "", + IRC_COLOR_RESET, + weechat_util_get_time_string (&datetime)); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%sTopic for %s%s%s set on %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%sTopic for %s%s%s set on %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + weechat_util_get_time_string (&datetime)); } } @@ -3551,23 +3566,21 @@ IRC_PROTOCOL_CALLBACK(338) { IRC_PROTOCOL_MIN_ARGS(6); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, "whois", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s]%s %s %s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], - IRC_COLOR_CHAT_HOST, - argv[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, argv[3], command, "whois", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s]%s %s %s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], + IRC_COLOR_CHAT_HOST, + argv[4]); return WEECHAT_RC_OK; } @@ -3583,24 +3596,21 @@ IRC_PROTOCOL_CALLBACK(341) { IRC_PROTOCOL_MIN_ARGS(5); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[2], - command, NULL, NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - address), - _("%s%s%s%s has invited %s%s%s to %s%s%s"), - weechat_prefix ("network"), - irc_nick_color_for_server_message (server, NULL, - argv[2]), - argv[2], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - argv[3]), - argv[3], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - argv[4], - IRC_COLOR_RESET); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, argv[2], command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, address), + _("%s%s%s%s has invited %s%s%s to %s%s%s"), + weechat_prefix ("network"), + irc_nick_color_for_msg (server, 1, NULL, argv[2]), + argv[2], + IRC_COLOR_RESET, + irc_nick_color_for_msg (server, 1, NULL, argv[3]), + argv[3], + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + argv[4], + IRC_COLOR_RESET); return WEECHAT_RC_OK; } @@ -3616,19 +3626,17 @@ IRC_PROTOCOL_CALLBACK(344) { IRC_PROTOCOL_MIN_ARGS(5); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "reop", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - _("%sChannel reop %s%s%s: %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_HOST, - (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, "reop", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%sChannel reop %s%s%s: %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + IRC_COLOR_CHAT_HOST, + (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); return WEECHAT_RC_OK; } @@ -3644,18 +3652,16 @@ IRC_PROTOCOL_CALLBACK(345) { IRC_PROTOCOL_MIN_ARGS(5); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "reop", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s%s%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, "reop", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s%s%s: %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); return WEECHAT_RC_OK; } @@ -3673,7 +3679,7 @@ IRC_PROTOCOL_CALLBACK(346) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; - const char *invite_nick, *invite_address; + const char *nick_address; IRC_PROTOCOL_MIN_ARGS(5); @@ -3682,82 +3688,65 @@ IRC_PROTOCOL_CALLBACK(346) ptr_channel->buffer : server->buffer; if (argc >= 6) { - invite_nick = irc_message_get_nick_from_host (argv[5]); - invite_address = irc_message_get_address_from_host (argv[5]); + nick_address = irc_protocol_nick_address ( + server, 1, NULL, irc_message_get_nick_from_host (argv[5]), + irc_message_get_address_from_host (argv[5])); if (argc >= 7) { datetime = (time_t)(atol (argv[6])); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "invitelist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%s%s[%s%s%s] %s%s%s invited by " - "%s%s %s(%s%s%s)%s on %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - invite_nick), - invite_nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - invite_address, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "invitelist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%s%s[%s%s%s] %s%s%s invited by %s on %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", + weechat_util_get_time_string (&datetime)); } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "invitelist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%s%s[%s%s%s] %s%s%s invited by " - "%s%s %s(%s%s%s)"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - invite_nick), - invite_nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - invite_address, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "invitelist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s] %s%s%s invited by %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?"); } } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "invitelist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%s%s[%s%s%s] %s%s%s invited"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - IRC_COLOR_RESET); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "invitelist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s] %s%s%s invited"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET); } return WEECHAT_RC_OK; @@ -3784,21 +3773,20 @@ IRC_PROTOCOL_CALLBACK(347) ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "invitelist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s]%s%s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "invitelist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s]%s%s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -3816,63 +3804,76 @@ IRC_PROTOCOL_CALLBACK(348) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; - const char *exception_nick, *exception_address; + const char *nick_address; IRC_PROTOCOL_MIN_ARGS(5); ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; - if (argc >= 7) + if (argc >= 6) { - exception_nick = irc_message_get_nick_from_host (argv[5]); - exception_address = irc_message_get_address_from_host (argv[5]); - datetime = (time_t)(atol (argv[6])); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "exceptionlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%s%s[%s%s%s]%s exception %s%s%s " - "by %s%s %s(%s%s%s)%s on %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_HOST, - argv[4], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - exception_nick), - exception_nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - exception_address, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + nick_address = irc_protocol_nick_address ( + server, 1, NULL, irc_message_get_nick_from_host (argv[5]), + irc_message_get_address_from_host (argv[5])); + if (argc >= 7) + { + datetime = (time_t)(atol (argv[6])); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "exceptionlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%s%s[%s%s%s]%s exception %s%s%s by %s on %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", + weechat_util_get_time_string (&datetime)); + } + else + { + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "exceptionlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s]%s exception %s%s%s by %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?"); + } } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "exceptionlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%s%s[%s%s%s]%s exception %s%s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_HOST, - argv[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "exceptionlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s]%s exception %s%s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_HOST, + argv[4]); } return WEECHAT_RC_OK; @@ -3899,21 +3900,20 @@ IRC_PROTOCOL_CALLBACK(349) ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "exceptionlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s]%s%s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "exceptionlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s]%s%s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -3936,26 +3936,26 @@ IRC_PROTOCOL_CALLBACK(351) if (argc > 5) { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s %s (%s)", - weechat_prefix ("network"), - argv[3], - argv[4], - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5]); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s %s (%s)", + weechat_prefix ("network"), + argv[3], + argv[4], + (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5]); } else { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s %s", - weechat_prefix ("network"), - argv[3], - argv[4]); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s %s", + weechat_prefix ("network"), + argv[3], + argv[4]); } return WEECHAT_RC_OK; @@ -4027,33 +4027,30 @@ IRC_PROTOCOL_CALLBACK(352) /* display output of who (manual who from user) */ if (!ptr_channel || (ptr_channel->checking_away <= 0)) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "who", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s[%s%s%s] %s%s %s(%s%s@%s%s)%s " - "%s%s%s%s(%s)", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_server_message (server, NULL, - argv[7]), - argv[7], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - argv[5], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (pos_attr) ? pos_attr : "", - (pos_attr) ? " " : "", - (pos_hopcount) ? pos_hopcount : "", - (pos_hopcount) ? " " : "", - (pos_realname) ? pos_realname : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "who", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s] %s%s %s(%s%s@%s%s)%s %s%s%s%s(%s)", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_color_for_msg (server, 1, NULL, argv[7]), + argv[7], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + argv[5], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (pos_attr) ? pos_attr : "", + (pos_attr) ? " " : "", + (pos_hopcount) ? pos_hopcount : "", + (pos_hopcount) ? " " : "", + (pos_realname) ? pos_realname : ""); } return WEECHAT_RC_OK; @@ -4139,11 +4136,11 @@ IRC_PROTOCOL_CALLBACK(353) if (!irc_nick_new (server, ptr_channel, nickname, pos_host, prefixes, 0)) { - weechat_printf (server->buffer, - _("%s%s: cannot create nick \"%s\" " - "for channel \"%s\""), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, nickname, ptr_channel->name); + weechat_printf ( + server->buffer, + _("%s%s: cannot create nick \"%s\" for channel \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, nickname, + ptr_channel->name); } } else if (!ptr_channel && str_nicks) @@ -4156,8 +4153,9 @@ IRC_PROTOCOL_CALLBACK(353) if (prefixes) { strcat (str_nicks, - weechat_color (irc_nick_get_prefix_color_name (server, - prefixes[0]))); + weechat_color ( + irc_nick_get_prefix_color_name (server, + prefixes[0]))); strcat (str_nicks, prefixes); } if (weechat_config_boolean (irc_config_look_color_nicks_in_names)) @@ -4179,21 +4177,20 @@ IRC_PROTOCOL_CALLBACK(353) if (!ptr_channel) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "names", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%sNicks %s%s%s: %s[%s%s%s]"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - pos_channel, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (str_nicks) ? str_nicks : "", - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "names", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%sNicks %s%s%s: %s[%s%s%s]"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + pos_channel, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (str_nicks) ? str_nicks : "", + IRC_COLOR_CHAT_DELIMITERS); } if (str_nicks) @@ -4296,21 +4293,21 @@ IRC_PROTOCOL_CALLBACK(366) i++; } } - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "names", - ptr_channel->buffer), - date, - irc_protocol_tags (command, - "irc_numeric", - NULL, NULL), - _("%sNicks %s%s%s: %s[%s%s]"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - ptr_channel->name, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_DELIMITERS, - string, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "names", + ptr_channel->buffer), + date, + irc_protocol_tags ( + command, "irc_numeric", NULL, NULL), + _("%sNicks %s%s%s: %s[%s%s]"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + ptr_channel->name, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_DELIMITERS, + string, + IRC_COLOR_CHAT_DELIMITERS); free (string); } } @@ -4370,47 +4367,45 @@ IRC_PROTOCOL_CALLBACK(366) num_normal, IRC_COLOR_RESET, NG_("normal", "normals", num_normal)); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "names", - ptr_channel->buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%sChannel %s%s%s: %s%d%s %s %s(%s%s)"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - ptr_channel->name, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - num_nicks, - IRC_COLOR_RESET, - NG_("nick", "nicks", num_nicks), - IRC_COLOR_CHAT_DELIMITERS, - str_nicks_count, - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "names", ptr_channel->buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%sChannel %s%s%s: %s%d%s %s %s(%s%s)"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + ptr_channel->name, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + num_nicks, + IRC_COLOR_RESET, + NG_("nick", "nicks", num_nicks), + IRC_COLOR_CHAT_DELIMITERS, + str_nicks_count, + IRC_COLOR_CHAT_DELIMITERS); } if (!weechat_hashtable_has_key (ptr_channel->join_msg_received, command)) { - irc_command_mode_server (server, ptr_channel, NULL, + irc_command_mode_server (server, "MODE", ptr_channel, NULL, IRC_SERVER_SEND_OUTQ_PRIO_LOW); irc_channel_check_away (server, ptr_channel); } } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "names", - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s%s%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_RESET, - (argv[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "names", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s%s%s: %s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_RESET, + (argv[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]); } if (ptr_channel) @@ -4436,67 +4431,75 @@ IRC_PROTOCOL_CALLBACK(367) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; + const char *nick_address; IRC_PROTOCOL_MIN_ARGS(5); ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; - if (argc >= 7) + + if (argc >= 6) { - datetime = (time_t)(atol (argv[6])); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "banlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%s%s[%s%s%s] %s%s%s banned by " - "%s%s %s(%s%s%s)%s on %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - irc_message_get_nick_from_host (argv[5])), - irc_message_get_nick_from_host (argv[5]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[5]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + nick_address = irc_protocol_nick_address ( + server, 1, NULL, irc_message_get_nick_from_host (argv[5]), + irc_message_get_address_from_host (argv[5])); + if (argc >= 7) + { + datetime = (time_t)(atol (argv[6])); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "banlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%s%s[%s%s%s] %s%s%s banned by %s on %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", + weechat_util_get_time_string (&datetime)); + } + else + { + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "banlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s] %s%s%s banned by %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?"); + } } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "banlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%s%s[%s%s%s] %s%s%s banned by " - "%s%s %s(%s%s%s)"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[4], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - irc_message_get_nick_from_host (argv[5])), - irc_message_get_nick_from_host (argv[5]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[5]), - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "banlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s] %s%s%s banned"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[4], + IRC_COLOR_RESET); } return WEECHAT_RC_OK; @@ -4523,21 +4526,20 @@ IRC_PROTOCOL_CALLBACK(368) ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "banlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s[%s%s%s]%s%s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "banlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s]%s%s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -4566,21 +4568,20 @@ IRC_PROTOCOL_CALLBACK(432) alternate_nick = irc_server_get_alternate_nick (server); if (!alternate_nick) { - weechat_printf_date_tags (ptr_buffer, date, NULL, - _("%s%s: all declared nicknames are " - "already in use or invalid, closing " - "connection with server"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME); + weechat_printf_date_tags ( + ptr_buffer, date, NULL, + _("%s%s: all declared nicknames are already in use or " + "invalid, closing connection with server"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); irc_server_disconnect (server, 0, 1); return WEECHAT_RC_OK; } - weechat_printf_date_tags (ptr_buffer, date, NULL, - _("%s%s: nickname \"%s\" is invalid, " - "trying nickname \"%s\""), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, server->nick, alternate_nick); + weechat_printf_date_tags ( + ptr_buffer, date, NULL, + _("%s%s: nickname \"%s\" is invalid, trying nickname \"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + server->nick, alternate_nick); irc_server_set_nick (server, alternate_nick); @@ -4610,21 +4611,21 @@ IRC_PROTOCOL_CALLBACK(433) alternate_nick = irc_server_get_alternate_nick (server); if (!alternate_nick) { - weechat_printf_date_tags (ptr_buffer, date, NULL, - _("%s%s: all declared nicknames are " - "already in use, closing " - "connection with server"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME); + weechat_printf_date_tags ( + ptr_buffer, date, NULL, + _("%s%s: all declared nicknames are already in use, closing " + "connection with server"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); irc_server_disconnect (server, 0, 1); return WEECHAT_RC_OK; } - weechat_printf_date_tags (ptr_buffer, date, NULL, - _("%s%s: nickname \"%s\" is already in use, " - "trying nickname \"%s\""), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, server->nick, alternate_nick); + weechat_printf_date_tags ( + ptr_buffer, date, NULL, + _("%s%s: nickname \"%s\" is already in use, trying nickname " + "\"%s\""), + weechat_prefix ("network"), IRC_PLUGIN_NAME, + server->nick, alternate_nick); irc_server_set_nick (server, alternate_nick); @@ -4668,21 +4669,21 @@ IRC_PROTOCOL_CALLBACK(437) alternate_nick = irc_server_get_alternate_nick (server); if (!alternate_nick) { - weechat_printf_date_tags (ptr_buffer, date, NULL, - _("%s%s: all declared nicknames are " - "already in use or invalid, closing " - "connection with server"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME); + weechat_printf_date_tags ( + ptr_buffer, date, NULL, + _("%s%s: all declared nicknames are already in use or " + "invalid, closing connection with server"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); irc_server_disconnect (server, 0, 1); return WEECHAT_RC_OK; } - weechat_printf_date_tags (ptr_buffer, date, NULL, - _("%s%s: nickname \"%s\" is unavailable, " - "trying nickname \"%s\""), - weechat_prefix ("error"), - IRC_PLUGIN_NAME, server->nick, alternate_nick); + weechat_printf_date_tags ( + ptr_buffer, date, NULL, + _("%s%s: nickname \"%s\" is unavailable, trying nickname " + "\"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + server->nick, alternate_nick); irc_server_set_nick (server, alternate_nick); @@ -4711,26 +4712,26 @@ IRC_PROTOCOL_CALLBACK(438) if (argc >= 5) { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s (%s => %s)", - weechat_prefix ("network"), - (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4], - argv[2], - argv[3]); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s (%s => %s)", + weechat_prefix ("network"), + (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4], + argv[2], + argv[3]); } else { - weechat_printf_date_tags (ptr_buffer, - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s %s", - weechat_prefix ("network"), - argv[2], - argv[3]); + weechat_printf_date_tags ( + ptr_buffer, + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s %s", + weechat_prefix ("network"), + argv[2], + argv[3]); } return WEECHAT_RC_OK; @@ -4748,67 +4749,75 @@ IRC_PROTOCOL_CALLBACK(728) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; time_t datetime; + const char *nick_address; IRC_PROTOCOL_MIN_ARGS(6); ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; - if (argc >= 8) + + if (argc >= 7) { - datetime = (time_t)(atol (argv[7])); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "quietlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - /* TRANSLATORS: "%s" after "on" is a date */ - _("%s%s[%s%s%s] %s%s%s quieted by " - "%s%s %s(%s%s%s)%s on %s"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[5], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - irc_message_get_nick_from_host (argv[6])), - irc_message_get_nick_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - weechat_util_get_time_string (&datetime)); + nick_address = irc_protocol_nick_address ( + server, 1, NULL, irc_message_get_nick_from_host (argv[6]), + irc_message_get_address_from_host (argv[6])); + if (argc >= 8) + { + datetime = (time_t)(atol (argv[7])); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "quietlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + /* TRANSLATORS: "%s" after "on" is a date */ + _("%s%s[%s%s%s] %s%s%s quieted by %s on %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[5], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?", + weechat_util_get_time_string (&datetime)); + } + else + { + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "quietlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s] %s%s%s quieted by %s"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[5], + IRC_COLOR_RESET, + (nick_address[0]) ? nick_address : "?"); + } } else { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "quietlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - _("%s%s[%s%s%s] %s%s%s quieted by " - "%s%s %s(%s%s%s)"), - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[5], - IRC_COLOR_RESET, - irc_nick_color_for_server_message (server, NULL, - irc_message_get_nick_from_host (argv[6])), - irc_message_get_nick_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - irc_message_get_address_from_host (argv[6]), - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "quietlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + _("%s%s[%s%s%s] %s%s%s quieted"), + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[5], + IRC_COLOR_RESET); } return WEECHAT_RC_OK; @@ -4835,21 +4844,20 @@ IRC_PROTOCOL_CALLBACK(729) ptr_channel = irc_channel_search (server, argv[3]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, "quietlist", - ptr_buffer), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s[%s%s%s]%s%s%s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_CHANNEL, - argv[3], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "quietlist", ptr_buffer), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s[%s%s%s]%s%s%s", + weechat_prefix ("network"), + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_CHANNEL, + argv[3], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (pos_args) ? " " : "", + (pos_args) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -4946,15 +4954,14 @@ IRC_PROTOCOL_CALLBACK(732) 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, - NULL), - "%s%s", - weechat_prefix ("network"), - (pos_args && pos_args[0]) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "monitor", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + (pos_args && pos_args[0]) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -4975,15 +4982,14 @@ IRC_PROTOCOL_CALLBACK(733) 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, - NULL), - "%s%s", - weechat_prefix ("network"), - (pos_args && pos_args[0]) ? pos_args : ""); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "monitor", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + (pos_args && pos_args[0]) ? pos_args : ""); return WEECHAT_RC_OK; } @@ -4999,16 +5005,15 @@ 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, - NULL), - "%s%s (%s)", - weechat_prefix ("error"), - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], - argv[3]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer ( + server, NULL, command, "monitor", NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s (%s)", + weechat_prefix ("error"), + (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], + argv[3]); return WEECHAT_RC_OK; } @@ -5024,19 +5029,17 @@ IRC_PROTOCOL_CALLBACK(900) { IRC_PROTOCOL_MIN_ARGS(6); - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, argv[3], - command, NULL, - NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, - NULL), - "%s%s %s(%s%s%s)", - weechat_prefix ("network"), - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_CHAT_HOST, - argv[3], - IRC_COLOR_CHAT_DELIMITERS); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, argv[3], command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s %s(%s%s%s)", + weechat_prefix ("network"), + (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_CHAT_HOST, + argv[3], + IRC_COLOR_CHAT_DELIMITERS); return WEECHAT_RC_OK; } @@ -5054,15 +5057,13 @@ IRC_PROTOCOL_CALLBACK(901) if (argc >= 7) { - weechat_printf_date_tags (irc_msgbuffer_get_target_buffer (server, NULL, - command, NULL, - NULL), - date, - irc_protocol_tags (command, "irc_numeric", - NULL, NULL), - "%s%s", - weechat_prefix ("network"), - (argv_eol[6][0] == ':') ? argv_eol[6] + 1 : argv_eol[6]); + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + (argv_eol[6][0] == ':') ? argv_eol[6] + 1 : argv_eol[6]); } else { @@ -5403,8 +5404,11 @@ irc_protocol_recv_command (struct t_irc_server *server, } nick = (nick1) ? strdup (nick1) : NULL; address = (address1) ? strdup (address1) : NULL; - address_color = (address) ? irc_color_decode (address, - weechat_config_boolean (irc_config_network_colors_receive)) : NULL; + address_color = (address) ? + irc_color_decode ( + address, + weechat_config_boolean (irc_config_network_colors_receive)) : + NULL; host = (host1) ? strdup (host1) : NULL; if (host) { @@ -5413,16 +5417,20 @@ irc_protocol_recv_command (struct t_irc_server *server, pos_space[0] = '\0'; } host_no_color = (host) ? irc_color_decode (host, 0) : NULL; - host_color = (host) ? irc_color_decode (host, - weechat_config_boolean (irc_config_network_colors_receive)) : NULL; + host_color = (host) ? + irc_color_decode ( + host, + weechat_config_boolean (irc_config_network_colors_receive)) : + NULL; /* check if message is ignored or not */ ptr_channel = NULL; if (msg_channel) ptr_channel = irc_channel_search (server, msg_channel); - message_ignored = irc_ignore_check (server, - (ptr_channel) ? ptr_channel->name : msg_channel, - nick, host_no_color); + message_ignored = irc_ignore_check ( + server, + (ptr_channel) ? ptr_channel->name : msg_channel, + nick, host_no_color); /* send signal with received command, even if command is ignored */ irc_server_send_signal (server, "irc_raw_in", msg_command, @@ -5439,7 +5447,8 @@ irc_protocol_recv_command (struct t_irc_server *server, cmd_found = -1; for (i = 0; irc_protocol_messages[i].name; i++) { - if (weechat_strcasecmp (irc_protocol_messages[i].name, msg_command) == 0) + if (weechat_strcasecmp (irc_protocol_messages[i].name, + msg_command) == 0) { cmd_found = i; break; @@ -5482,10 +5491,15 @@ irc_protocol_recv_command (struct t_irc_server *server, if (irc_message) { if (decode_color) - dup_irc_message = irc_color_decode (irc_message, - weechat_config_boolean (irc_config_network_colors_receive)); + { + dup_irc_message = irc_color_decode ( + irc_message, + weechat_config_boolean (irc_config_network_colors_receive)); + } else + { dup_irc_message = strdup (irc_message); + } } else dup_irc_message = NULL; diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c index 553507967..da63f0ae3 100644 --- a/src/plugins/irc/irc-redirect.c +++ b/src/plugins/irc/irc-redirect.c @@ -293,10 +293,10 @@ irc_redirect_pattern_new (const char *name, int temp_pattern, int timeout, if (!cmd_stop || !cmd_stop[0]) { - weechat_printf (NULL, - _("%s%s: missing argument \"%s\" for redirect pattern"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - "cmd_stop"); + weechat_printf ( + NULL, + _("%s%s: missing argument \"%s\" for redirect pattern"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "cmd_stop"); return NULL; } @@ -304,10 +304,10 @@ irc_redirect_pattern_new (const char *name, int temp_pattern, int timeout, ptr_redirect_pattern = irc_redirect_pattern_search (name); if (ptr_redirect_pattern) { - weechat_printf (NULL, - _("%s%s: redirect pattern \"%s\" already exists"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - name); + weechat_printf ( + NULL, + _("%s%s: redirect pattern \"%s\" already exists"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, name); return NULL; } @@ -512,42 +512,48 @@ irc_redirect_new (struct t_irc_server *server, if (!server->is_connected) { - weechat_printf (NULL, - _("%s%s: no connection to server \"%s\" for redirect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->name); + weechat_printf ( + NULL, + _("%s%s: no connection to server \"%s\" for redirect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, server->name); return NULL; } if (!pattern || !pattern[0]) { - weechat_printf (NULL, _("%s%s: missing argument \"%s\" for redirect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "pattern"); + weechat_printf ( + NULL, + _("%s%s: missing argument \"%s\" for redirect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "pattern"); return NULL; } if (!signal || !signal[0]) { - weechat_printf (NULL, _("%s%s: missing argument \"%s\" for redirect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "signal"); + weechat_printf ( + NULL, + _("%s%s: missing argument \"%s\" for redirect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "signal"); return NULL; } ptr_redirect_pattern = irc_redirect_pattern_search (pattern); if (!ptr_redirect_pattern) { - weechat_printf (NULL, _("%s%s: redirect pattern \"%s\" not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - pattern); + weechat_printf ( + NULL, + _("%s%s: redirect pattern \"%s\" not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, pattern); return NULL; } - new_redirect = irc_redirect_new_with_commands (server, pattern, signal, - count, string, - (timeout > 0) ? timeout : ptr_redirect_pattern->timeout, - ptr_redirect_pattern->cmd_start, - ptr_redirect_pattern->cmd_stop, - ptr_redirect_pattern->cmd_extra, - cmd_filter); + new_redirect = irc_redirect_new_with_commands ( + server, pattern, signal, + count, string, + (timeout > 0) ? timeout : ptr_redirect_pattern->timeout, + ptr_redirect_pattern->cmd_start, + ptr_redirect_pattern->cmd_stop, + ptr_redirect_pattern->cmd_extra, + cmd_filter); /* * remove redirect pattern if it is temporary (created by external @@ -615,13 +621,12 @@ irc_redirect_init_command (struct t_irc_redirect *redirect, if (weechat_irc_plugin->debug >= 2) { - weechat_printf (redirect->server->buffer, - _("%s: starting redirection for command \"%s\" " - "on server \"%s\" (redirect pattern: \"%s\")"), - IRC_PLUGIN_NAME, - redirect->command, - redirect->server->name, - redirect->pattern); + weechat_printf ( + redirect->server->buffer, + _("%s: starting redirection for command \"%s\" on server \"%s\" " + "(redirect pattern: \"%s\")"), + IRC_PLUGIN_NAME, redirect->command, redirect->server->name, + redirect->pattern); } } @@ -1254,19 +1259,19 @@ irc_redirect_pattern_hsignal_cb (void *data, const char *signal, if (!pattern || !pattern[0]) { - weechat_printf (NULL, - _("%s%s: missing argument \"%s\" for redirect " - "pattern"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "pattern"); + weechat_printf ( + NULL, + _("%s%s: missing argument \"%s\" for redirect pattern"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "pattern"); return WEECHAT_RC_ERROR; } if (!cmd_stop || !cmd_stop[0]) { - weechat_printf (NULL, - _("%s%s: missing argument \"%s\" for redirect " - "pattern"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "cmd_stop"); + weechat_printf ( + NULL, + _("%s%s: missing argument \"%s\" for redirect pattern"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "cmd_stop"); return WEECHAT_RC_ERROR; } @@ -1322,17 +1327,19 @@ irc_redirect_command_hsignal_cb (void *data, const char *signal, if (!server || !server[0]) { - weechat_printf (NULL, - _("%s%s: missing argument \"%s\" for redirect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, "server"); + weechat_printf ( + NULL, + _("%s%s: missing argument \"%s\" for redirect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "server"); return WEECHAT_RC_ERROR; } ptr_server = irc_server_search (server); if (!ptr_server) { - weechat_printf (NULL, - _("%s%s: server \"%s\" not found for redirect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, server); + weechat_printf ( + NULL, + _("%s%s: server \"%s\" not found for redirect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, server); return WEECHAT_RC_ERROR; } diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 5f8418b61..cf8cef15b 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -89,7 +89,7 @@ char *irc_server_option_string[IRC_SERVER_NUM_OPTIONS] = char *irc_server_option_default[IRC_SERVER_NUM_OPTIONS] = { "", "", "on", - "off", "", "NORMAL", "2048", "", + "off", "", "NORMAL:-VERS-SSL3.0", "2048", "", "on", "", "", "plain", "", "", "15", @@ -325,14 +325,14 @@ irc_server_sasl_enabled (struct t_irc_server *server) int sasl_mechanism, rc; char *sasl_username, *sasl_password; - sasl_mechanism = IRC_SERVER_OPTION_INTEGER(server, - IRC_SERVER_OPTION_SASL_MECHANISM); - sasl_username = weechat_string_eval_expression (IRC_SERVER_OPTION_STRING(server, - IRC_SERVER_OPTION_SASL_USERNAME), - NULL, NULL, NULL); - sasl_password = weechat_string_eval_expression (IRC_SERVER_OPTION_STRING(server, - IRC_SERVER_OPTION_SASL_PASSWORD), - NULL, NULL, NULL); + sasl_mechanism = IRC_SERVER_OPTION_INTEGER( + server, IRC_SERVER_OPTION_SASL_MECHANISM); + sasl_username = weechat_string_eval_expression ( + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SASL_USERNAME), + NULL, NULL, NULL); + sasl_password = weechat_string_eval_expression ( + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SASL_PASSWORD), + NULL, NULL, NULL); /* * SASL is enabled if using mechanism "external" @@ -403,11 +403,12 @@ irc_server_set_addresses (struct t_irc_server *server, const char *addresses) /* set new addresses/ports */ if (addresses && addresses[0]) { - server->addresses_array = weechat_string_split (addresses, - ",", 0, 0, - &server->addresses_count); - server->ports_array = malloc (server->addresses_count * sizeof (server->ports_array[0])); - server->retry_array = malloc (server->addresses_count * sizeof (server->retry_array[0])); + server->addresses_array = weechat_string_split ( + addresses, ",", 0, 0, &server->addresses_count); + server->ports_array = malloc ( + server->addresses_count * sizeof (server->ports_array[0])); + server->retry_array = malloc ( + server->addresses_count * sizeof (server->retry_array[0])); for (i = 0; i < server->addresses_count; i++) { pos = strchr (server->addresses_array[i], '/'); @@ -474,9 +475,9 @@ irc_server_set_nicks (struct t_irc_server *server, const char *nicks) } /* set new nicks */ - server->nicks_array = weechat_string_split ((nicks) ? nicks : IRC_SERVER_DEFAULT_NICKS, - ",", 0, 0, - &server->nicks_count); + server->nicks_array = weechat_string_split ( + (nicks) ? nicks : IRC_SERVER_DEFAULT_NICKS, + ",", 0, 0, &server->nicks_count); } /* @@ -1200,9 +1201,10 @@ irc_server_alloc_with_url (const char *irc_url) "%s/%s", pos_address, (pos_port && pos_port[0]) ? pos_port : default_port); - weechat_config_option_set (ptr_server->options[IRC_SERVER_OPTION_ADDRESSES], - server_address, - 1); + weechat_config_option_set ( + ptr_server->options[IRC_SERVER_OPTION_ADDRESSES], + server_address, + 1); free (server_address); } } @@ -1221,21 +1223,24 @@ irc_server_alloc_with_url (const char *irc_url) snprintf (server_nicks, length, "%s,%s1,%s2,%s3,%s4", pos_nick, pos_nick, pos_nick, pos_nick, pos_nick); - weechat_config_option_set (ptr_server->options[IRC_SERVER_OPTION_NICKS], - server_nicks, - 1); + weechat_config_option_set ( + ptr_server->options[IRC_SERVER_OPTION_NICKS], + server_nicks, + 1); free (server_nicks); } } if (pos_password && pos_password[0]) { - weechat_config_option_set (ptr_server->options[IRC_SERVER_OPTION_PASSWORD], - pos_password, - 1); + weechat_config_option_set ( + ptr_server->options[IRC_SERVER_OPTION_PASSWORD], + pos_password, + 1); } - weechat_config_option_set (ptr_server->options[IRC_SERVER_OPTION_AUTOCONNECT], - "on", - 1); + weechat_config_option_set ( + ptr_server->options[IRC_SERVER_OPTION_AUTOCONNECT], + "on", + 1); /* autojoin */ if (pos_channel && pos_channel[0]) { @@ -1252,9 +1257,10 @@ irc_server_alloc_with_url (const char *irc_url) } if (server_autojoin) { - weechat_config_option_set (ptr_server->options[IRC_SERVER_OPTION_AUTOJOIN], - server_autojoin, - 1); + weechat_config_option_set ( + ptr_server->options[IRC_SERVER_OPTION_AUTOJOIN], + server_autojoin, + 1); free (server_autojoin); } } @@ -1574,16 +1580,18 @@ irc_server_copy (struct t_irc_server *server, const char *new_name) { if (!weechat_infolist_integer (infolist, "value_is_null")) { - option_name = weechat_infolist_string (infolist, "option_name"); + option_name = weechat_infolist_string (infolist, + "option_name"); pos = strrchr (option_name, '.'); if (pos) { index_option = irc_server_search_option (pos + 1); if (index_option >= 0) { - weechat_config_option_set (new_server->options[index_option], - weechat_infolist_string (infolist, "value"), - 1); + weechat_config_option_set ( + new_server->options[index_option], + weechat_infolist_string (infolist, "value"), + 1); } } } @@ -1630,8 +1638,8 @@ irc_server_rename (struct t_irc_server *server, const char *new_server_name) { while (weechat_infolist_next (infolist)) { - ptr_option = weechat_config_get (weechat_infolist_string (infolist, - "full_name")); + ptr_option = weechat_config_get ( + weechat_infolist_string (infolist, "full_name")); if (ptr_option) { option_name = weechat_infolist_string (infolist, "option_name"); @@ -1668,7 +1676,8 @@ irc_server_rename (struct t_irc_server *server, const char *new_server_name) { if (ptr_channel->buffer) { - buffer_name = irc_buffer_build_name (server->name, ptr_channel->name); + buffer_name = irc_buffer_build_name (server->name, + ptr_channel->name); weechat_buffer_set (ptr_channel->buffer, "name", buffer_name); weechat_buffer_set (ptr_channel->buffer, "localvar_set_server", server->name); @@ -1747,19 +1756,21 @@ irc_server_send (struct t_irc_server *server, const char *buffer, int size_buf) if (!server) { - weechat_printf (NULL, - _("%s%s: sending data to server: null pointer (please " - "report problem to developers)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: sending data to server: null pointer (please report " + "problem to developers)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return 0; } if (size_buf <= 0) { - weechat_printf (server->buffer, - _("%s%s: sending data to server: empty buffer (please " - "report problem to developers)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: sending data to server: empty buffer (please report " + "problem to developers)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return 0; } @@ -1775,20 +1786,20 @@ irc_server_send (struct t_irc_server *server, const char *buffer, int size_buf) #ifdef HAVE_GNUTLS if (server->ssl_connected) { - weechat_printf (server->buffer, - _("%s%s: sending data to server: error %d %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - rc, - gnutls_strerror (rc)); + weechat_printf ( + server->buffer, + _("%s%s: sending data to server: error %d %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + rc, gnutls_strerror (rc)); } else #endif { - weechat_printf (server->buffer, - _("%s%s: sending data to server: error %d %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - errno, - strerror (errno)); + weechat_printf ( + server->buffer, + _("%s%s: sending data to server: error %d %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + errno, strerror (errno)); } } @@ -1857,10 +1868,12 @@ irc_server_outqueue_send (struct t_irc_server *server) switch (priority) { case 0: - anti_flood = IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_HIGH); + anti_flood = IRC_SERVER_OPTION_INTEGER( + server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_HIGH); break; default: - anti_flood = IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_LOW); + anti_flood = IRC_SERVER_OPTION_INTEGER( + server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_LOW); break; } if (server->outqueue[priority] @@ -1890,28 +1903,33 @@ irc_server_outqueue_send (struct t_irc_server *server) pos[0] = '\r'; /* send signal with command that will be sent to server */ - irc_server_send_signal (server, "irc_out", - server->outqueue[priority]->command, - server->outqueue[priority]->message_after_mod, - NULL); - tags_to_send = irc_server_get_tags_to_send (server->outqueue[priority]->tags); - irc_server_send_signal (server, "irc_outtags", - server->outqueue[priority]->command, - server->outqueue[priority]->message_after_mod, - (tags_to_send) ? tags_to_send : ""); + irc_server_send_signal ( + server, "irc_out", + server->outqueue[priority]->command, + server->outqueue[priority]->message_after_mod, + NULL); + tags_to_send = irc_server_get_tags_to_send ( + server->outqueue[priority]->tags); + irc_server_send_signal ( + server, "irc_outtags", + server->outqueue[priority]->command, + server->outqueue[priority]->message_after_mod, + (tags_to_send) ? tags_to_send : ""); if (tags_to_send) free (tags_to_send); /* send command */ - irc_server_send (server, server->outqueue[priority]->message_after_mod, - strlen (server->outqueue[priority]->message_after_mod)); + irc_server_send ( + server, server->outqueue[priority]->message_after_mod, + strlen (server->outqueue[priority]->message_after_mod)); server->last_user_message = time_now; /* start redirection if redirect is set */ if (server->outqueue[priority]->redirect) { - irc_redirect_init_command (server->outqueue[priority]->redirect, - server->outqueue[priority]->message_after_mod); + irc_redirect_init_command ( + server->outqueue[priority]->redirect, + server->outqueue[priority]->message_after_mod); } } irc_server_outqueue_free (server, priority, @@ -2021,10 +2039,12 @@ irc_server_send_one_msg (struct t_irc_server *server, int flags, switch (queue_msg - 1) { case 0: - anti_flood = IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_HIGH); + anti_flood = IRC_SERVER_OPTION_INTEGER( + server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_HIGH); break; default: - anti_flood = IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_LOW); + anti_flood = IRC_SERVER_OPTION_INTEGER( + server, IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_LOW); break; } @@ -2208,12 +2228,16 @@ irc_server_sendf (struct t_irc_server *server, int flags, const char *tags, if (ret_hashtable) { - snprintf (hash_key, sizeof (hash_key), "msg%d", ret_number); - weechat_hashtable_set (ret_hashtable, hash_key, str_message); + snprintf (hash_key, sizeof (hash_key), + "msg%d", ret_number); + weechat_hashtable_set (ret_hashtable, + hash_key, str_message); if (str_args) { - snprintf (hash_key, sizeof (hash_key), "args%d", ret_number); - weechat_hashtable_set (ret_hashtable, hash_key, str_args); + snprintf (hash_key, sizeof (hash_key), + "args%d", ret_number); + weechat_hashtable_set (ret_hashtable, + hash_key, str_args); } ret_number++; } @@ -2307,7 +2331,8 @@ irc_server_msgq_add_msg (struct t_irc_server *server, const char *msg) */ void -irc_server_msgq_add_unterminated (struct t_irc_server *server, const char *string) +irc_server_msgq_add_unterminated (struct t_irc_server *server, + const char *string) { char *unterminated_message2; @@ -2419,9 +2444,10 @@ irc_server_msgq_flush () snprintf (str_modifier, sizeof (str_modifier), "irc_in_%s", (command) ? command : "unknown"); - new_msg = weechat_hook_modifier_exec (str_modifier, - irc_recv_msgq->server->name, - ptr_data); + new_msg = weechat_hook_modifier_exec ( + str_modifier, + irc_recv_msgq->server->name, + ptr_data); if (command) free (command); @@ -2446,9 +2472,10 @@ irc_server_msgq_flush () if (new_msg) { - irc_raw_print (irc_recv_msgq->server, - IRC_RAW_FLAG_RECV | IRC_RAW_FLAG_MODIFIED, - ptr_msg); + irc_raw_print ( + irc_recv_msgq->server, + IRC_RAW_FLAG_RECV | IRC_RAW_FLAG_MODIFIED, + ptr_msg); } irc_message_parse (irc_recv_msgq->server, ptr_msg, @@ -2470,7 +2497,8 @@ irc_server_msgq_flush () { if (nick && (!host || (strcmp (nick, host) != 0))) { - snprintf (modifier_data, sizeof (modifier_data), + snprintf (modifier_data, + sizeof (modifier_data), "%s.%s.%s", weechat_plugin->name, irc_recv_msgq->server->name, @@ -2478,20 +2506,21 @@ irc_server_msgq_flush () } else { - snprintf (modifier_data, sizeof (modifier_data), + snprintf (modifier_data, + sizeof (modifier_data), "%s.%s", weechat_plugin->name, irc_recv_msgq->server->name); } } - msg_decoded = weechat_hook_modifier_exec ("charset_decode", - modifier_data, - ptr_msg); + msg_decoded = weechat_hook_modifier_exec ( + "charset_decode", modifier_data, ptr_msg); /* replace WeeChat internal color codes by "?" */ msg_decoded_without_color = - weechat_string_remove_color ((msg_decoded) ? msg_decoded : ptr_msg, - "?"); + weechat_string_remove_color ( + (msg_decoded) ? msg_decoded : ptr_msg, + "?"); /* call modifier after charset */ ptr_msg2 = (msg_decoded_without_color) ? @@ -2499,9 +2528,10 @@ irc_server_msgq_flush () snprintf (str_modifier, sizeof (str_modifier), "irc_in2_%s", (command) ? command : "unknown"); - new_msg2 = weechat_hook_modifier_exec (str_modifier, - irc_recv_msgq->server->name, - ptr_msg2); + new_msg2 = weechat_hook_modifier_exec ( + str_modifier, + irc_recv_msgq->server->name, + ptr_msg2); if (new_msg2 && (strcmp (ptr_msg2, new_msg2) == 0)) { free (new_msg2); @@ -2540,11 +2570,12 @@ irc_server_msgq_flush () else ptr_msg3 = ptr_msg2; } - irc_protocol_recv_command (irc_recv_msgq->server, - ptr_msg3, - tags, - command, - channel); + irc_protocol_recv_command ( + irc_recv_msgq->server, + ptr_msg3, + tags, + command, + channel); } } @@ -2654,16 +2685,17 @@ irc_server_recv_cb (void *data, int fd) || ((num_read != GNUTLS_E_AGAIN) && (num_read != GNUTLS_E_INTERRUPTED))) { - weechat_printf (server->buffer, - _("%s%s: reading data on socket: error %d %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - num_read, - (num_read == 0) ? _("(connection closed by peer)") : - gnutls_strerror (num_read)); - weechat_printf (server->buffer, - _("%s%s: disconnecting from server..."), - weechat_prefix ("network"), - IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: reading data on socket: error %d %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + num_read, + (num_read == 0) ? _("(connection closed by peer)") : + gnutls_strerror (num_read)); + weechat_printf ( + server->buffer, + _("%s%s: disconnecting from server..."), + weechat_prefix ("network"), IRC_PLUGIN_NAME); irc_server_disconnect (server, !server->is_connected, 1); } } @@ -2673,16 +2705,17 @@ irc_server_recv_cb (void *data, int fd) if ((num_read == 0) || ((errno != EAGAIN) && (errno != EWOULDBLOCK))) { - weechat_printf (server->buffer, - _("%s%s: reading data on socket: error %d %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - errno, - (num_read == 0) ? _("(connection closed by peer)") : - strerror (errno)); - weechat_printf (server->buffer, - _("%s%s: disconnecting from server..."), - weechat_prefix ("network"), - IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: reading data on socket: error %d %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + errno, + (num_read == 0) ? _("(connection closed by peer)") : + strerror (errno)); + weechat_printf ( + server->buffer, + _("%s%s: disconnecting from server..."), + weechat_prefix ("network"), IRC_PLUGIN_NAME); irc_server_disconnect (server, !server->is_connected, 1); } } @@ -2717,9 +2750,10 @@ irc_server_timer_connection_cb (void *data, int remaining_calls) if (!server->is_connected) { - weechat_printf (server->buffer, - _("%s%s: connection timeout (message 001 not received)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: connection timeout (message 001 not received)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); irc_server_disconnect (server, !server->is_connected, 1); } @@ -2866,7 +2900,8 @@ irc_server_timer_cb (void *data, int remaining_calls) else { /* check away (only if lag check was not done) */ - away_check = IRC_SERVER_OPTION_INTEGER(ptr_server, IRC_SERVER_OPTION_AWAY_CHECK); + away_check = IRC_SERVER_OPTION_INTEGER( + ptr_server, IRC_SERVER_OPTION_AWAY_CHECK); if (!ptr_server->cap_away_notify && (away_check > 0) && ((ptr_server->last_away_check == 0) @@ -2898,8 +2933,8 @@ irc_server_timer_cb (void *data, int remaining_calls) 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); + ptr_server->lag = (int)(weechat_util_timeval_diff (&(ptr_server->lag_check_time), + &tv) / 1000); /* 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))) @@ -2912,14 +2947,14 @@ irc_server_timer_cb (void *data, int remaining_calls) 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); + 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 @@ -3091,32 +3126,35 @@ irc_server_reconnect_schedule (struct t_irc_server *server) seconds = server->reconnect_delay % 60; if ((minutes > 0) && (seconds > 0)) { - weechat_printf (server->buffer, - _("%s%s: reconnecting to server in %d %s, %d %s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - minutes, - NG_("minute", "minutes", minutes), - seconds, - NG_("second", "seconds", seconds)); + weechat_printf ( + server->buffer, + _("%s%s: reconnecting to server in %d %s, %d %s"), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + minutes, + NG_("minute", "minutes", minutes), + seconds, + NG_("second", "seconds", seconds)); } else if (minutes > 0) { - weechat_printf (server->buffer, - _("%s%s: reconnecting to server in %d %s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - minutes, - NG_("minute", "minutes", minutes)); + weechat_printf ( + server->buffer, + _("%s%s: reconnecting to server in %d %s"), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + minutes, + NG_("minute", "minutes", minutes)); } else { - weechat_printf (server->buffer, - _("%s%s: reconnecting to server in %d %s"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - seconds, - NG_("second", "seconds", seconds)); + weechat_printf ( + server->buffer, + _("%s%s: reconnecting to server in %d %s"), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + seconds, + NG_("second", "seconds", seconds)); } } else @@ -3146,7 +3184,8 @@ irc_server_login (struct t_irc_server *server) IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_REALNAME), NULL, NULL, NULL); - capabilities = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_CAPABILITIES); + capabilities = IRC_SERVER_OPTION_STRING( + server, IRC_SERVER_OPTION_CAPABILITIES); if (password && password[0]) irc_server_sendf (server, 0, NULL, "PASS %s", password); @@ -3170,12 +3209,13 @@ irc_server_login (struct t_irc_server *server) username2 = (username && username[0]) ? weechat_string_replace (username, " ", "_") : strdup ("weechat"); - irc_server_sendf (server, 0, NULL, - "NICK %s\n" - "USER %s 0 * :%s", - server->nick, - (username2) ? username2 : "weechat", - (realname && realname[0]) ? realname : ((username2) ? username2 : "weechat")); + irc_server_sendf ( + server, 0, NULL, + "NICK %s\n" + "USER %s 0 * :%s", + server->nick, + (username2) ? username2 : "weechat", + (realname && realname[0]) ? realname : ((username2) ? username2 : "weechat")); if (username2) free (username2); @@ -3205,14 +3245,16 @@ irc_server_switch_address (struct t_irc_server *server, int connection) { if (server->addresses_count > 1) { - irc_server_set_index_current_address (server, - (server->index_current_address + 1) % server->addresses_count); - weechat_printf (server->buffer, - _("%s%s: switching address to %s/%d"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - server->current_address, - server->current_port); + irc_server_set_index_current_address ( + server, + (server->index_current_address + 1) % server->addresses_count); + weechat_printf ( + server->buffer, + _("%s%s: switching address to %s/%d"), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + server->current_address, + server->current_port); if (connection) { if (server->index_current_address == 0) @@ -3253,13 +3295,14 @@ irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock, if (server->current_ip) free (server->current_ip); server->current_ip = (ip_address) ? strdup (ip_address) : NULL; - weechat_printf (server->buffer, - _("%s%s: connected to %s/%d (%s)"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - server->current_address, - server->current_port, - (server->current_ip) ? server->current_ip : "?"); + weechat_printf ( + server->buffer, + _("%s%s: connected to %s/%d (%s)"), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + server->current_address, + server->current_port, + (server->current_ip) ? server->current_ip : "?"); server->hook_fd = weechat_hook_fd (server->sock, 1, 0, 0, &irc_server_recv_cb, @@ -3268,129 +3311,135 @@ irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock, irc_server_login (server); break; case WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND: - weechat_printf (server->buffer, - (proxy && proxy[0]) ? - _("%s%s: proxy address \"%s\" not found") : - _("%s%s: address \"%s\" not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->current_address); + weechat_printf ( + server->buffer, + (proxy && proxy[0]) ? + _("%s%s: proxy address \"%s\" not found") : + _("%s%s: address \"%s\" not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + server->current_address); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); irc_server_switch_address (server, 1); break; case WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND: - weechat_printf (server->buffer, - (proxy && proxy[0]) ? - _("%s%s: proxy IP address not found") : - _("%s%s: IP address not found"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + (proxy && proxy[0]) ? + _("%s%s: proxy IP address not found") : + _("%s%s: IP address not found"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); irc_server_switch_address (server, 1); break; case WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED: - weechat_printf (server->buffer, - (proxy && proxy[0]) ? - _("%s%s: proxy connection refused") : - _("%s%s: connection refused"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + (proxy && proxy[0]) ? + _("%s%s: proxy connection refused") : + _("%s%s: connection refused"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); server->current_retry++; irc_server_switch_address (server, 1); break; case WEECHAT_HOOK_CONNECT_PROXY_ERROR: - weechat_printf (server->buffer, - _("%s%s: proxy fails to establish " - "connection to server " - "(check username/password if used " - "and if server address/port is allowed by " - "proxy)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: proxy fails to establish connection to server (check " + "username/password if used and if server address/port is " + "allowed by proxy)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); irc_server_switch_address (server, 1); break; case WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR: - weechat_printf (server->buffer, - _("%s%s: unable to set local hostname/IP"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: unable to set local hostname/IP"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); irc_server_reconnect_schedule (server); break; case WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR: - weechat_printf (server->buffer, - _("%s%s: TLS init error"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: TLS init error"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); server->current_retry++; irc_server_reconnect_schedule (server); break; case WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR: - weechat_printf (server->buffer, - _("%s%s: TLS handshake failed"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: TLS handshake failed"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } #ifdef HAVE_GNUTLS if (gnutls_rc == GNUTLS_E_DH_PRIME_UNACCEPTABLE) { - weechat_printf (server->buffer, - _("%s%s: you should play with option " - "irc.server.%s.ssl_dhkey_size (current " - "value is %d, try a lower value like %d or " - "%d)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->name, - IRC_SERVER_OPTION_INTEGER (server, - IRC_SERVER_OPTION_SSL_DHKEY_SIZE), - IRC_SERVER_OPTION_INTEGER (server, - IRC_SERVER_OPTION_SSL_DHKEY_SIZE) / 2, - IRC_SERVER_OPTION_INTEGER (server, - IRC_SERVER_OPTION_SSL_DHKEY_SIZE) / 4); + weechat_printf ( + server->buffer, + _("%s%s: you should play with option " + "irc.server.%s.ssl_dhkey_size (current value is %d, try " + "a lower value like %d or %d)"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, + server->name, + IRC_SERVER_OPTION_INTEGER ( + server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE), + IRC_SERVER_OPTION_INTEGER ( + server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE) / 2, + IRC_SERVER_OPTION_INTEGER ( + server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE) / 4); } #else (void) gnutls_rc; @@ -3400,44 +3449,47 @@ irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock, irc_server_switch_address (server, 1); break; case WEECHAT_HOOK_CONNECT_MEMORY_ERROR: - weechat_printf (server->buffer, - _("%s%s: not enough memory"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: not enough memory"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); irc_server_reconnect_schedule (server); break; case WEECHAT_HOOK_CONNECT_TIMEOUT: - weechat_printf (server->buffer, - _("%s%s: timeout"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: timeout"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); server->current_retry++; irc_server_switch_address (server, 1); break; case WEECHAT_HOOK_CONNECT_SOCKET_ERROR: - weechat_printf (server->buffer, - _("%s%s: unable to create socket"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: unable to create socket"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); if (error && error[0]) { - weechat_printf (server->buffer, - _("%s%s: error: %s"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - error); + weechat_printf ( + server->buffer, + _("%s%s: error: %s"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, error); } irc_server_close_connection (server); server->current_retry++; @@ -3539,8 +3591,9 @@ irc_server_create_buffer (struct t_irc_server *server) if (weechat_config_string (irc_config_look_highlight_tags_restrict) && weechat_config_string (irc_config_look_highlight_tags_restrict)[0]) { - weechat_buffer_set (server->buffer, "highlight_tags_restrict", - weechat_config_string (irc_config_look_highlight_tags_restrict)); + weechat_buffer_set ( + server->buffer, "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } irc_server_set_buffer_title (server); @@ -3621,10 +3674,10 @@ irc_server_check_certificate_fingerprint (struct t_irc_server *server, fingerprint_server, &fingerprint_size) != GNUTLS_E_SUCCESS) { - weechat_printf (server->buffer, - _("%sgnutls: failed to calculate certificate " - "fingerprint"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: failed to calculate certificate fingerprint"), + weechat_prefix ("error")); return 0; } @@ -3709,20 +3762,21 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, if (action == WEECHAT_HOOK_CONNECT_GNUTLS_CB_VERIFY_CERT) { - weechat_printf (server->buffer, - _("%sgnutls: connected using %d-bit Diffie-Hellman " - "shared secret exchange"), - weechat_prefix ("network"), - IRC_SERVER_OPTION_INTEGER (server, - IRC_SERVER_OPTION_SSL_DHKEY_SIZE)); + weechat_printf ( + server->buffer, + _("%sgnutls: connected using %d-bit Diffie-Hellman shared secret " + "exchange"), + weechat_prefix ("network"), + IRC_SERVER_OPTION_INTEGER (server, + IRC_SERVER_OPTION_SSL_DHKEY_SIZE)); /* initialize the certificate structure */ if (gnutls_x509_crt_init (&cert_temp) != GNUTLS_E_SUCCESS) { - weechat_printf (server->buffer, - _("%sgnutls: failed to initialize certificate " - "structure"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: failed to initialize certificate structure"), + weechat_prefix ("error")); rc = -1; goto end; } @@ -3742,12 +3796,13 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, cert_list = gnutls_certificate_get_peers (tls_session, &cert_list_len); if (cert_list) { - weechat_printf (server->buffer, - NG_("%sgnutls: receiving %d certificate", - "%sgnutls: receiving %d certificates", - cert_list_len), - weechat_prefix ("network"), - cert_list_len); + weechat_printf ( + server->buffer, + NG_("%sgnutls: receiving %d certificate", + "%sgnutls: receiving %d certificates", + cert_list_len), + weechat_prefix ("network"), + cert_list_len); for (i = 0; i < cert_list_len; i++) { @@ -3755,10 +3810,10 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, &cert_list[i], GNUTLS_X509_FMT_DER) != GNUTLS_E_SUCCESS) { - weechat_printf (server->buffer, - _("%sgnutls: failed to import " - "certificate[%d]"), - weechat_prefix ("error"), i + 1); + weechat_printf ( + server->buffer, + _("%sgnutls: failed to import certificate[%d]"), + weechat_prefix ("error"), i + 1); rc = -1; goto end; } @@ -3769,9 +3824,8 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, /* check if fingerprint matches the first certificate */ if (fingerprint && fingerprint[0]) { - fingerprint_match = irc_server_check_certificate_fingerprint (server, - cert_temp, - fingerprint); + fingerprint_match = irc_server_check_certificate_fingerprint ( + server, cert_temp, fingerprint); } /* check if hostname matches in the first certificate */ if (gnutls_x509_crt_check_hostname (cert_temp, @@ -3783,18 +3837,22 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, #if LIBGNUTLS_VERSION_NUMBER >= 0x010706 /* display infos about certificate */ #if LIBGNUTLS_VERSION_NUMBER < 0x020400 - rinfo = gnutls_x509_crt_print (cert_temp, GNUTLS_X509_CRT_ONELINE, &cinfo); + rinfo = gnutls_x509_crt_print (cert_temp, + GNUTLS_X509_CRT_ONELINE, &cinfo); #else - rinfo = gnutls_x509_crt_print (cert_temp, GNUTLS_CRT_PRINT_ONELINE, &cinfo); + rinfo = gnutls_x509_crt_print (cert_temp, + GNUTLS_CRT_PRINT_ONELINE, &cinfo); #endif if (rinfo == 0) { - weechat_printf (server->buffer, - _("%s - certificate[%d] info:"), - weechat_prefix ("network"), i + 1); - weechat_printf (server->buffer, - "%s - %s", - weechat_prefix ("network"), cinfo.data); + weechat_printf ( + server->buffer, + _("%s - certificate[%d] info:"), + weechat_prefix ("network"), i + 1); + weechat_printf ( + server->buffer, + "%s - %s", + weechat_prefix ("network"), cinfo.data); gnutls_free (cinfo.data); } #endif @@ -3805,18 +3863,20 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, cert_time = gnutls_x509_crt_get_expiration_time (cert_temp); if (cert_time < time (NULL)) { - weechat_printf (server->buffer, - _("%sgnutls: certificate has expired"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: certificate has expired"), + weechat_prefix ("error")); rc = -1; } /* check activation date */ cert_time = gnutls_x509_crt_get_activation_time (cert_temp); if (cert_time > time (NULL)) { - weechat_printf (server->buffer, - _("%sgnutls: certificate is not yet activated"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: certificate is not yet activated"), + weechat_prefix ("error")); rc = -1; } } @@ -3830,18 +3890,19 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, { if (fingerprint_match) { - weechat_printf (server->buffer, - _("%sgnutls: certificate fingerprint " - "matches"), - weechat_prefix ("network")); + weechat_printf ( + server->buffer, + _("%sgnutls: certificate fingerprint matches"), + weechat_prefix ("network")); } else { - weechat_printf (server->buffer, - _("%sgnutls: certificate fingerprint does " - "NOT match (check value of option " - "irc.server.%s.ssl_fingerprint)"), - weechat_prefix ("error"), server->name); + weechat_printf ( + server->buffer, + _("%sgnutls: certificate fingerprint does NOT match " + "(check value of option " + "irc.server.%s.ssl_fingerprint)"), + weechat_prefix ("error"), server->name); rc = -1; } goto end; @@ -3849,11 +3910,11 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, if (!hostname_match) { - weechat_printf (server->buffer, - _("%sgnutls: the hostname in the " - "certificate does NOT match \"%s\""), - weechat_prefix ("error"), - server->current_address); + weechat_printf ( + server->buffer, + _("%sgnutls: the hostname in the certificate does NOT " + "match \"%s\""), + weechat_prefix ("error"), server->current_address); rc = -1; } } @@ -3861,9 +3922,10 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, /* verify the peer’s certificate */ if (gnutls_certificate_verify_peers2 (tls_session, &status) < 0) { - weechat_printf (server->buffer, - _("%sgnutls: error while checking peer's certificate"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: error while checking peer's certificate"), + weechat_prefix ("error")); rc = -1; goto end; } @@ -3871,41 +3933,45 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, /* check if certificate is trusted */ if (status & GNUTLS_CERT_INVALID) { - weechat_printf (server->buffer, - _("%sgnutls: peer's certificate is NOT trusted"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: peer's certificate is NOT trusted"), + weechat_prefix ("error")); rc = -1; } else { - weechat_printf (server->buffer, - _("%sgnutls: peer's certificate is trusted"), - weechat_prefix ("network")); + weechat_printf ( + server->buffer, + _("%sgnutls: peer's certificate is trusted"), + weechat_prefix ("network")); } /* check if certificate issuer is known */ if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) { - weechat_printf (server->buffer, - _("%sgnutls: peer's certificate issuer is unknown"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: peer's certificate issuer is unknown"), + weechat_prefix ("error")); rc = -1; } /* check that certificate is not revoked */ if (status & GNUTLS_CERT_REVOKED) { - weechat_printf (server->buffer, - _("%sgnutls: the certificate has been revoked"), - weechat_prefix ("error")); + weechat_printf ( + server->buffer, + _("%sgnutls: the certificate has been revoked"), + weechat_prefix ("error")); rc = -1; } } else if (action == WEECHAT_HOOK_CONNECT_GNUTLS_CB_SET_CERT) { /* using client certificate if it exists */ - cert_path0 = (char *) IRC_SERVER_OPTION_STRING(server, - IRC_SERVER_OPTION_SSL_CERT); + cert_path0 = (char *) IRC_SERVER_OPTION_STRING( + server, IRC_SERVER_OPTION_SSL_CERT); if (cert_path0 && cert_path0[0]) { weechat_dir = weechat_info_get ("weechat_dir", ""); @@ -3918,9 +3984,10 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, cert_str = weechat_file_get_content (cert_path2); if (cert_str) { - weechat_printf (server->buffer, - _("%sgnutls: sending one certificate"), - weechat_prefix ("network")); + weechat_printf ( + server->buffer, + _("%sgnutls: sending one certificate"), + weechat_prefix ("network")); filedatum.data = (unsigned char *) cert_str; filedatum.size = strlen (cert_str); @@ -3937,19 +4004,21 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, GNUTLS_X509_FMT_PEM); if (ret < 0) { - ret = gnutls_x509_privkey_import_pkcs8 (server->tls_cert_key, - &filedatum, - GNUTLS_X509_FMT_PEM, - NULL, - GNUTLS_PKCS_PLAIN); + ret = gnutls_x509_privkey_import_pkcs8 ( + server->tls_cert_key, + &filedatum, + GNUTLS_X509_FMT_PEM, + NULL, + GNUTLS_PKCS_PLAIN); } if (ret < 0) { - weechat_printf (server->buffer, - _("%sgnutls: invalid certificate \"%s\", " - "error: %s"), - weechat_prefix ("error"), cert_path2, - gnutls_strerror (ret)); + weechat_printf ( + server->buffer, + _("%sgnutls: invalid certificate \"%s\", error: " + "%s"), + weechat_prefix ("error"), cert_path2, + gnutls_strerror (ret)); rc = -1; } else @@ -3978,13 +4047,13 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, #endif if (rinfo == 0) { - weechat_printf (server->buffer, - _("%s - client certificate info (%s):"), - weechat_prefix ("network"), - cert_path2); - weechat_printf (server->buffer, "%s - %s", - weechat_prefix ("network"), - cinfo.data); + weechat_printf ( + server->buffer, + _("%s - client certificate info (%s):"), + weechat_prefix ("network"), cert_path2); + weechat_printf ( + server->buffer, "%s - %s", + weechat_prefix ("network"), cinfo.data); gnutls_free (cinfo.data); } #endif @@ -3994,10 +4063,10 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, } else { - weechat_printf (server->buffer, - _("%sgnutls: unable to read certificate " - "\"%s\""), - weechat_prefix ("error"), cert_path2); + weechat_printf ( + server->buffer, + _("%sgnutls: unable to read certificate \"%s\""), + weechat_prefix ("error"), cert_path2); } } @@ -4036,7 +4105,8 @@ irc_server_connect (struct t_irc_server *server) { int length; char *option_name; - struct t_config_option *proxy_type, *proxy_ipv6, *proxy_address, *proxy_port; + struct t_config_option *proxy_type, *proxy_ipv6, *proxy_address; + struct t_config_option *proxy_port; const char *proxy, *str_proxy_type, *str_proxy_address; server->disconnected = 0; @@ -4055,11 +4125,10 @@ irc_server_connect (struct t_irc_server *server) if (!server->current_address) { - weechat_printf (server->buffer, - _("%s%s: unknown address for server \"%s\", " - "cannot connect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->name); + weechat_printf ( + server->buffer, + _("%s%s: unknown address for server \"%s\", cannot connect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, server->name); return 0; } @@ -4094,9 +4163,10 @@ irc_server_connect (struct t_irc_server *server) option_name = malloc (length); if (!option_name) { - weechat_printf (server->buffer, - _("%s%s: not enough memory"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: not enough memory"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return 0; } snprintf (option_name, length, "weechat.proxy.%s.type", proxy); @@ -4110,11 +4180,11 @@ irc_server_connect (struct t_irc_server *server) free (option_name); if (!proxy_type || !proxy_address) { - weechat_printf (server->buffer, - _("%s%s: proxy \"%s\" not found for server " - "\"%s\", cannot connect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, proxy, - server->name); + weechat_printf ( + server->buffer, + _("%s%s: proxy \"%s\" not found for server \"%s\", cannot " + "connect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, proxy, server->name); return 0; } str_proxy_type = weechat_config_string (proxy_type); @@ -4122,77 +4192,80 @@ irc_server_connect (struct t_irc_server *server) if (!str_proxy_type[0] || !proxy_ipv6 || !str_proxy_address[0] || !proxy_port) { - weechat_printf (server->buffer, - _("%s%s: missing proxy settings, check options " - "for proxy \"%s\""), - weechat_prefix ("error"), IRC_PLUGIN_NAME, proxy); + weechat_printf ( + server->buffer, + _("%s%s: missing proxy settings, check options for proxy " + "\"%s\""), + weechat_prefix ("error"), IRC_PLUGIN_NAME, proxy); return 0; } } if (!server->nicks_array) { - weechat_printf (server->buffer, - _("%s%s: nicks not defined for server \"%s\", " - "cannot connect"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - server->name); + weechat_printf ( + server->buffer, + _("%s%s: nicks not defined for server \"%s\", cannot connect"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, server->name); return 0; } #ifndef HAVE_GNUTLS if (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) { - weechat_printf (server->buffer, - _("%s%s: cannot connect with SSL because WeeChat " - "was not built with GnuTLS support"), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: cannot connect with SSL because WeeChat was not built " + "with GnuTLS support"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); return 0; } #endif if (proxy_type) { - weechat_printf (server->buffer, - _("%s%s: connecting to server %s/%d%s via %s " - "proxy %s/%d%s..."), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - server->current_address, - server->current_port, - (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? - " (SSL)" : "", - str_proxy_type, - str_proxy_address, - weechat_config_integer (proxy_port), - (weechat_config_boolean (proxy_ipv6)) ? " (IPv6)" : ""); - weechat_log_printf (_("Connecting to server %s/%d%s via %s proxy " - "%s/%d%s..."), - server->current_address, - server->current_port, - (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? - " (SSL)" : "", - str_proxy_type, - str_proxy_address, - weechat_config_integer (proxy_port), - (weechat_config_boolean (proxy_ipv6)) ? " (IPv6)" : ""); + weechat_printf ( + server->buffer, + _("%s%s: connecting to server %s/%d%s via %s proxy %s/%d%s..."), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + server->current_address, + server->current_port, + (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? + " (SSL)" : "", + str_proxy_type, + str_proxy_address, + weechat_config_integer (proxy_port), + (weechat_config_boolean (proxy_ipv6)) ? " (IPv6)" : ""); + weechat_log_printf ( + _("Connecting to server %s/%d%s via %s proxy %s/%d%s..."), + server->current_address, + server->current_port, + (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? + " (SSL)" : "", + str_proxy_type, + str_proxy_address, + weechat_config_integer (proxy_port), + (weechat_config_boolean (proxy_ipv6)) ? " (IPv6)" : ""); } else { - weechat_printf (server->buffer, - _("%s%s: connecting to server %s/%d%s..."), - weechat_prefix ("network"), - IRC_PLUGIN_NAME, - server->current_address, - server->current_port, - (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? - " (SSL)" : ""); - weechat_log_printf (_("%s%s: connecting to server %s/%d%s..."), - "", - IRC_PLUGIN_NAME, - server->current_address, - server->current_port, - (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? - " (SSL)" : ""); + weechat_printf ( + server->buffer, + _("%s%s: connecting to server %s/%d%s..."), + weechat_prefix ("network"), + IRC_PLUGIN_NAME, + server->current_address, + server->current_port, + (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? + " (SSL)" : ""); + weechat_log_printf ( + _("%s%s: connecting to server %s/%d%s..."), + "", + IRC_PLUGIN_NAME, + server->current_address, + server->current_port, + (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) ? + " (SSL)" : ""); } /* close connection if opened */ @@ -4203,28 +4276,30 @@ irc_server_connect (struct t_irc_server *server) #ifdef HAVE_GNUTLS if (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_SSL)) server->ssl_connected = 1; - server->hook_connect = weechat_hook_connect (proxy, - server->current_address, - server->current_port, - proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6), - server->current_retry, - (server->ssl_connected) ? &server->gnutls_sess : NULL, - (server->ssl_connected) ? irc_server_gnutls_callback : NULL, - IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE), - IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_PRIORITIES), - IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME), - &irc_server_connect_cb, - server); + server->hook_connect = weechat_hook_connect ( + proxy, + server->current_address, + server->current_port, + proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6), + server->current_retry, + (server->ssl_connected) ? &server->gnutls_sess : NULL, + (server->ssl_connected) ? irc_server_gnutls_callback : NULL, + IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE), + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_PRIORITIES), + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME), + &irc_server_connect_cb, + server); #else - server->hook_connect = weechat_hook_connect (proxy, - server->current_address, - server->current_port, - proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6), - server->current_retry, - NULL, NULL, 0, NULL, - IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME), - &irc_server_connect_cb, - server); + server->hook_connect = weechat_hook_connect ( + proxy, + server->current_address, + server->current_port, + proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6), + server->current_retry, + NULL, NULL, 0, NULL, + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME), + &irc_server_connect_cb, + server); #endif /* send signal "irc_server_connecting" with server name */ @@ -4241,10 +4316,10 @@ irc_server_connect (struct t_irc_server *server) void irc_server_reconnect (struct t_irc_server *server) { - weechat_printf (server->buffer, - _("%s%s: reconnecting to server..."), - weechat_prefix ("network"), - IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: reconnecting to server..."), + weechat_prefix ("network"), IRC_PLUGIN_NAME); server->reconnect_start = 0; @@ -4304,10 +4379,10 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address, ptr_channel->hook_autorejoin = NULL; } weechat_buffer_set (ptr_channel->buffer, "localvar_del_away", ""); - weechat_printf (ptr_channel->buffer, - _("%s%s: disconnected from server"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME); + weechat_printf ( + ptr_channel->buffer, + _("%s%s: disconnected from server"), + weechat_prefix ("network"), IRC_PLUGIN_NAME); } /* remove away status on server buffer */ weechat_buffer_set (server->buffer, "localvar_del_away", ""); @@ -4317,10 +4392,10 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address, if (server->buffer) { - weechat_printf (server->buffer, - _("%s%s: disconnected from server"), - weechat_prefix ("network"), - IRC_PLUGIN_NAME); + weechat_printf ( + server->buffer, + _("%s%s: disconnected from server"), + weechat_prefix ("network"), IRC_PLUGIN_NAME); } server->current_retry = 0; @@ -4427,9 +4502,9 @@ irc_server_autojoin_channels (struct t_irc_server *server) else { /* auto-join when connecting to server for first time */ - autojoin = weechat_string_eval_expression (IRC_SERVER_OPTION_STRING(server, - IRC_SERVER_OPTION_AUTOJOIN), - NULL, NULL, NULL); + autojoin = weechat_string_eval_expression ( + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_AUTOJOIN), + NULL, NULL, NULL); if (!server->disable_autojoin && autojoin && autojoin[0]) irc_command_join_server (server, autojoin, 0, 0); if (autojoin) @@ -4450,7 +4525,8 @@ irc_server_get_number_connected () int number; number = 0; - for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) + for (ptr_server = irc_servers; ptr_server; + ptr_server = ptr_server->next_server) { if (ptr_server->is_connected) number++; @@ -4587,7 +4663,8 @@ irc_server_set_away (struct t_irc_server *server, const char *nick, int is_away) "localvar_del_away", ""); } - for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) + for (ptr_channel = server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) { /* set away flag for nick on channel */ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) @@ -4677,26 +4754,28 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal, { filename = weechat_infolist_string (infolist, "filename"); spaces_in_name = (strchr (filename, ' ') != NULL); - irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :\01DCC SEND %s%s%s " - "%s %d %s\01", - weechat_infolist_string (infolist, "remote_nick"), - (spaces_in_name) ? "\"" : "", - filename, - (spaces_in_name) ? "\"" : "", - converted_addr, - weechat_infolist_integer (infolist, "port"), - weechat_infolist_string (infolist, "size")); + irc_server_sendf ( + ptr_server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "PRIVMSG %s :\01DCC SEND %s%s%s " + "%s %d %s\01", + weechat_infolist_string (infolist, "remote_nick"), + (spaces_in_name) ? "\"" : "", + filename, + (spaces_in_name) ? "\"" : "", + converted_addr, + weechat_infolist_integer (infolist, "port"), + weechat_infolist_string (infolist, "size")); } else if (strcmp (type, "chat_send") == 0) { - irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :\01DCC CHAT chat %s %d\01", - weechat_infolist_string (infolist, "remote_nick"), - converted_addr, - weechat_infolist_integer (infolist, "port")); + irc_server_sendf ( + ptr_server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "PRIVMSG %s :\01DCC CHAT chat %s %d\01", + weechat_infolist_string (infolist, "remote_nick"), + converted_addr, + weechat_infolist_integer (infolist, "port")); } } } @@ -4742,15 +4821,16 @@ irc_server_xfer_resume_ready_cb (void *data, const char *signal, { filename = weechat_infolist_string (infolist, "filename"); spaces_in_name = (strchr (filename, ' ') != NULL); - irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :\01DCC RESUME %s%s%s %d %s\01", - weechat_infolist_string (infolist, "remote_nick"), - (spaces_in_name) ? "\"" : "", - filename, - (spaces_in_name) ? "\"" : "", - weechat_infolist_integer (infolist, "port"), - weechat_infolist_string (infolist, "start_resume")); + irc_server_sendf ( + ptr_server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "PRIVMSG %s :\01DCC RESUME %s%s%s %d %s\01", + weechat_infolist_string (infolist, "remote_nick"), + (spaces_in_name) ? "\"" : "", + filename, + (spaces_in_name) ? "\"" : "", + weechat_infolist_integer (infolist, "port"), + weechat_infolist_string (infolist, "start_resume")); } } } @@ -4795,15 +4875,16 @@ irc_server_xfer_send_accept_resume_cb (void *data, const char *signal, { filename = weechat_infolist_string (infolist, "filename"); spaces_in_name = (strchr (filename, ' ') != NULL); - irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :\01DCC ACCEPT %s%s%s %d %s\01", - weechat_infolist_string (infolist, "remote_nick"), - (spaces_in_name) ? "\"" : "", - filename, - (spaces_in_name) ? "\"" : "", - weechat_infolist_integer (infolist, "port"), - weechat_infolist_string (infolist, "start_resume")); + irc_server_sendf ( + ptr_server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "PRIVMSG %s :\01DCC ACCEPT %s%s%s %d %s\01", + weechat_infolist_string (infolist, "remote_nick"), + (spaces_in_name) ? "\"" : "", + filename, + (spaces_in_name) ? "\"" : "", + weechat_infolist_integer (infolist, "port"), + weechat_infolist_string (infolist, "start_resume")); } } } diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c index 6c807ddaf..3a0363a74 100644 --- a/src/plugins/irc/irc.c +++ b/src/plugins/irc/irc.c @@ -77,8 +77,9 @@ irc_signal_quit_cb (void *data, const char *signal, const char *type_data, for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { - irc_command_quit_server (ptr_server, - (signal_data) ? (char *)signal_data : NULL); + irc_command_quit_server ( + ptr_server, + (signal_data) ? (char *)signal_data : NULL); } } @@ -110,20 +111,20 @@ irc_signal_upgrade_cb (void *data, const char *signal, const char *type_data, ptr_server = ptr_server->next_server) { /* - * FIXME: it's not possible to upgrade with SSL servers connected (GnuTLS - * lib can't reload data after upgrade), so we close connection for - * all SSL servers currently connected + * FIXME: it's not possible to upgrade with SSL servers connected + * (GnuTLS library can't reload data after upgrade), so we close + * connection for all SSL servers currently connected */ if (ptr_server->is_connected && (ptr_server->ssl_connected || quit)) { if (!quit) { ssl_disconnected++; - weechat_printf (ptr_server->buffer, - _("%s%s: disconnecting from server because upgrade " - "can't work for servers connected via SSL"), - weechat_prefix ("error"), - IRC_PLUGIN_NAME); + weechat_printf ( + ptr_server->buffer, + _("%s%s: disconnecting from server because upgrade can't " + "work for servers connected via SSL"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); } irc_server_disconnect (ptr_server, 0, 0); /* @@ -137,13 +138,15 @@ irc_signal_upgrade_cb (void *data, const char *signal, const char *type_data, } if (ssl_disconnected > 0) { - weechat_printf (NULL, - /* TRANSLATORS: "%s" after "%d" is "server" or "servers" */ - _("%s%s: disconnected from %d %s (SSL connection " - "not supported with upgrade)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - ssl_disconnected, - NG_("server", "servers", ssl_disconnected)); + weechat_printf ( + NULL, + /* TRANSLATORS: "%s" after "%d" is "server" or "servers" */ + _("%s%s: disconnected from %d %s (SSL connection not supported " + "with upgrade)"), + weechat_prefix ("error"), + IRC_PLUGIN_NAME, + ssl_disconnected, + NG_("server", "servers", ssl_disconnected)); } return WEECHAT_RC_OK; @@ -210,12 +213,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { if (!irc_server_alloc_with_url (argv[i])) { - weechat_printf (NULL, - _("%s%s: unable to create temporary server " - "\"%s\" (check if there is already a server " - "with this name)"), - weechat_prefix ("error"), IRC_PLUGIN_NAME, - argv[i]); + weechat_printf ( + NULL, + _("%s%s: unable to create temporary server \"%s\" (check " + "if there is already a server with this name)"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[i]); } } else if (weechat_strcasecmp (argv[i], "--upgrade") == 0) @@ -228,11 +230,12 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { if (!irc_upgrade_load ()) { - weechat_printf (NULL, - _("%s%s: WARNING: some network connections may " - "still be opened and not visible, you should " - "restart WeeChat now (with /quit)."), - weechat_prefix ("error"), IRC_PLUGIN_NAME); + weechat_printf ( + NULL, + _("%s%s: WARNING: some network connections may still be " + "opened and not visible, you should restart WeeChat now " + "(with /quit)."), + weechat_prefix ("error"), IRC_PLUGIN_NAME); } } else diff --git a/src/plugins/lua/CMakeLists.txt b/src/plugins/lua/CMakeLists.txt index adc69390e..1b61bfc8c 100644 --- a/src/plugins/lua/CMakeLists.txt +++ b/src/plugins/lua/CMakeLists.txt @@ -24,12 +24,8 @@ weechat-lua-api.h) set_target_properties(lua PROPERTIES PREFIX "") if(LUA_FOUND) - include_directories(${LUA_INCLUDE_PATH}) - if(LUA_LIBRARY AND LUALIB_LIBRARY) - target_link_libraries(lua ${LUA_LIBRARY} ${LUALIB_LIBRARY} weechat_plugins_scripts) - else() - target_link_libraries(lua ${LUA_LIBRARY} weechat_plugins_scripts) - endif() + include_directories(${LUA_INCLUDE_DIRS}) + target_link_libraries(lua ${LUA_LDFLAGS} weechat_plugins_scripts) endif() install(TARGETS lua LIBRARY DESTINATION ${LIBDIR}/plugins) diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index ca3c5ed5d..661939251 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -1298,8 +1298,6 @@ plugin_api_init () &gui_buffer_hdata_buffer_visited_cb, NULL); hook_hdata (NULL, "completion", N_("structure with completion"), &gui_completion_hdata_completion_cb, NULL); - hook_hdata (NULL, "completion_partial", N_("structure with partial completion"), - &gui_completion_hdata_completion_partial_cb, NULL); hook_hdata (NULL, "config_file", N_("config file"), &config_file_hdata_config_file_cb, NULL); hook_hdata (NULL, "config_section", N_("config section"), diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 18131b4c1..fc9b80b3a 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -571,13 +571,13 @@ relay_irc_hsignal_irc_redir_cb (void *data, const char *signal, * - date * - nick * - nick1 and nick2 (old and new nick for irc "nick" command) - * - host (without colors) + * - host * - message (without colors). * * Arguments hdata_line_data and line_data must be non NULL, the other arguments * can be NULL. * - * Note: tags, host and message (if given and filled) must be freed after use. + * Note: tags and message (if given and filled) must be freed after use. */ void @@ -586,13 +586,13 @@ relay_irc_get_line_info (struct t_relay_client *client, struct t_hdata *hdata_line_data, void *line_data, int *irc_command, int *irc_action, time_t *date, const char **nick, const char **nick1, - const char **nick2, char **tags, char **host, - char **message) + const char **nick2, const char **host, + char **tags, char **message) { int i, num_tags, command, action, all_tags, length; - char str_tag[256], *pos, *pos2, *message_no_color, str_time[256]; + char str_tag[256], *pos, *message_no_color, str_time[256]; const char *ptr_tag, *ptr_message, *ptr_nick, *ptr_nick1, *ptr_nick2; - const char *localvar_nick, *time_format; + const char *ptr_host, *localvar_nick, *time_format; time_t msg_date; struct tm *tm; @@ -608,10 +608,10 @@ relay_irc_get_line_info (struct t_relay_client *client, *nick1 = NULL; if (nick2) *nick2 = NULL; - if (tags) - *tags = NULL; if (host) *host = NULL; + if (tags) + *tags = NULL; if (message) *message = NULL; @@ -629,6 +629,7 @@ relay_irc_get_line_info (struct t_relay_client *client, ptr_nick = NULL; ptr_nick1 = NULL; ptr_nick2 = NULL; + ptr_host = NULL; all_tags = weechat_hashtable_has_key (relay_config_hashtable_irc_backlog_tags, "*"); for (i = 0; i < num_tags; i++) @@ -645,6 +646,8 @@ relay_irc_get_line_info (struct t_relay_client *client, ptr_nick1 = ptr_tag + 10; else if (strncmp (ptr_tag, "irc_nick2_", 10) == 0) ptr_nick2 = ptr_tag + 10; + else if (strncmp (ptr_tag, "host_", 5) == 0) + ptr_host = ptr_tag + 5; else if ((command < 0) && (all_tags || (weechat_hashtable_has_key (relay_config_hashtable_irc_backlog_tags, @@ -684,8 +687,11 @@ relay_irc_get_line_info (struct t_relay_client *client, *nick1 = ptr_nick1; if (nick2) *nick2 = ptr_nick2; + if (host) + *host = ptr_host; message_no_color = (ptr_message) ? weechat_string_remove_color (ptr_message, NULL) : NULL; + if ((command == RELAY_IRC_CMD_PRIVMSG) && message && message_no_color) { pos = message_no_color; @@ -720,25 +726,7 @@ relay_irc_get_line_info (struct t_relay_client *client, else *message = strdup (pos); } - switch (command) - { - case RELAY_IRC_CMD_JOIN: - case RELAY_IRC_CMD_PART: - case RELAY_IRC_CMD_QUIT: - if (host && message && message_no_color) - { - pos = strstr (message_no_color, " ("); - if (pos) - { - pos2 = strchr (pos, ')'); - if (pos2) - *host = weechat_strndup (pos + 2, pos2 - pos - 2); - } - } - break; - default: - break; - } + /* if server capability "server-time" is enabled, add an irc tag with time */ if (tags && (RELAY_IRC_DATA(client, server_capabilities) & (1 << RELAY_IRC_CAPAB_SERVER_TIME))) @@ -765,8 +753,8 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, struct t_relay_server *ptr_server; void *ptr_own_lines, *ptr_line, *ptr_line_data; void *ptr_hdata_line, *ptr_hdata_line_data; - char *tags, *host, *message; - const char *ptr_nick, *ptr_nick1, *ptr_nick2; + char *tags, *message; + const char *ptr_nick, *ptr_nick1, *ptr_nick2, *ptr_host; int irc_command, irc_action, count, max_number, max_minutes; time_t date_min, date_min2, date; @@ -825,8 +813,8 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, NULL, /* nick */ NULL, /* nick1 */ NULL, /* nick2 */ - NULL, /* tags */ NULL, /* host */ + NULL, /* tags */ NULL); /* message */ if (irc_command >= 0) { @@ -872,8 +860,8 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, &ptr_nick, &ptr_nick1, &ptr_nick2, + &ptr_host, &tags, - &host, &message); switch (irc_command) { @@ -882,8 +870,8 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, "%s:%s%s%s JOIN :%s", (tags) ? tags : "", ptr_nick, - (host) ? "!" : "", - (host) ? host : "", + (ptr_host) ? "!" : "", + (ptr_host) ? ptr_host : "", channel); break; case RELAY_IRC_CMD_PART: @@ -891,16 +879,16 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, "%s:%s%s%s PART %s", (tags) ? tags : "", ptr_nick, - (host) ? "!" : "", - (host) ? host : "", + (ptr_host) ? "!" : "", + (ptr_host) ? ptr_host : "", channel); case RELAY_IRC_CMD_QUIT: relay_irc_sendf (client, "%s:%s%s%s QUIT", (tags) ? tags : "", ptr_nick, - (host) ? "!" : "", - (host) ? host : ""); + (ptr_host) ? "!" : "", + (ptr_host) ? ptr_host : ""); break; case RELAY_IRC_CMD_NICK: if (ptr_nick1 && ptr_nick2) @@ -916,9 +904,11 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, if (ptr_nick && message) { relay_irc_sendf (client, - "%s:%s PRIVMSG %s :%s%s%s", + "%s:%s%s%s PRIVMSG %s :%s%s%s", (tags) ? tags : "", ptr_nick, + (ptr_host) ? "!" : "", + (ptr_host) ? ptr_host : "", channel, (irc_action) ? "\01ACTION " : "", message, @@ -931,8 +921,6 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, } if (tags) free (tags); - if (host) - free (host); if (message) free (message); } diff --git a/src/plugins/relay/irc/relay-irc.h b/src/plugins/relay/irc/relay-irc.h index 7a908738a..05b3bc9ea 100644 --- a/src/plugins/relay/irc/relay-irc.h +++ b/src/plugins/relay/irc/relay-irc.h @@ -62,6 +62,7 @@ enum t_relay_irc_server_capab RELAY_IRC_NUM_CAPAB, }; +extern int relay_irc_search_backlog_commands_tags (const char *tag); extern void relay_irc_recv (struct t_relay_client *client, const char *data); extern void relay_irc_close_connection (struct t_relay_client *client); diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c index b596d15ce..c2cfe3d1f 100644 --- a/src/plugins/relay/relay-client.c +++ b/src/plugins/relay/relay-client.c @@ -217,6 +217,7 @@ relay_client_handshake_timer_cb (void *data, int remaining_calls) /* handshake OK, set status to "connected" */ weechat_unhook (client->hook_timer_handshake); client->hook_timer_handshake = NULL; + client->gnutls_handshake_ok = 1; relay_client_set_status (client, RELAY_STATUS_CONNECTED); return WEECHAT_RC_OK; } @@ -1062,6 +1063,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server) new_client->ssl = server->ssl; #ifdef HAVE_GNUTLS new_client->hook_timer_handshake = NULL; + new_client->gnutls_handshake_ok = 0; #endif new_client->websocket = 0; new_client->http_headers = NULL; @@ -1230,6 +1232,7 @@ relay_client_new_with_infolist (struct t_infolist *infolist) #ifdef HAVE_GNUTLS new_client->gnutls_sess = NULL; new_client->hook_timer_handshake = NULL; + new_client->gnutls_handshake_ok = 0; #endif new_client->websocket = weechat_infolist_integer (infolist, "websocket"); new_client->http_headers = NULL; @@ -1321,6 +1324,14 @@ relay_client_set_status (struct t_relay_client *client, relay_client_outqueue_free_all (client); +#ifdef HAVE_GNUTLS + if (client->hook_timer_handshake) + { + weechat_unhook (client->hook_timer_handshake); + client->hook_timer_handshake = NULL; + } + client->gnutls_handshake_ok = 0; +#endif if (client->hook_fd) { weechat_unhook (client->hook_fd); @@ -1364,7 +1375,7 @@ relay_client_set_status (struct t_relay_client *client, if (client->sock >= 0) { #ifdef HAVE_GNUTLS - if (client->ssl) + if (client->ssl && client->gnutls_handshake_ok) gnutls_bye (client->gnutls_sess, GNUTLS_SHUT_WR); #endif close (client->sock); @@ -1374,10 +1385,10 @@ relay_client_set_status (struct t_relay_client *client, gnutls_deinit (client->gnutls_sess); #endif } - - relay_client_send_signal (client); } + relay_client_send_signal (client); + relay_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); } @@ -1528,6 +1539,8 @@ relay_client_add_to_infolist (struct t_infolist *infolist, #ifdef HAVE_GNUTLS if (!weechat_infolist_new_var_pointer (ptr_item, "hook_timer_handshake", client->hook_timer_handshake)) return 0; + if (!weechat_infolist_new_var_integer (ptr_item, "gnutls_handshake_ok", client->gnutls_handshake_ok)) + return 0; #endif if (!weechat_infolist_new_var_integer (ptr_item, "websocket", client->websocket)) return 0; @@ -1604,6 +1617,7 @@ relay_client_print_log () #ifdef HAVE_GNUTLS weechat_log_printf (" gnutls_sess . . . . . : 0x%lx", ptr_client->gnutls_sess); weechat_log_printf (" hook_timer_handshake. : 0x%lx", ptr_client->hook_timer_handshake); + weechat_log_printf (" gnutls_handshake_ok . : 0x%lx", ptr_client->gnutls_handshake_ok); #endif weechat_log_printf (" websocket . . . . . . : %d", ptr_client->websocket); weechat_log_printf (" http_headers. . . . . : 0x%lx (hashtable: '%s')", diff --git a/src/plugins/relay/relay-client.h b/src/plugins/relay/relay-client.h index 8ca05ceb4..8b2292245 100644 --- a/src/plugins/relay/relay-client.h +++ b/src/plugins/relay/relay-client.h @@ -79,6 +79,7 @@ struct t_relay_client #ifdef HAVE_GNUTLS gnutls_session_t gnutls_sess; /* gnutls session (only if SSL used) */ struct t_hook *hook_timer_handshake; /* timer for doing gnutls handshake*/ + int gnutls_handshake_ok; /* 1 if handshake was done and OK */ #endif int websocket; /* 0=not a ws, 1=init ws, 2=ws ready */ struct t_hashtable *http_headers; /* HTTP headers for websocket */ diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c index 664c65748..fb4432394 100644 --- a/src/plugins/relay/relay-command.c +++ b/src/plugins/relay/relay-command.c @@ -137,24 +137,40 @@ relay_command_server_list () for (ptr_server = relay_servers; ptr_server; ptr_server = ptr_server->next_server) { - date_start[0] = '\0'; - date_tmp = localtime (&(ptr_server->start_time)); - if (date_tmp) + if (ptr_server->sock < 0) { - strftime (date_start, sizeof (date_start), - "%a, %d %b %Y %H:%M:%S", date_tmp); + weechat_printf ( + NULL, + _(" port %s%d%s, relay: %s%s%s, %s (not started)"), + RELAY_COLOR_CHAT_BUFFER, + ptr_server->port, + RELAY_COLOR_CHAT, + RELAY_COLOR_CHAT_BUFFER, + ptr_server->protocol_string, + RELAY_COLOR_CHAT, + ((ptr_server->ipv4 && ptr_server->ipv6) ? "IPv4+6" : ((ptr_server->ipv6) ? "IPv6" : "IPv4"))); + } + else + { + date_start[0] = '\0'; + date_tmp = localtime (&(ptr_server->start_time)); + if (date_tmp) + { + strftime (date_start, sizeof (date_start), + "%a, %d %b %Y %H:%M:%S", date_tmp); + } + weechat_printf ( + NULL, + _(" port %s%d%s, relay: %s%s%s, %s, started on: %s"), + RELAY_COLOR_CHAT_BUFFER, + ptr_server->port, + RELAY_COLOR_CHAT, + RELAY_COLOR_CHAT_BUFFER, + ptr_server->protocol_string, + RELAY_COLOR_CHAT, + ((ptr_server->ipv4 && ptr_server->ipv6) ? "IPv4+6" : ((ptr_server->ipv6) ? "IPv6" : "IPv4")), + date_start); } - - weechat_printf (NULL, - _(" port %s%d%s, relay: %s%s%s, %s, started on: %s"), - RELAY_COLOR_CHAT_BUFFER, - ptr_server->port, - RELAY_COLOR_CHAT, - RELAY_COLOR_CHAT_BUFFER, - ptr_server->protocol_string, - RELAY_COLOR_CHAT, - ((ptr_server->ipv4 && ptr_server->ipv6) ? "IPv4+6" : ((ptr_server->ipv6) ? "IPv6" : "IPv4")), - date_start); i++; } } @@ -246,6 +262,47 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_OK; } + if (weechat_strcasecmp (argv[1], "stop") == 0) + { + if (argc < 3) + return WEECHAT_RC_ERROR; + ptr_server = relay_server_search (argv_eol[2]); + if (ptr_server) + { + relay_server_close_socket (ptr_server); + } + else + { + weechat_printf (NULL, + _("%s%s: relay \"%s\" not found"), + weechat_prefix ("error"), + RELAY_PLUGIN_NAME, + argv_eol[2]); + } + return WEECHAT_RC_OK; + } + + if (weechat_strcasecmp (argv[1], "restart") == 0) + { + if (argc < 3) + return WEECHAT_RC_ERROR; + ptr_server = relay_server_search (argv_eol[2]); + if (ptr_server) + { + relay_server_close_socket (ptr_server); + relay_server_create_socket (ptr_server); + } + else + { + weechat_printf (NULL, + _("%s%s: relay \"%s\" not found"), + weechat_prefix ("error"), + RELAY_PLUGIN_NAME, + argv_eol[2]); + } + return WEECHAT_RC_OK; + } + if (weechat_strcasecmp (argv[1], "raw") == 0) { relay_raw_open (1); @@ -299,15 +356,25 @@ relay_command_init () "relay", N_("relay control"), N_("list|listfull|listrelay" - " || add [ipv4.][ipv6.][ssl.]<protocol.name> <port>" - " || del [ipv4.][ipv6.][ssl.]<protocol.name>" + " || add <name> <port>" + " || del|stop|restart <name>" " || raw" " || sslcertkey"), N_(" list: list relay clients (only active relays)\n" " listfull: list relay clients (verbose, all relays)\n" " listrelay: list relays (name and port)\n" - " add: add relay for a protocol + name\n" - " del: remove relay for a protocol + name\n" + " add: add a relay (listen on a port)\n" + " del: remove a relay (clients remain connected)\n" + " stop: close the server socket (clients remain connected)\n" + " restart: close the server socket and listen again on port " + "(clients remain connected)\n" + " name: relay name (see format below)\n" + " port: port used for relay\n" + " raw: open buffer with raw Relay data\n" + " sslcertkey: set SSL certificate/key using path in option " + "relay.network.ssl_cert_key\n" + "\n" + "Relay name is: [ipv4.][ipv6.][ssl.]<protocol.name>\n" " ipv4: force use of IPv4\n" " ipv6: force use of IPv6\n" " ssl: enable SSL\n" @@ -316,10 +383,11 @@ relay_command_init () "(optional, if not given, the server name must be sent by client in " "command \"PASS\", with format: \"PASS server:password\")\n" " - protocol \"weechat\" (name is not used)\n" - " port: port used for relay\n" - " raw: open buffer with raw Relay data\n" - " sslcertkey: set SSL certificate/key using path in option " - "relay.network.ssl_cert_key\n" + "\n" + "The \"irc\" protocol allows any IRC client (including WeeChat " + "itself) to connect on the port.\n" + "The \"weechat\" protocol allows a remote interface to connect on " + "the port, see the list here: http://weechat.org/download/\n" "\n" "Without argument, this command opens buffer with list of relay " "clients.\n" @@ -346,6 +414,8 @@ relay_command_init () " || listrelay" " || add %(relay_protocol_name) %(relay_free_port)" " || del %(relay_relays)" + " || stop %(relay_relays)" + " || restart %(relay_relays)" " || raw" " || sslcertkey", &relay_command_relay, NULL); diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c index 67c5cfaa0..ad99eb226 100644 --- a/src/plugins/relay/relay-config.c +++ b/src/plugins/relay/relay-config.c @@ -20,12 +20,14 @@ */ #include <stdlib.h> +#include <string.h> #include <limits.h> #include <regex.h> #include "../weechat-plugin.h" #include "relay.h" #include "relay-config.h" +#include "irc/relay-irc.h" #include "relay-client.h" #include "relay-buffer.h" #include "relay-network.h" @@ -58,6 +60,7 @@ struct t_config_option *relay_config_network_ipv6; struct t_config_option *relay_config_network_max_clients; struct t_config_option *relay_config_network_password; struct t_config_option *relay_config_network_ssl_cert_key; +struct t_config_option *relay_config_network_ssl_priorities; struct t_config_option *relay_config_network_websocket_allowed_origins; /* relay config, irc section */ @@ -191,6 +194,74 @@ relay_config_change_network_ssl_cert_key (void *data, } /* + * Callback for changes on option "relay.network.ssl_priorities". + */ + +int +relay_config_check_network_ssl_priorities (void *data, + struct t_config_option *option, + const char *value) +{ +#ifdef HAVE_GNUTLS + gnutls_priority_t priority_cache; + const char *pos_error; + int rc; + + /* make C compiler happy */ + (void) data; + (void) option; + + pos_error = value; + + if (value && value[0]) + { + rc = gnutls_priority_init (&priority_cache, value, &pos_error); + if (rc == GNUTLS_E_SUCCESS) + { + gnutls_priority_deinit (priority_cache); + return 1; + } + } + + weechat_printf (NULL, + _("%s%s: invalid priorities string, error " + "at this position in string: \"%s\""), + weechat_prefix ("error"), RELAY_PLUGIN_NAME, + (pos_error) ? pos_error : value); + + return 0; +#else + /* make C compiler happy */ + (void) data; + (void) option; + (void) value; + + return 1; +#endif +} + +/* + * Callback for changes on option "relay.network.ssl_priorities". + */ + +void +relay_config_change_network_ssl_priorities (void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) data; + (void) option; + +#ifdef HAVE_GNUTLS + if (relay_network_init_ok && relay_gnutls_priority_cache) + { + gnutls_priority_deinit (*relay_gnutls_priority_cache); + relay_network_set_priority (); + } +#endif +} + +/* * Callback for changes on option "relay.network.websocker_allowed_origins". */ @@ -229,6 +300,50 @@ relay_config_change_network_websocket_allowed_origins (void *data, } /* + * Checks if IRC backlog tags are valid. + * + * Returns: + * 1: IRC backlog tags are valid + * 0: IRC backlog tags are not valid + */ + +int +relay_config_check_irc_backlog_tags (void *data, + struct t_config_option *option, + const char *value) +{ + char **tags; + int num_tags, i, rc; + + /* make C compiler happy */ + (void) data; + (void) option; + + rc = 1; + + /* "*" means all tags */ + if (strcmp (value, "*") == 0) + return rc; + + /* split tags and check them */ + tags = weechat_string_split (value, ",", 0, 0, &num_tags); + if (tags) + { + for (i = 0; i < num_tags; i++) + { + if (relay_irc_search_backlog_commands_tags (tags[i]) < 0) + { + rc = 0; + break; + } + } + weechat_string_free_split (tags); + } + + return rc; +} + +/* * Callback for changes on option "relay.irc.backlog_tags". */ @@ -255,7 +370,7 @@ relay_config_change_irc_backlog_tags (void *data, weechat_hashtable_remove_all (relay_config_hashtable_irc_backlog_tags); items = weechat_string_split (weechat_config_string (relay_config_irc_backlog_tags), - ";", 0, 0, &num_items); + ",", 0, 0, &num_items); if (items) { for (i = 0; i < num_items; i++) @@ -651,6 +766,16 @@ relay_config_init () "with SSL)"), NULL, 0, 0, "%h/ssl/relay.pem", NULL, 0, NULL, NULL, &relay_config_change_network_ssl_cert_key, NULL, NULL, NULL); + relay_config_network_ssl_priorities = weechat_config_new_option ( + relay_config_file, ptr_section, + "ssl_priorities", "string", + N_("string with priorities for gnutls (for syntax, see " + "documentation of function gnutls_priority_init in gnutls " + "manual, common strings are: \"PERFORMANCE\", \"NORMAL\", " + "\"SECURE128\", \"SECURE256\", \"EXPORT\", \"NONE\")"), + NULL, 0, 0, "NORMAL:-VERS-SSL3.0", NULL, 0, + &relay_config_check_network_ssl_priorities, NULL, + &relay_config_change_network_ssl_priorities, NULL, NULL, NULL); relay_config_network_websocket_allowed_origins = weechat_config_new_option ( relay_config_file, ptr_section, "websocket_allowed_origins", "string", @@ -696,10 +821,12 @@ relay_config_init () relay_config_irc_backlog_tags = weechat_config_new_option ( relay_config_file, ptr_section, "backlog_tags", "string", - N_("tags of messages which are displayed in backlog per IRC channel " - "(supported tags: \"irc_join\", \"irc_part\", \"irc_quit\", " - "\"irc_nick\", \"irc_privmsg\"), \"*\" = all supported tags"), - NULL, 0, 0, "irc_privmsg", NULL, 0, NULL, NULL, + N_("comma-separated list of messages tags which are displayed in " + "backlog per IRC channel (supported tags: \"irc_join\", " + "\"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg\"), " + "\"*\" = all supported tags"), + NULL, 0, 0, "irc_privmsg", NULL, 0, + &relay_config_check_irc_backlog_tags, NULL, &relay_config_change_irc_backlog_tags, NULL, NULL, NULL); relay_config_irc_backlog_time_format = weechat_config_new_option ( relay_config_file, ptr_section, diff --git a/src/plugins/relay/relay-config.h b/src/plugins/relay/relay-config.h index 5b37340d9..5d40878ef 100644 --- a/src/plugins/relay/relay-config.h +++ b/src/plugins/relay/relay-config.h @@ -44,6 +44,7 @@ extern struct t_config_option *relay_config_network_ipv6; extern struct t_config_option *relay_config_network_max_clients; extern struct t_config_option *relay_config_network_password; extern struct t_config_option *relay_config_network_ssl_cert_key; +extern struct t_config_option *relay_config_network_ssl_priorities; extern struct t_config_option *relay_config_network_websocket_allowed_origins; extern struct t_config_option *relay_config_irc_backlog_max_minutes; diff --git a/src/plugins/relay/relay-network.c b/src/plugins/relay/relay-network.c index c65dec985..e15c84a87 100644 --- a/src/plugins/relay/relay-network.c +++ b/src/plugins/relay/relay-network.c @@ -104,6 +104,28 @@ relay_network_set_ssl_cert_key (int verbose) } /* + * Sets gnutls priority cache. + */ + +void +relay_network_set_priority () +{ +#ifdef HAVE_GNUTLS + if (gnutls_priority_init (relay_gnutls_priority_cache, + weechat_config_string ( + relay_config_network_ssl_priorities), + NULL) != GNUTLS_E_SUCCESS) + { + weechat_printf (NULL, + _("%s%s: unable to initialize priority for SSL"), + weechat_prefix ("error"), RELAY_PLUGIN_NAME); + free (relay_gnutls_priority_cache); + relay_gnutls_priority_cache = NULL; + } +#endif +} + +/* * Initializes network for relay. */ @@ -119,17 +141,7 @@ relay_network_init () /* priority */ relay_gnutls_priority_cache = malloc (sizeof (*relay_gnutls_priority_cache)); if (relay_gnutls_priority_cache) - { - if (gnutls_priority_init (relay_gnutls_priority_cache, - "PERFORMANCE", NULL) != GNUTLS_E_SUCCESS) - { - weechat_printf (NULL, - _("%s%s: unable to initialize priority for SSL"), - weechat_prefix ("error"), RELAY_PLUGIN_NAME); - free (relay_gnutls_priority_cache); - relay_gnutls_priority_cache = NULL; - } - } + relay_network_set_priority (); #endif relay_network_init_ok = 1; } diff --git a/src/plugins/relay/relay-network.h b/src/plugins/relay/relay-network.h index 0e58ffb49..7e29c06eb 100644 --- a/src/plugins/relay/relay-network.h +++ b/src/plugins/relay/relay-network.h @@ -34,6 +34,7 @@ extern gnutls_dh_params_t *relay_gnutls_dh_params; #endif extern void relay_network_set_ssl_cert_key (int verbose); +extern void relay_network_set_priority (); extern void relay_network_init (); extern void relay_network_end (); diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c index 900ecf9c1..11481f962 100644 --- a/src/plugins/relay/relay-server.c +++ b/src/plugins/relay/relay-server.c @@ -269,6 +269,12 @@ relay_server_sock_cb (void *data, int fd) INET6_ADDRSTRLEN)) { ptr_ip_address = ipv6_address; + + if (strncmp (ptr_ip_address, "::ffff:", 7) == 0) + { + /* actually an IPv4-mapped IPv6 address, so skip "::ffff:" */ + ptr_ip_address += 7; + } } } else @@ -540,15 +546,7 @@ relay_server_new (const char *protocol_string, enum t_relay_protocol protocol, new_server->start_time = 0; new_server->last_client_disconnect = 0; - if (!relay_server_create_socket (new_server)) - { - if (new_server->protocol_string) - free (new_server->protocol_string); - if (new_server->protocol_args) - free (new_server->protocol_args); - free (new_server); - return NULL; - } + relay_server_create_socket (new_server); new_server->prev_server = NULL; new_server->next_server = relay_servers; diff --git a/src/plugins/relay/weechat/relay-weechat-msg.c b/src/plugins/relay/weechat/relay-weechat-msg.c index a7be45f2c..4fc601440 100644 --- a/src/plugins/relay/weechat/relay-weechat-msg.c +++ b/src/plugins/relay/weechat/relay-weechat-msg.c @@ -1023,7 +1023,7 @@ relay_weechat_msg_send (struct t_relay_client *client, Bytef *dest; uLongf dest_size; struct timeval tv1, tv2; - long time_diff; + long long time_diff; if (weechat_config_integer (relay_config_network_compression_level) > 0) { @@ -1049,11 +1049,11 @@ relay_weechat_msg_send (struct t_relay_client *client, /* display message in raw buffer */ snprintf (raw_message, sizeof (raw_message), - "obj: %d/%d bytes (%d%%, %ldms), id: %s", + "obj: %d/%d bytes (%d%%, %.2fms), id: %s", (int)dest_size + 5, msg->data_size, 100 - ((((int)dest_size + 5) * 100) / msg->data_size), - time_diff, + ((float)time_diff) / 1000, msg->id); /* send compressed data */ diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index bd6d5105b..b0f9155ef 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -652,6 +652,10 @@ script_repo_remove (struct t_script_repo *script) { struct t_script_repo *new_scripts_repo; + /* unlink script from buffer (if it is used) */ + if (script_buffer_detail_script == script) + script_buffer_detail_script = NULL; + /* remove script from list */ if (last_script_repo == script) last_script_repo = script->prev_script; diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c index 79782369d..16a5ceef5 100644 --- a/src/plugins/trigger/trigger-callback.c +++ b/src/plugins/trigger/trigger-callback.c @@ -30,8 +30,11 @@ #include "trigger-buffer.h" -/* one hashtable by hook, used in callback to evaluate "conditions" */ -struct t_hashtable *trigger_callback_hashtable_options = NULL; +/* hashtable used to evaluate "conditions" */ +struct t_hashtable *trigger_callback_hashtable_options_conditions = NULL; + +/* hashtable used to replace with regex */ +struct t_hashtable *trigger_callback_hashtable_options_regex = NULL; /* @@ -148,10 +151,11 @@ trigger_callback_check_conditions (struct t_trigger *trigger, if (!conditions || !conditions[0]) return 1; - value = weechat_string_eval_expression (conditions, - pointers, - extra_vars, - trigger_callback_hashtable_options); + value = weechat_string_eval_expression ( + conditions, + pointers, + extra_vars, + trigger_callback_hashtable_options_conditions); rc = (value && (strcmp (value, "1") == 0)); if (value) free (value); @@ -169,13 +173,27 @@ trigger_callback_replace_regex (struct t_trigger *trigger, struct t_hashtable *extra_vars, int display_monitor) { - char *value, *replace_eval; + char *value; const char *ptr_key, *ptr_value; - int i; + int i, pointers_allocated; + + pointers_allocated = 0; if (trigger->regex_count == 0) return; + if (!pointers) + { + pointers = weechat_hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_POINTER, + NULL, + NULL); + if (!pointers) + return; + pointers_allocated = 1; + } + for (i = 0; i < trigger->regex_count; i++) { /* if regex is not set (invalid), skip it */ @@ -208,43 +226,45 @@ trigger_callback_replace_regex (struct t_trigger *trigger, continue; } - replace_eval = weechat_string_eval_expression ( - trigger->regex[i].replace_escaped, + weechat_hashtable_set (pointers, "regex", trigger->regex[i].regex); + weechat_hashtable_set (trigger_callback_hashtable_options_regex, + "regex_replace", + trigger->regex[i].replace_escaped); + + value = weechat_string_eval_expression ( + ptr_value, pointers, extra_vars, - NULL); - if (replace_eval) + trigger_callback_hashtable_options_regex); + + if (value) { - value = weechat_string_replace_regex (ptr_value, - trigger->regex[i].regex, - replace_eval, - '$', - NULL, NULL); - if (value) + /* display debug info on trigger buffer */ + if (trigger_buffer && display_monitor) { - /* display debug info on trigger buffer */ - if (trigger_buffer && display_monitor) - { - weechat_printf_tags (trigger_buffer, "no_trigger", - "\t regex %d %s(%s%s%s)%s: " - "%s\"%s%s%s\"", - i + 1, - weechat_color ("chat_delimiters"), - weechat_color ("reset"), - ptr_key, - weechat_color ("chat_delimiters"), - weechat_color ("reset"), - weechat_color ("chat_delimiters"), - weechat_color ("reset"), - value, - weechat_color ("chat_delimiters")); - } - weechat_hashtable_set (extra_vars, ptr_key, value); - free (value); + weechat_printf_tags (trigger_buffer, "no_trigger", + "\t regex %d %s(%s%s%s)%s: " + "%s\"%s%s%s\"", + i + 1, + weechat_color ("chat_delimiters"), + weechat_color ("reset"), + ptr_key, + weechat_color ("chat_delimiters"), + weechat_color ("reset"), + weechat_color ("chat_delimiters"), + weechat_color ("reset"), + value, + weechat_color ("chat_delimiters")); } - free (replace_eval); + weechat_hashtable_set (extra_vars, ptr_key, value); + free (value); } } + + if (pointers_allocated) + weechat_hashtable_free (pointers); + else + weechat_hashtable_remove (pointers, "regex"); } /* @@ -912,16 +932,24 @@ end: void trigger_callback_init () { - trigger_callback_hashtable_options = weechat_hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_STRING, - NULL, - NULL); - if (trigger_callback_hashtable_options) + trigger_callback_hashtable_options_conditions = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); + if (trigger_callback_hashtable_options_conditions) { - weechat_hashtable_set (trigger_callback_hashtable_options, + weechat_hashtable_set (trigger_callback_hashtable_options_conditions, "type", "condition"); } + + trigger_callback_hashtable_options_regex = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); } /* @@ -931,6 +959,8 @@ trigger_callback_init () void trigger_callback_end () { - if (trigger_callback_hashtable_options) - weechat_hashtable_free (trigger_callback_hashtable_options); + if (trigger_callback_hashtable_options_conditions) + weechat_hashtable_free (trigger_callback_hashtable_options_conditions); + if (trigger_callback_hashtable_options_regex) + weechat_hashtable_free (trigger_callback_hashtable_options_regex); } diff --git a/src/plugins/trigger/trigger-command.c b/src/plugins/trigger/trigger-command.c index 56954bdc8..d24e3069f 100644 --- a/src/plugins/trigger/trigger-command.c +++ b/src/plugins/trigger/trigger-command.c @@ -315,6 +315,20 @@ trigger_command_list_default (int verbose) } /* + * Displays an error if a trigger is running. + */ + +void +trigger_command_error_running (struct t_trigger *trigger, const char *action) +{ + weechat_printf_tags (NULL, "no_trigger", + _("%s%s: action \"%s\" can not be executed on " + "trigger \"%s\" because it is currently running"), + weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, + action, trigger->name); +} + +/* * Set "enabled" value in a trigger. * * Argument "enable" can be: @@ -325,9 +339,16 @@ trigger_command_list_default (int verbose) */ void -trigger_command_set_enabled (struct t_trigger *trigger, int enable, +trigger_command_set_enabled (struct t_trigger *trigger, + int enable, const char *enable_string, int display_error) { + if (trigger->hook_running) + { + trigger_command_error_running (trigger, enable_string); + return; + } + if (enable == 2) { if (weechat_config_boolean (trigger->options[TRIGGER_OPTION_ENABLED])) @@ -434,7 +455,7 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, struct t_trigger *ptr_trigger, *ptr_trigger2; struct t_trigger_regex *regex; char *value, **sargv, **items, input[1024], str_pos[16]; - int rc, i, type, count, index_option, enable, sargc, num_items, add_rc; + int rc, i, j, type, count, index_option, enable, sargc, num_items, add_rc; int regex_count, regex_rc; /* make C compiler happy */ @@ -539,7 +560,14 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, if (weechat_strcasecmp (argv[1], "addreplace") == 0) { if (ptr_trigger) + { + if (ptr_trigger->hook_running) + { + trigger_command_error_running (ptr_trigger, argv[1]); + goto end; + } trigger_free (ptr_trigger); + } } else { @@ -680,6 +708,11 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, argv[2]); goto end; } + if (ptr_trigger->hook_running) + { + trigger_command_error_running (ptr_trigger, argv[1]); + goto end; + } if (weechat_strcasecmp (argv[3], "name") == 0) { trigger_command_rename (ptr_trigger, argv[4]); @@ -724,6 +757,11 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, argv[2]); goto end; } + if (ptr_trigger->hook_running) + { + trigger_command_error_running (ptr_trigger, argv[1]); + goto end; + } trigger_command_rename (ptr_trigger, argv[3]); goto end; } @@ -814,7 +852,7 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, for (ptr_trigger = triggers; ptr_trigger; ptr_trigger = ptr_trigger->next_trigger) { - trigger_command_set_enabled (ptr_trigger, enable, 0); + trigger_command_set_enabled (ptr_trigger, enable, argv[1], 0); } } else @@ -823,7 +861,8 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, { ptr_trigger = trigger_search (argv[i]); if (ptr_trigger) - trigger_command_set_enabled (ptr_trigger, enable, 1); + trigger_command_set_enabled (ptr_trigger, enable, argv[1], + 1); else { weechat_printf_tags (NULL, "no_trigger", @@ -843,7 +882,21 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, if (weechat_strcasecmp (argv[2], "-all") == 0) { count = triggers_count; - trigger_free_all (); + ptr_trigger = triggers; + while (ptr_trigger) + { + ptr_trigger2 = ptr_trigger->next_trigger; + if (ptr_trigger->hook_running) + { + trigger_command_error_running (ptr_trigger, argv[1]); + } + else + { + trigger_free (ptr_trigger); + } + ptr_trigger = ptr_trigger2; + } + count = count - triggers_count; if (count > 0) weechat_printf_tags (NULL, "no_trigger", _("%d triggers removed"), count); @@ -855,9 +908,16 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, ptr_trigger = trigger_search (argv[i]); if (ptr_trigger) { - trigger_free (ptr_trigger); - weechat_printf_tags (NULL, "no_trigger", - _("Trigger \"%s\" removed"), argv[i]); + if (ptr_trigger->hook_running) + { + trigger_command_error_running (ptr_trigger, argv[1]); + } + else + { + trigger_free (ptr_trigger); + weechat_printf_tags (NULL, "no_trigger", + _("Trigger \"%s\" removed"), argv[i]); + } } else { @@ -890,14 +950,80 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, goto end; } - /* restore default triggers */ + /* restore default trigger(s) */ + if (weechat_strcasecmp (argv[1], "restore") == 0) + { + if (argc < 3) + goto error; + for (i = 2; i < argc; i++) + { + for (j = 0; trigger_config_default_list[j][0]; j++) + { + if (weechat_strcasecmp (trigger_config_default_list[j][0], + argv[i]) == 0) + { + break; + } + } + if (trigger_config_default_list[j][0]) + { + ptr_trigger = trigger_search (argv[i]); + if (ptr_trigger && ptr_trigger->hook_running) + { + trigger_command_error_running (ptr_trigger, argv[1]); + } + else + { + if (ptr_trigger) + trigger_free (ptr_trigger); + trigger_new ( + trigger_config_default_list[j][0], /* name */ + trigger_config_default_list[j][1], /* enabled */ + trigger_config_default_list[j][2], /* hook */ + trigger_config_default_list[j][3], /* arguments */ + trigger_config_default_list[j][4], /* conditions */ + trigger_config_default_list[j][5], /* regex */ + trigger_config_default_list[j][6], /* command */ + trigger_config_default_list[j][7]); /* return code */ + weechat_printf_tags (NULL, "no_trigger", + _("Trigger \"%s\" restored"), + argv[i]); + } + } + else + { + weechat_printf_tags (NULL, "no_trigger", + _("%sDefault trigger \"%s\" not found"), + weechat_prefix ("error"), argv[i]); + } + } + goto end; + } + + /* delete all triggers and restore default ones */ if (weechat_strcasecmp (argv[1], "default") == 0) { if ((argc >= 3) && (weechat_strcasecmp (argv[2], "-yes") == 0)) { - trigger_free_all (); - trigger_create_default (); - trigger_command_list (_("Default triggers restored:"), 0); + ptr_trigger = triggers; + while (ptr_trigger) + { + ptr_trigger2 = ptr_trigger->next_trigger; + if (ptr_trigger->hook_running) + { + trigger_command_error_running (ptr_trigger, argv[1]); + } + else + { + trigger_free (ptr_trigger); + } + ptr_trigger = ptr_trigger2; + } + if (triggers_count == 0) + { + trigger_create_default (); + trigger_command_list (_("Default triggers restored:"), 0); + } } else { @@ -948,6 +1074,7 @@ trigger_command_init () " || restart <name>|-all [<name>...]" " || show <name>" " || del <name>|-all [<name>...]" + " || restore <name> [<name>...]" " || default -yes" " || monitor [<filter>]"), N_(" list: list triggers (without argument, this list is displayed)\n" @@ -1000,7 +1127,9 @@ trigger_command_init () " show: show detailed info on a trigger (with some stats)\n" " del: delete a trigger\n" " -all: do action on all triggers\n" - " default: restore default triggers\n" + " restore: restore trigger(s) with the default values (works " + "only for default triggers)\n" + " default: delete all triggers and restore default ones\n" " monitor: open the trigger monitor buffer, with optional filter:\n" " filter: filter hooks/triggers to display (a hook must start " "with \"@\", for example \"@signal\"), many filters can be separated " @@ -1019,9 +1148,9 @@ trigger_command_init () " 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:underline}$1${color:-underline}_== " - "==/(\\S+)/==/${color:italic}$1${color:-italic}/\"\n" + "\"==\\*(\\S+)\\*==*${color:bold}${re:1}${color:-bold}*== " + "==_(\\S+)_==_${color:underline}${re:1}${color:-underline}_== " + "==/(\\S+)/==/${color:italic}${re:1}${color:-italic}/\"\n" " hide nicklist bar on small terminals:\n" " /trigger add resize_small signal signal_sigwinch " "\"${info:term_width} < 100\" \"\" \"/bar hide nicklist\"\n" @@ -1043,6 +1172,7 @@ trigger_command_init () " || enable|disable|toggle|restart|del %(trigger_names)|-all " "%(trigger_names)|%*" " || show %(trigger_names)" + " || restore %(trigger_names_default)|%*" " || default" " || monitor %(trigger_names)|%(trigger_hooks_filter)", &trigger_command_trigger, NULL); diff --git a/src/plugins/trigger/trigger-completion.c b/src/plugins/trigger/trigger-completion.c index 4bad0aa40..9b5a0fe7b 100644 --- a/src/plugins/trigger/trigger-completion.c +++ b/src/plugins/trigger/trigger-completion.c @@ -25,6 +25,7 @@ #include "../weechat-plugin.h" #include "trigger.h" +#include "trigger-config.h" /* @@ -54,6 +55,33 @@ trigger_completion_triggers_cb (void *data, const char *completion_item, } /* + * Adds default triggers to completion list. + */ + +int +trigger_completion_triggers_default_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + int i; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + for (i = 0; trigger_config_default_list[i][0]; i++) + { + weechat_hook_completion_list_add (completion, + trigger_config_default_list[i][0], + 0, WEECHAT_LIST_POS_SORT); + } + + return WEECHAT_RC_OK; +} + +/* * Adds options for triggers to completion list. */ @@ -393,6 +421,9 @@ trigger_completion_init () weechat_hook_completion ("trigger_names", N_("triggers"), &trigger_completion_triggers_cb, NULL); + weechat_hook_completion ("trigger_names_default", + N_("default triggers"), + &trigger_completion_triggers_default_cb, NULL); weechat_hook_completion ("trigger_options", N_("options for triggers"), &trigger_completion_options_cb, NULL); diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c index 57d84c871..91782c962 100644 --- a/src/plugins/trigger/trigger-config.c +++ b/src/plugins/trigger/trigger-config.c @@ -53,7 +53,7 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = { "beep", "on", "print", "", - "${tg_highlight} || ${tg_msg_pv}", + "${tg_displayed} && (${tg_highlight} || ${tg_msg_pv})", "", "/print -beep", "ok" }, @@ -64,13 +64,13 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = "", "==^(" "(/(msg|quote) +nickserv " - "+(id|identify|register|ghost +\\S+|release +\\S+|regain +\\S+) +)|" - "/oper +\\S+ +|" + "+(id|identify|register|ghost +[^ ]+|release +[^ ]+|regain +[^ ]+) +)|" + "/oper +[^ ]+ +|" "/quote +pass +|" - "/set +\\S*password\\S* +|" - "/secure +(passphrase|decrypt|set +\\S+) +)" + "/set +[^ ]*password[^ ]* +|" + "/secure +(passphrase|decrypt|set +[^ ]+) +)" "(.*)" - "==$1$.*+", + "==${re:1}${hide:*,${re:+}}", "", "" }, /* hide password in IRC auth message displayed */ @@ -78,7 +78,8 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = "modifier", "5000|irc_message_auth", "", - "==^(.*(id|identify|register|ghost +\\S+|release +\\S+) +)(.*)==$1$.*+", + "==^(.*(id|identify|register|ghost +[^ ]+|release +[^ ]+) +)(.*)" + "==${re:1}${hide:*,${re:+}}", "", "" }, /* hide server password in commands /server and /connect */ @@ -86,7 +87,8 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = "modifier", "5000|input_text_display;5000|history_add", "", - "==^(/(server|connect) .*-(sasl_)?password=)(\\S+)(.*)==$1$.*4$5" + "==^(/(server|connect) .*-(sasl_)?password=)([^ ]+)(.*)" + "==${re:1}${hide:*,${re:4}}${re:5}" "", "" }, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, @@ -314,8 +316,9 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option "chars are interpreted in the regex (for example \"\\n\"); " "the separator \"/\" can be replaced by any char (one or " "more identical chars); matching groups can be used in " - "replace: $0 to $99, $+ for last match and $.cN to replace " - "all chars of group N by char c"), + "replace: ${re:0} to ${re:99}, ${re:+} for last match and " + "${hide:c,${re:N}} to replace all chars of group N by " + "char 'c'"), NULL, 0, 0, value, NULL, 0, NULL, NULL, &trigger_config_change_trigger_regex, NULL, NULL, NULL); break; diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c index 8a6650f12..ef190993d 100644 --- a/src/plugins/trigger/trigger.c +++ b/src/plugins/trigger/trigger.c @@ -572,6 +572,8 @@ trigger_regex_split (const char *str_regex, pos_replace - ptr_regex); if (!(*regex)[index].str_regex) goto memory_error; + if (str_regex_escaped) + free (str_regex_escaped); str_regex_escaped = weechat_string_convert_escaped_chars ((*regex)[index].str_regex); if (!str_regex_escaped) goto memory_error; diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index ad619e9c2..67668be72 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -57,7 +57,7 @@ struct timeval; * please change the date with current one; for a second change at same * date, increment the 01, otherwise please keep 01. */ -#define WEECHAT_PLUGIN_API_VERSION "20140802-01" +#define WEECHAT_PLUGIN_API_VERSION "20140829-01" /* macros for defining plugin infos */ #define WEECHAT_PLUGIN_NAME(__name) \ @@ -304,8 +304,8 @@ struct t_weechat_plugin /* util */ int (*util_timeval_cmp) (struct timeval *tv1, struct timeval *tv2); - long (*util_timeval_diff) (struct timeval *tv1, struct timeval *tv2); - void (*util_timeval_add) (struct timeval *tv, long interval); + long long (*util_timeval_diff) (struct timeval *tv1, struct timeval *tv2); + void (*util_timeval_add) (struct timeval *tv, long long interval); char *(*util_get_time_string) (const time_t *date); int (*util_version_number) (const char *version); @@ -950,260 +950,263 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); /* plugins */ #define weechat_plugin_get_name(__plugin) \ - weechat_plugin->plugin_get_name(__plugin) + (weechat_plugin->plugin_get_name)(__plugin) /* strings */ #define weechat_charset_set(__charset) \ - weechat_plugin->charset_set(weechat_plugin, __charset) + (weechat_plugin->charset_set)(weechat_plugin, __charset) #define weechat_iconv_to_internal(__charset, __string) \ - weechat_plugin->iconv_to_internal(__charset, __string) + (weechat_plugin->iconv_to_internal)(__charset, __string) #define weechat_iconv_from_internal(__charset, __string) \ - weechat_plugin->iconv_from_internal(__charset, __string) + (weechat_plugin->iconv_from_internal)(__charset, __string) #ifndef WEECHAT_H #ifndef _ -#define _(string) weechat_plugin->gettext(string) +#define _(string) (weechat_plugin->gettext)(string) #endif /* _ */ #ifndef N_ #define N_(string) (string) #endif /* N_ */ #ifndef NG_ #define NG_(single,plural,number) \ - weechat_plugin->ngettext(single, plural, number) + (weechat_plugin->ngettext)(single, plural, number) #endif /* NG_ */ #endif /* WEECHAT_H */ -#define weechat_gettext(string) weechat_plugin->gettext(string) +#define weechat_gettext(string) (weechat_plugin->gettext)(string) #define weechat_ngettext(single,plural,number) \ - weechat_plugin->ngettext(single, plural, number) + (weechat_plugin->ngettext)(single, plural, number) #define weechat_strndup(__string, __length) \ - weechat_plugin->strndup(__string, __length) + (weechat_plugin->strndup)(__string, __length) #define weechat_string_tolower(__string) \ - weechat_plugin->string_tolower(__string) + (weechat_plugin->string_tolower)(__string) #define weechat_string_toupper(__string) \ - weechat_plugin->string_toupper(__string) + (weechat_plugin->string_toupper)(__string) #define weechat_strcasecmp(__string1, __string2) \ - weechat_plugin->strcasecmp(__string1, __string2) + (weechat_plugin->strcasecmp)(__string1, __string2) #define weechat_strcasecmp_range(__string1, __string2, __range) \ - weechat_plugin->strcasecmp_range(__string1, __string2, __range) + (weechat_plugin->strcasecmp_range)(__string1, __string2, __range) #define weechat_strncasecmp(__string1, __string2, __max) \ - weechat_plugin->strncasecmp(__string1, __string2, __max) + (weechat_plugin->strncasecmp)(__string1, __string2, __max) #define weechat_strncasecmp_range(__string1, __string2, __max, __range) \ - weechat_plugin->strncasecmp_range(__string1, __string2, __max, \ - __range) + (weechat_plugin->strncasecmp_range)(__string1, __string2, __max, \ + __range) #define weechat_strcmp_ignore_chars(__string1, __string2, \ __chars_ignored, __case_sensitive) \ - weechat_plugin->strcmp_ignore_chars(__string1, __string2, \ - __chars_ignored, \ - __case_sensitive) + (weechat_plugin->strcmp_ignore_chars)(__string1, __string2, \ + __chars_ignored, \ + __case_sensitive) #define weechat_strcasestr(__string, __search) \ - weechat_plugin->strcasestr(__string, __search) + (weechat_plugin->strcasestr)(__string, __search) #define weechat_strlen_screen(__string) \ - weechat_plugin->strlen_screen(__string) + (weechat_plugin->strlen_screen)(__string) #define weechat_string_match(__string, __mask, __case_sensitive) \ - weechat_plugin->string_match(__string, __mask, __case_sensitive) + (weechat_plugin->string_match)(__string, __mask, __case_sensitive) #define weechat_string_replace(__string, __search, __replace) \ - weechat_plugin->string_replace(__string, __search, __replace) -#define weechat_string_expand_home(__path) \ - weechat_plugin->string_expand_home(__path) + (weechat_plugin->string_replace)(__string, __search, __replace) +#define weechat_string_expand_home(__path) \ + (weechat_plugin->string_expand_home)(__path) #define weechat_string_remove_quotes(__string, __quotes) \ - weechat_plugin->string_remove_quotes(__string, __quotes) + (weechat_plugin->string_remove_quotes)(__string, __quotes) #define weechat_string_strip(__string, __left, __right, __chars) \ - weechat_plugin->string_strip(__string, __left, __right, __chars) + (weechat_plugin->string_strip)(__string, __left, __right, __chars) #define weechat_string_convert_escaped_chars(__string) \ - weechat_plugin->string_convert_escaped_chars(__string) + (weechat_plugin->string_convert_escaped_chars)(__string) #define weechat_string_mask_to_regex(__mask) \ - weechat_plugin->string_mask_to_regex(__mask) + (weechat_plugin->string_mask_to_regex)(__mask) #define weechat_string_regex_flags(__regex, __default_flags, __flags) \ - weechat_plugin->string_regex_flags(__regex, __default_flags, \ - __flags) + (weechat_plugin->string_regex_flags)(__regex, __default_flags, \ + __flags) #define weechat_string_regcomp(__preg, __regex, __default_flags) \ - weechat_plugin->string_regcomp(__preg, __regex, __default_flags) + (weechat_plugin->string_regcomp)(__preg, __regex, __default_flags) #define weechat_string_has_highlight(__string, __highlight_words) \ - weechat_plugin->string_has_highlight(__string, __highlight_words) + (weechat_plugin->string_has_highlight)(__string, __highlight_words) #define weechat_string_has_highlight_regex(__string, __regex) \ - weechat_plugin->string_has_highlight_regex(__string, __regex) + (weechat_plugin->string_has_highlight_regex)(__string, __regex) #define weechat_string_replace_regex(__string, __regex, __replace, \ __reference_char, __callback, \ __callback_data) \ - weechat_plugin->string_replace_regex(__string, __regex, __replace, \ - __reference_char, __callback, \ - __callback_data) + (weechat_plugin->string_replace_regex)(__string, __regex, \ + __replace, \ + __reference_char, \ + __callback, \ + __callback_data) #define weechat_string_split(__string, __separator, __eol, __max, \ __num_items) \ - weechat_plugin->string_split(__string, __separator, __eol, \ - __max, __num_items) + (weechat_plugin->string_split)(__string, __separator, __eol, \ + __max, __num_items) #define weechat_string_split_shell(__string, __num_items) \ - weechat_plugin->string_split_shell(__string, __num_items) + (weechat_plugin->string_split_shell)(__string, __num_items) #define weechat_string_free_split(__split_string) \ - weechat_plugin->string_free_split(__split_string) + (weechat_plugin->string_free_split)(__split_string) #define weechat_string_build_with_split_string(__split_string, \ __separator) \ - weechat_plugin->string_build_with_split_string(__split_string, \ - __separator) + (weechat_plugin->string_build_with_split_string)(__split_string, \ + __separator) #define weechat_string_split_command(__command, __separator) \ - weechat_plugin->string_split_command(__command, __separator) + (weechat_plugin->string_split_command)(__command, __separator) #define weechat_string_free_split_command(__split_command) \ - weechat_plugin->string_free_split_command(__split_command) + (weechat_plugin->string_free_split_command)(__split_command) #define weechat_string_format_size(__size) \ - weechat_plugin->string_format_size(__size) + (weechat_plugin->string_format_size)(__size) #define weechat_string_remove_color(__string, __replacement) \ - weechat_plugin->string_remove_color(__string, __replacement) + (weechat_plugin->string_remove_color)(__string, __replacement) #define weechat_string_encode_base64(__from, __length, __to) \ - weechat_plugin->string_encode_base64(__from, __length, __to) + (weechat_plugin->string_encode_base64)(__from, __length, __to) #define weechat_string_decode_base64(__from, __to) \ - weechat_plugin->string_decode_base64(__from, __to) + (weechat_plugin->string_decode_base64)(__from, __to) #define weechat_string_is_command_char(__string) \ - weechat_plugin->string_is_command_char(__string) + (weechat_plugin->string_is_command_char)(__string) #define weechat_string_input_for_buffer(__string) \ - weechat_plugin->string_input_for_buffer(__string) + (weechat_plugin->string_input_for_buffer)(__string) #define weechat_string_eval_expression(__expr, __pointers, \ __extra_vars, __options) \ - weechat_plugin->string_eval_expression(__expr, __pointers, \ - __extra_vars, __options) + (weechat_plugin->string_eval_expression)(__expr, __pointers, \ + __extra_vars, __options) /* UTF-8 strings */ #define weechat_utf8_has_8bits(__string) \ - weechat_plugin->utf8_has_8bits(__string) + (weechat_plugin->utf8_has_8bits)(__string) #define weechat_utf8_is_valid(__string, __error) \ - weechat_plugin->utf8_is_valid(__string, __error) + (weechat_plugin->utf8_is_valid)(__string, __error) #define weechat_utf8_normalize(__string, __char) \ - weechat_plugin->utf8_normalize(__string, __char) + (weechat_plugin->utf8_normalize)(__string, __char) #define weechat_utf8_prev_char(__start, __string) \ - weechat_plugin->utf8_prev_char(__start, __string) + (weechat_plugin->utf8_prev_char)(__start, __string) #define weechat_utf8_next_char(__string) \ - weechat_plugin->utf8_next_char(__string) + (weechat_plugin->utf8_next_char)(__string) #define weechat_utf8_char_int(__string) \ - weechat_plugin->utf8_char_int(__string) + (weechat_plugin->utf8_char_int)(__string) #define weechat_utf8_char_size(__string) \ - weechat_plugin->utf8_char_size(__string) + (weechat_plugin->utf8_char_size)(__string) #define weechat_utf8_strlen(__string) \ - weechat_plugin->utf8_strlen(__string) + (weechat_plugin->utf8_strlen)(__string) #define weechat_utf8_strnlen(__string, __bytes) \ - weechat_plugin->utf8_strnlen(__string, __bytes) + (weechat_plugin->utf8_strnlen)(__string, __bytes) #define weechat_utf8_strlen_screen(__string) \ - weechat_plugin->utf8_strlen_screen(__string) + (weechat_plugin->utf8_strlen_screen)(__string) #define weechat_utf8_charcmp(__string1, __string2) \ - weechat_plugin->utf8_charcmp(__string1, __string2) + (weechat_plugin->utf8_charcmp)(__string1, __string2) #define weechat_utf8_charcasecmp(__string1, __string2) \ - weechat_plugin->utf8_charcasecmp(__string1, __string2) + (weechat_plugin->utf8_charcasecmp)(__string1, __string2) #define weechat_utf8_char_size_screen(__string) \ - weechat_plugin->utf8_char_size_screen(__string) + (weechat_plugin->utf8_char_size_screen)(__string) #define weechat_utf8_add_offset(__string, __offset) \ - weechat_plugin->utf8_add_offset(__string, __offset) + (weechat_plugin->utf8_add_offset)(__string, __offset) #define weechat_utf8_real_pos(__string, __pos) \ - weechat_plugin->utf8_real_pos(__string, __pos) + (weechat_plugin->utf8_real_pos)(__string, __pos) #define weechat_utf8_pos(__string, __real_pos) \ - weechat_plugin->utf8_pos(__string, __real_pos) + (weechat_plugin->utf8_pos)(__string, __real_pos) #define weechat_utf8_strndup(__string, __length) \ - weechat_plugin->utf8_strndup(__string, __length) + (weechat_plugin->utf8_strndup)(__string, __length) /* directories */ #define weechat_mkdir_home(__directory, __mode) \ - weechat_plugin->mkdir_home(__directory, __mode) + (weechat_plugin->mkdir_home)(__directory, __mode) #define weechat_mkdir(__directory, __mode) \ - weechat_plugin->mkdir(__directory, __mode) + (weechat_plugin->mkdir)(__directory, __mode) #define weechat_mkdir_parents(__directory, __mode) \ - weechat_plugin->mkdir_parents(__directory, __mode) + (weechat_plugin->mkdir_parents)(__directory, __mode) #define weechat_exec_on_files(__directory, __hidden_files, __data, \ __callback) \ - weechat_plugin->exec_on_files(__directory, __hidden_files, __data, \ - __callback) + (weechat_plugin->exec_on_files)(__directory, __hidden_files, \ + __data, __callback) #define weechat_file_get_content(__filename) \ - weechat_plugin->file_get_content(__filename) + (weechat_plugin->file_get_content)(__filename) /* util */ #define weechat_util_timeval_cmp(__time1, __time2) \ - weechat_plugin->util_timeval_cmp(__time1, __time2) + (weechat_plugin->util_timeval_cmp)(__time1, __time2) #define weechat_util_timeval_diff(__time1, __time2) \ - weechat_plugin->util_timeval_diff(__time1, __time2) + (weechat_plugin->util_timeval_diff)(__time1, __time2) #define weechat_util_timeval_add(__time, __interval) \ - weechat_plugin->util_timeval_add(__time, __interval) + (weechat_plugin->util_timeval_add)(__time, __interval) #define weechat_util_get_time_string(__date) \ - weechat_plugin->util_get_time_string(__date) + (weechat_plugin->util_get_time_string)(__date) #define weechat_util_version_number(__version) \ - weechat_plugin->util_version_number(__version) + (weechat_plugin->util_version_number)(__version) /* sorted list */ #define weechat_list_new() \ - weechat_plugin->list_new() + (weechat_plugin->list_new)() #define weechat_list_add(__list, __string, __where, __user_data) \ - weechat_plugin->list_add(__list, __string, __where, __user_data) + (weechat_plugin->list_add)(__list, __string, __where, __user_data) #define weechat_list_search(__list, __string) \ - weechat_plugin->list_search(__list, __string) + (weechat_plugin->list_search)(__list, __string) #define weechat_list_search_pos(__list, __string) \ - weechat_plugin->list_search_pos(__list, __string) + (weechat_plugin->list_search_pos)(__list, __string) #define weechat_list_casesearch(__list, __string) \ - weechat_plugin->list_casesearch(__list, __string) + (weechat_plugin->list_casesearch)(__list, __string) #define weechat_list_casesearch_pos(__list, __string) \ - weechat_plugin->list_casesearch_pos(__list, __string) + (weechat_plugin->list_casesearch_pos)(__list, __string) #define weechat_list_get(__list, __index) \ - weechat_plugin->list_get(__list, __index) + (weechat_plugin->list_get)(__list, __index) #define weechat_list_set(__item, __value) \ - weechat_plugin->list_set(__item, __value) + (weechat_plugin->list_set)(__item, __value) #define weechat_list_next(__item) \ - weechat_plugin->list_next(__item) + (weechat_plugin->list_next)(__item) #define weechat_list_prev(__item) \ - weechat_plugin->list_prev(__item) + (weechat_plugin->list_prev)(__item) #define weechat_list_string(__item) \ - weechat_plugin->list_string(__item) + (weechat_plugin->list_string)(__item) #define weechat_list_size(__list) \ - weechat_plugin->list_size(__list) + (weechat_plugin->list_size)(__list) #define weechat_list_remove(__list, __item) \ - weechat_plugin->list_remove(__list, __item) + (weechat_plugin->list_remove)(__list, __item) #define weechat_list_remove_all(__list) \ - weechat_plugin->list_remove_all(__list) + (weechat_plugin->list_remove_all)(__list) #define weechat_list_free(__list) \ - weechat_plugin->list_free(__list) + (weechat_plugin->list_free)(__list) /* hash tables */ #define weechat_hashtable_new(__size, __type_keys, __type_values, \ __hash_key_cb, __keycmp_cb) \ - weechat_plugin->hashtable_new(__size, __type_keys, __type_values, \ - __hash_key_cb, __keycmp_cb) + (weechat_plugin->hashtable_new)(__size, __type_keys, __type_values, \ + __hash_key_cb, __keycmp_cb) #define weechat_hashtable_set_with_size(__hashtable, __key, __key_size, \ __value, __value_size) \ - weechat_plugin->hashtable_set_with_size(__hashtable, __key, \ - __key_size, __value, \ - __value_size) + (weechat_plugin->hashtable_set_with_size)(__hashtable, __key, \ + __key_size, __value, \ + __value_size) #define weechat_hashtable_set(__hashtable, __key, __value) \ - weechat_plugin->hashtable_set(__hashtable, __key, __value) + (weechat_plugin->hashtable_set)(__hashtable, __key, __value) #define weechat_hashtable_get(__hashtable, __key) \ - weechat_plugin->hashtable_get(__hashtable, __key) + (weechat_plugin->hashtable_get)(__hashtable, __key) #define weechat_hashtable_has_key(__hashtable, __key) \ - weechat_plugin->hashtable_has_key(__hashtable, __key) + (weechat_plugin->hashtable_has_key)(__hashtable, __key) #define weechat_hashtable_map(__hashtable, __cb_map, __cb_map_data) \ - weechat_plugin->hashtable_map(__hashtable, __cb_map, __cb_map_data) + (weechat_plugin->hashtable_map)(__hashtable, __cb_map, \ + __cb_map_data) #define weechat_hashtable_map_string(__hashtable, __cb_map, \ __cb_map_data) \ - weechat_plugin->hashtable_map_string(__hashtable, __cb_map, \ - __cb_map_data) + (weechat_plugin->hashtable_map_string)(__hashtable, __cb_map, \ + __cb_map_data) #define weechat_hashtable_dup(__hashtable) \ - weechat_plugin->hashtable_dup(__hashtable) + (weechat_plugin->hashtable_dup)(__hashtable) #define weechat_hashtable_get_integer(__hashtable, __property) \ - weechat_plugin->hashtable_get_integer(__hashtable, __property) + (weechat_plugin->hashtable_get_integer)(__hashtable, __property) #define weechat_hashtable_get_string(__hashtable, __property) \ - weechat_plugin->hashtable_get_string(__hashtable, __property) + (weechat_plugin->hashtable_get_string)(__hashtable, __property) #define weechat_hashtable_set_pointer(__hashtable, __property, \ __pointer) \ - weechat_plugin->hashtable_set_pointer(__hashtable, __property, \ - __pointer) + (weechat_plugin->hashtable_set_pointer)(__hashtable, __property, \ + __pointer) #define weechat_hashtable_add_to_infolist(__hashtable, __infolist_item, \ __prefix) \ - weechat_plugin->hashtable_add_to_infolist(__hashtable, \ - __infolist_item, \ - __prefix) + (weechat_plugin->hashtable_add_to_infolist)(__hashtable, \ + __infolist_item, \ + __prefix) #define weechat_hashtable_remove(__hashtable, __key) \ - weechat_plugin->hashtable_remove(__hashtable, __key) + (weechat_plugin->hashtable_remove)(__hashtable, __key) #define weechat_hashtable_remove_all(__hashtable) \ - weechat_plugin->hashtable_remove_all(__hashtable) + (weechat_plugin->hashtable_remove_all)(__hashtable) #define weechat_hashtable_free(__hashtable) \ - weechat_plugin->hashtable_free(__hashtable) + (weechat_plugin->hashtable_free)(__hashtable) /* config files */ #define weechat_config_new(__name, __callback_reload, \ __callback_reload_data) \ - weechat_plugin->config_new(weechat_plugin, __name, \ - __callback_reload, \ - __callback_reload_data) + (weechat_plugin->config_new)(weechat_plugin, __name, \ + __callback_reload, \ + __callback_reload_data) #define weechat_config_new_section(__config, __name, \ __user_can_add_options, \ __user_can_delete_options, \ @@ -1214,20 +1217,20 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); __cb_create_option_data, \ __cb_delete_option, \ __cb_delete_option_data) \ - weechat_plugin->config_new_section(__config, __name, \ - __user_can_add_options, \ - __user_can_delete_options, \ - __cb_read, __cb_read_data, \ - __cb_write_std, \ - __cb_write_std_data, \ - __cb_write_def, \ - __cb_write_def_data, \ - __cb_create_option, \ - __cb_create_option_data, \ - __cb_delete_option, \ - __cb_delete_option_data) + (weechat_plugin->config_new_section)(__config, __name, \ + __user_can_add_options, \ + __user_can_delete_options, \ + __cb_read, __cb_read_data, \ + __cb_write_std, \ + __cb_write_std_data, \ + __cb_write_def, \ + __cb_write_def_data, \ + __cb_create_option, \ + __cb_create_option_data, \ + __cb_delete_option, \ + __cb_delete_option_data) #define weechat_config_search_section(__config, __name) \ - weechat_plugin->config_search_section(__config, __name) + (weechat_plugin->config_search_section)(__config, __name) #define weechat_config_new_option(__config, __section, __name, __type, \ __desc, __string_values, __min, \ __max, __default, __value, \ @@ -1238,207 +1241,213 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); __callback_change_data, \ __callback_delete, \ __callback_delete_data) \ - weechat_plugin->config_new_option(__config, __section, __name, \ - __type, __desc, __string_values, \ - __min, __max, __default, __value, \ - __null_value_allowed, \ - __callback_check, \ - __callback_check_data, \ - __callback_change, \ - __callback_change_data, \ - __callback_delete, \ - __callback_delete_data) + (weechat_plugin->config_new_option)(__config, __section, __name, \ + __type, __desc, \ + __string_values, \ + __min, __max, __default, \ + __value, \ + __null_value_allowed, \ + __callback_check, \ + __callback_check_data, \ + __callback_change, \ + __callback_change_data, \ + __callback_delete, \ + __callback_delete_data) #define weechat_config_search_option(__config, __section, __name) \ - weechat_plugin->config_search_option(__config, __section, __name) + (weechat_plugin->config_search_option)(__config, __section, __name) #define weechat_config_search_section_option(__config, __section, \ __name, __section_found, \ __option_found) \ - weechat_plugin->config_search_section_option(__config, __section, \ - __name, \ - __section_found, \ - __option_found); + (weechat_plugin->config_search_section_option)(__config, __section, \ + __name, \ + __section_found, \ + __option_found); #define weechat_config_search_with_string(__name, __config, __section, \ __option, __pos_option) \ - weechat_plugin->config_search_with_string(__name, __config, \ - __section, __option, \ - __pos_option); + (weechat_plugin->config_search_with_string)(__name, __config, \ + __section, __option, \ + __pos_option); #define weechat_config_string_to_boolean(__string) \ - weechat_plugin->config_string_to_boolean(__string) + (weechat_plugin->config_string_to_boolean)(__string) #define weechat_config_option_reset(__option, __run_callback) \ - weechat_plugin->config_option_reset(__option, __run_callback) + (weechat_plugin->config_option_reset)(__option, __run_callback) #define weechat_config_option_set(__option, __value, __run_callback) \ - weechat_plugin->config_option_set(__option, __value, \ - __run_callback) + (weechat_plugin->config_option_set)(__option, __value, \ + __run_callback) #define weechat_config_option_set_null(__option, __run_callback) \ - weechat_plugin->config_option_set_null(__option, __run_callback) + (weechat_plugin->config_option_set_null)(__option, __run_callback) #define weechat_config_option_unset(__option) \ - weechat_plugin->config_option_unset(__option) + (weechat_plugin->config_option_unset)(__option) #define weechat_config_option_rename(__option, __new_name) \ - weechat_plugin->config_option_rename(__option, __new_name) + (weechat_plugin->config_option_rename)(__option, __new_name) #define weechat_config_option_get_pointer(__option, __property) \ - weechat_plugin->config_option_get_pointer(__option, __property) + (weechat_plugin->config_option_get_pointer)(__option, __property) #define weechat_config_option_is_null(__option) \ - weechat_plugin->config_option_is_null(__option) + (weechat_plugin->config_option_is_null)(__option) #define weechat_config_option_default_is_null(__option) \ - weechat_plugin->config_option_default_is_null(__option) + (weechat_plugin->config_option_default_is_null)(__option) #define weechat_config_boolean(__option) \ - weechat_plugin->config_boolean(__option) + (weechat_plugin->config_boolean)(__option) #define weechat_config_boolean_default(__option) \ - weechat_plugin->config_boolean_default(__option) + (weechat_plugin->config_boolean_default)(__option) #define weechat_config_integer(__option) \ - weechat_plugin->config_integer(__option) + (weechat_plugin->config_integer)(__option) #define weechat_config_integer_default(__option) \ - weechat_plugin->config_integer_default(__option) + (weechat_plugin->config_integer_default)(__option) #define weechat_config_string(__option) \ - weechat_plugin->config_string(__option) + (weechat_plugin->config_string)(__option) #define weechat_config_string_default(__option) \ - weechat_plugin->config_string_default(__option) + (weechat_plugin->config_string_default)(__option) #define weechat_config_color(__option) \ - weechat_plugin->config_color(__option) + (weechat_plugin->config_color)(__option) #define weechat_config_color_default(__option) \ - weechat_plugin->config_color_default(__option) + (weechat_plugin->config_color_default)(__option) #define weechat_config_write_option(__config, __option) \ - weechat_plugin->config_write_option(__config, __option) + (weechat_plugin->config_write_option)(__config, __option) #define weechat_config_write_line(__config, __option, __value...) \ - weechat_plugin->config_write_line(__config, __option, ##__value) + (weechat_plugin->config_write_line)(__config, __option, ##__value) #define weechat_config_write(__config) \ - weechat_plugin->config_write(__config) + (weechat_plugin->config_write)(__config) #define weechat_config_read(__config) \ - weechat_plugin->config_read(__config) + (weechat_plugin->config_read)(__config) #define weechat_config_reload(__config) \ - weechat_plugin->config_reload(__config) + (weechat_plugin->config_reload)(__config) #define weechat_config_option_free(__option) \ - weechat_plugin->config_option_free(__option) + (weechat_plugin->config_option_free)(__option) #define weechat_config_section_free_options(__section) \ - weechat_plugin->config_section_free_options(__section) + (weechat_plugin->config_section_free_options)(__section) #define weechat_config_section_free(__section) \ - weechat_plugin->config_section_free(__section) + (weechat_plugin->config_section_free)(__section) #define weechat_config_free(__config) \ - weechat_plugin->config_free(__config) + (weechat_plugin->config_free)(__config) #define weechat_config_get(__option) \ - weechat_plugin->config_get(__option) + (weechat_plugin->config_get)(__option) #define weechat_config_get_plugin(__option) \ - weechat_plugin->config_get_plugin(weechat_plugin, __option) + (weechat_plugin->config_get_plugin)(weechat_plugin, __option) #define weechat_config_is_set_plugin(__option) \ - weechat_plugin->config_is_set_plugin(weechat_plugin, __option) + (weechat_plugin->config_is_set_plugin)(weechat_plugin, __option) #define weechat_config_set_plugin(__option, __value) \ - weechat_plugin->config_set_plugin(weechat_plugin, __option, \ - __value) + (weechat_plugin->config_set_plugin)(weechat_plugin, __option, \ + __value) #define weechat_config_set_desc_plugin(__option, __description) \ - weechat_plugin->config_set_desc_plugin(weechat_plugin, __option, \ - __description) + (weechat_plugin->config_set_desc_plugin)(weechat_plugin, __option, \ + __description) #define weechat_config_unset_plugin(__option) \ - weechat_plugin->config_unset_plugin(weechat_plugin, __option) + (weechat_plugin->config_unset_plugin)(weechat_plugin, __option) /* key bindings */ #define weechat_key_bind(__context, __keys) \ - weechat_plugin->key_bind(__context, __keys) + (weechat_plugin->key_bind)(__context, __keys) #define weechat_key_unbind(__context, __key) \ - weechat_plugin->key_unbind(__context, __key) + (weechat_plugin->key_unbind)(__context, __key) /* display */ #define weechat_prefix(__prefix) \ - weechat_plugin->prefix(__prefix) + (weechat_plugin->prefix)(__prefix) #define weechat_color(__color_name) \ - weechat_plugin->color(__color_name) + (weechat_plugin->color)(__color_name) #define weechat_printf(__buffer, __message, __argz...) \ - weechat_plugin->printf_date_tags(__buffer, 0, NULL, __message, \ - ##__argz) + (weechat_plugin->printf_date_tags)(__buffer, 0, NULL, __message, \ + ##__argz) #define weechat_printf_date(__buffer, __date, __message, __argz...) \ - weechat_plugin->printf_date_tags(__buffer, __date, NULL, \ - __message, ##__argz) + (weechat_plugin->printf_date_tags)(__buffer, __date, NULL, \ + __message, ##__argz) #define weechat_printf_tags(__buffer, __tags, __message, __argz...) \ - weechat_plugin->printf_date_tags(__buffer, 0, __tags, __message, \ - ##__argz) + (weechat_plugin->printf_date_tags)(__buffer, 0, __tags, __message, \ + ##__argz) #define weechat_printf_date_tags(__buffer, __date, __tags, __message, \ __argz...) \ - weechat_plugin->printf_date_tags(__buffer, __date, __tags, \ - __message, ##__argz) + (weechat_plugin->printf_date_tags)(__buffer, __date, __tags, \ + __message, ##__argz) #define weechat_printf_y(__buffer, __y, __message, __argz...) \ - weechat_plugin->printf_y(__buffer, __y, __message, ##__argz) + (weechat_plugin->printf_y)(__buffer, __y, __message, ##__argz) #define weechat_log_printf(__message, __argz...) \ - weechat_plugin->log_printf(__message, ##__argz) + (weechat_plugin->log_printf)(__message, ##__argz) /* hooks */ #define weechat_hook_command(__command, __description, __args, \ __args_desc, __completion, __callback, \ __data) \ - weechat_plugin->hook_command(weechat_plugin, __command, \ - __description, __args, __args_desc, \ - __completion, __callback, __data) + (weechat_plugin->hook_command)(weechat_plugin, __command, \ + __description, __args, __args_desc, \ + __completion, __callback, __data) #define weechat_hook_command_run(__command, __callback, __data) \ - weechat_plugin->hook_command_run(weechat_plugin, __command, \ - __callback, __data) + (weechat_plugin->hook_command_run)(weechat_plugin, __command, \ + __callback, __data) #define weechat_hook_timer(__interval, __align_second, __max_calls, \ __callback, __data) \ - weechat_plugin->hook_timer(weechat_plugin, __interval, \ - __align_second, __max_calls, \ - __callback, __data) + (weechat_plugin->hook_timer)(weechat_plugin, __interval, \ + __align_second, __max_calls, \ + __callback, __data) #define weechat_hook_fd(__fd, __flag_read, __flag_write, \ __flag_exception, __callback, __data) \ - weechat_plugin->hook_fd(weechat_plugin, __fd, __flag_read, \ - __flag_write, __flag_exception, __callback, \ - __data) + (weechat_plugin->hook_fd)(weechat_plugin, __fd, __flag_read, \ + __flag_write, __flag_exception, \ + __callback, __data) #define weechat_hook_process(__command, __timeout, __callback, \ __callback_data) \ - weechat_plugin->hook_process(weechat_plugin, __command, __timeout, \ - __callback, __callback_data) + (weechat_plugin->hook_process)(weechat_plugin, __command, \ + __timeout, __callback, \ + __callback_data) #define weechat_hook_process_hashtable(__command, __options, __timeout, \ __callback, __callback_data) \ - weechat_plugin->hook_process_hashtable(weechat_plugin, __command, \ - __options, __timeout, \ - __callback, __callback_data) + (weechat_plugin->hook_process_hashtable)(weechat_plugin, __command, \ + __options, __timeout, \ + __callback, \ + __callback_data) #define weechat_hook_connect(__proxy, __address, __port, __ipv6, \ __retry, __gnutls_sess, __gnutls_cb, \ __gnutls_dhkey_size, __gnutls_priorities, \ __local_hostname, __callback, __data) \ - weechat_plugin->hook_connect(weechat_plugin, __proxy, __address, \ - __port, __ipv6, __retry, \ - __gnutls_sess, __gnutls_cb, \ - __gnutls_dhkey_size, \ - __gnutls_priorities, __local_hostname, \ - __callback, __data) + (weechat_plugin->hook_connect)(weechat_plugin, __proxy, __address, \ + __port, __ipv6, __retry, \ + __gnutls_sess, __gnutls_cb, \ + __gnutls_dhkey_size, \ + __gnutls_priorities, \ + __local_hostname, \ + __callback, __data) #define weechat_hook_print(__buffer, __tags, __msg, __strip__colors, \ __callback, __data) \ - weechat_plugin->hook_print(weechat_plugin, __buffer, __tags, \ - __msg, __strip__colors, __callback, \ - __data) + (weechat_plugin->hook_print)(weechat_plugin, __buffer, __tags, \ + __msg, __strip__colors, __callback, \ + __data) #define weechat_hook_signal(__signal, __callback, __data) \ - weechat_plugin->hook_signal(weechat_plugin, __signal, __callback, \ - __data) + (weechat_plugin->hook_signal)(weechat_plugin, __signal, __callback, \ + __data) #define weechat_hook_signal_send(__signal, __type_data, __signal_data) \ - weechat_plugin->hook_signal_send(__signal, __type_data, \ - __signal_data) + (weechat_plugin->hook_signal_send)(__signal, __type_data, \ + __signal_data) #define weechat_hook_hsignal(__signal, __callback, __data) \ - weechat_plugin->hook_hsignal(weechat_plugin, __signal, __callback, \ - __data) + (weechat_plugin->hook_hsignal)(weechat_plugin, __signal, \ + __callback, __data) #define weechat_hook_hsignal_send(__signal, __hashtable) \ - weechat_plugin->hook_hsignal_send(__signal, __hashtable) + (weechat_plugin->hook_hsignal_send)(__signal, __hashtable) #define weechat_hook_config(__option, __callback, __data) \ - weechat_plugin->hook_config(weechat_plugin, __option, __callback, \ - __data) + (weechat_plugin->hook_config)(weechat_plugin, __option, __callback, \ + __data) #define weechat_hook_completion(__completion, __description, \ __callback, __data) \ - weechat_plugin->hook_completion(weechat_plugin, __completion, \ - __description, __callback, __data) + (weechat_plugin->hook_completion)(weechat_plugin, __completion, \ + __description, __callback, \ + __data) #define weechat_hook_completion_get_string(__completion, __property) \ - weechat_plugin->hook_completion_get_string(__completion, \ - __property) + (weechat_plugin->hook_completion_get_string)(__completion, \ + __property) #define weechat_hook_completion_list_add(__completion, __word, \ __nick_completion, __where) \ - weechat_plugin->hook_completion_list_add(__completion, __word, \ - __nick_completion, \ - __where) + (weechat_plugin->hook_completion_list_add)(__completion, __word, \ + __nick_completion, \ + __where) #define weechat_hook_modifier(__modifier, __callback, __data) \ - weechat_plugin->hook_modifier(weechat_plugin, __modifier, \ - __callback, __data) + (weechat_plugin->hook_modifier)(weechat_plugin, __modifier, \ + __callback, __data) #define weechat_hook_modifier_exec(__modifier, __modifier_data, \ __string) \ - weechat_plugin->hook_modifier_exec(weechat_plugin, __modifier, \ - __modifier_data, __string) + (weechat_plugin->hook_modifier_exec)(weechat_plugin, __modifier, \ + __modifier_data, __string) #define weechat_hook_info(__info_name, __description, \ __args_description, __callback, __data) \ - weechat_plugin->hook_info(weechat_plugin, __info_name, \ + (weechat_plugin->hook_info)(weechat_plugin, __info_name, \ __description, __args_description, \ __callback, __data) #define weechat_hook_info_hashtable(__info_name, __description, \ @@ -1446,316 +1455,328 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); __output_description, \ __callback, \ __data) \ - weechat_plugin->hook_info_hashtable(weechat_plugin, __info_name, \ - __description, \ - __args_description, \ - __output_description, \ - __callback, __data) + (weechat_plugin->hook_info_hashtable)(weechat_plugin, __info_name, \ + __description, \ + __args_description, \ + __output_description, \ + __callback, __data) #define weechat_hook_infolist(__infolist_name, __description, \ __pointer_description, \ __args_description, __callback, __data) \ - weechat_plugin->hook_infolist(weechat_plugin, __infolist_name, \ - __description, __pointer_description, \ - __args_description, __callback, \ - __data) + (weechat_plugin->hook_infolist)(weechat_plugin, __infolist_name, \ + __description, \ + __pointer_description, \ + __args_description, __callback, \ + __data) #define weechat_hook_hdata(__hdata_name, __description, __callback, \ __data) \ - weechat_plugin->hook_hdata(weechat_plugin, __hdata_name, \ - __description, __callback, __data) + (weechat_plugin->hook_hdata)(weechat_plugin, __hdata_name, \ + __description, __callback, __data) #define weechat_hook_focus(__area, __callback, __data) \ - weechat_plugin->hook_focus(weechat_plugin, __area, __callback, \ - __data) + (weechat_plugin->hook_focus)(weechat_plugin, __area, __callback, \ + __data) #define weechat_hook_set(__hook, __property, __value) \ - weechat_plugin->hook_set(__hook, __property, __value) + (weechat_plugin->hook_set)(__hook, __property, __value) #define weechat_unhook(__hook) \ - weechat_plugin->unhook( __hook) + (weechat_plugin->unhook)( __hook) #define weechat_unhook_all() \ - weechat_plugin->unhook_all_plugin(weechat_plugin) + (weechat_plugin->unhook_all_plugin)(weechat_plugin) /* buffers */ #define weechat_buffer_new(__name, __input_callback, \ __input_callback_data, __close_callback, \ __close_callback_data) \ - weechat_plugin->buffer_new(weechat_plugin, __name, \ - __input_callback, __input_callback_data, \ - __close_callback, __close_callback_data) + (weechat_plugin->buffer_new)(weechat_plugin, __name, \ + __input_callback, \ + __input_callback_data, \ + __close_callback, \ + __close_callback_data) #define weechat_buffer_search(__plugin, __name) \ - weechat_plugin->buffer_search(__plugin, __name) + (weechat_plugin->buffer_search)(__plugin, __name) #define weechat_buffer_search_main() \ - weechat_plugin->buffer_search_main() + (weechat_plugin->buffer_search_main)() #define weechat_current_buffer() \ - weechat_plugin->buffer_search(NULL, NULL) + (weechat_plugin->buffer_search)(NULL, NULL) #define weechat_buffer_clear(__buffer) \ - weechat_plugin->buffer_clear(__buffer) + (weechat_plugin->buffer_clear)(__buffer) #define weechat_buffer_close(__buffer) \ - weechat_plugin->buffer_close(__buffer) + (weechat_plugin->buffer_close)(__buffer) #define weechat_buffer_merge(__buffer, __target_buffer) \ - weechat_plugin->buffer_merge(__buffer, __target_buffer) + (weechat_plugin->buffer_merge)(__buffer, __target_buffer) #define weechat_buffer_unmerge(__buffer, __number) \ - weechat_plugin->buffer_unmerge(__buffer, __number) + (weechat_plugin->buffer_unmerge)(__buffer, __number) #define weechat_buffer_get_integer(__buffer, __property) \ - weechat_plugin->buffer_get_integer(__buffer, __property) + (weechat_plugin->buffer_get_integer)(__buffer, __property) #define weechat_buffer_get_string(__buffer, __property) \ - weechat_plugin->buffer_get_string(__buffer, __property) + (weechat_plugin->buffer_get_string)(__buffer, __property) #define weechat_buffer_get_pointer(__buffer, __property) \ - weechat_plugin->buffer_get_pointer(__buffer, __property) + (weechat_plugin->buffer_get_pointer)(__buffer, __property) #define weechat_buffer_set(__buffer, __property, __value) \ - weechat_plugin->buffer_set(__buffer, __property, __value) + (weechat_plugin->buffer_set)(__buffer, __property, __value) #define weechat_buffer_set_pointer(__buffer, __property, __pointer) \ - weechat_plugin->buffer_set_pointer(__buffer, __property, __pointer) + (weechat_plugin->buffer_set_pointer)(__buffer, __property, \ + __pointer) #define weechat_buffer_string_replace_local_var(__buffer, __string) \ - weechat_plugin->buffer_string_replace_local_var(__buffer, __string) + (weechat_plugin->buffer_string_replace_local_var)(__buffer, \ + __string) #define weechat_buffer_match_list(__buffer, __string) \ - weechat_plugin->buffer_match_list(__buffer, __string) + (weechat_plugin->buffer_match_list)(__buffer, __string) /* windows */ #define weechat_window_search_with_buffer(__buffer) \ - weechat_plugin->window_search_with_buffer(__buffer) + (weechat_plugin->window_search_with_buffer)(__buffer) #define weechat_window_get_integer(__window, __property) \ - weechat_plugin->window_get_integer(__window, __property) + (weechat_plugin->window_get_integer)(__window, __property) #define weechat_window_get_string(__window, __property) \ - weechat_plugin->window_get_string(__window, __property) + (weechat_plugin->window_get_string)(__window, __property) #define weechat_window_get_pointer(__window, __property) \ - weechat_plugin->window_get_pointer(__window, __property) + (weechat_plugin->window_get_pointer)(__window, __property) #define weechat_current_window() \ - weechat_plugin->window_get_pointer(NULL, "current") + (weechat_plugin->window_get_pointer)(NULL, "current") #define weechat_window_set_title(__title) \ - weechat_plugin->window_set_title(__title) + (weechat_plugin->window_set_title)(__title) /* nicklist */ #define weechat_nicklist_add_group(__buffer, __parent_group, __name, \ __color, __visible) \ - weechat_plugin->nicklist_add_group(__buffer, __parent_group, \ - __name, __color, __visible) + (weechat_plugin->nicklist_add_group)(__buffer, __parent_group, \ + __name, __color, __visible) #define weechat_nicklist_search_group(__buffer, __from_group, __name) \ - weechat_plugin->nicklist_search_group(__buffer, __from_group, \ - __name) + (weechat_plugin->nicklist_search_group)(__buffer, __from_group, \ + __name) #define weechat_nicklist_add_nick(__buffer, __group, __name, __color, \ __prefix, __prefix_color, __visible) \ - weechat_plugin->nicklist_add_nick(__buffer, __group, __name, \ - __color, __prefix, \ - __prefix_color, __visible) + (weechat_plugin->nicklist_add_nick)(__buffer, __group, __name, \ + __color, __prefix, \ + __prefix_color, __visible) #define weechat_nicklist_search_nick(__buffer, __from_group, __name) \ - weechat_plugin->nicklist_search_nick(__buffer, __from_group, \ - __name) + (weechat_plugin->nicklist_search_nick)(__buffer, __from_group, \ + __name) #define weechat_nicklist_remove_group(__buffer, __group) \ - weechat_plugin->nicklist_remove_group(__buffer, __group) + (weechat_plugin->nicklist_remove_group)(__buffer, __group) #define weechat_nicklist_remove_nick(__buffer, __nick) \ - weechat_plugin->nicklist_remove_nick(__buffer, __nick) + (weechat_plugin->nicklist_remove_nick)(__buffer, __nick) #define weechat_nicklist_remove_all(__buffer) \ - weechat_plugin->nicklist_remove_all(__buffer) + (weechat_plugin->nicklist_remove_all)(__buffer) #define weechat_nicklist_get_next_item(__buffer, __group, __nick) \ - weechat_plugin->nicklist_get_next_item(__buffer, __group, __nick) + (weechat_plugin->nicklist_get_next_item)(__buffer, __group, __nick) #define weechat_nicklist_group_get_integer(__buffer, __group, \ __property) \ - weechat_plugin->nicklist_group_get_integer(__buffer, __group, \ - __property) + (weechat_plugin->nicklist_group_get_integer)(__buffer, __group, \ + __property) #define weechat_nicklist_group_get_string(__buffer, __group, \ __property) \ - weechat_plugin->nicklist_group_get_string(__buffer, __group, \ - __property) + (weechat_plugin->nicklist_group_get_string)(__buffer, __group, \ + __property) #define weechat_nicklist_group_get_pointer(__buffer, __group, \ __property) \ - weechat_plugin->nicklist_group_get_pointer(__buffer, __group, \ - __property) + (weechat_plugin->nicklist_group_get_pointer)(__buffer, __group, \ + __property) #define weechat_nicklist_group_set(__buffer, __group, __property, \ __value) \ - weechat_plugin->nicklist_group_set(__buffer, __group, __property, \ - __value) + (weechat_plugin->nicklist_group_set)(__buffer, __group, __property, \ + __value) #define weechat_nicklist_nick_get_integer(__buffer, __nick, __property) \ - weechat_plugin->nicklist_nick_get_integer(__buffer, __nick, \ - __property) + (weechat_plugin->nicklist_nick_get_integer)(__buffer, __nick, \ + __property) #define weechat_nicklist_nick_get_string(__buffer, __nick, __property) \ - weechat_plugin->nicklist_nick_get_string(__buffer, __nick, \ - __property) + (weechat_plugin->nicklist_nick_get_string)(__buffer, __nick, \ + __property) #define weechat_nicklist_nick_get_pointer(__buffer, __nick, __property) \ - weechat_plugin->nicklist_nick_get_pointer(__buffer, __nick, \ - __property) + (weechat_plugin->nicklist_nick_get_pointer)(__buffer, __nick, \ + __property) #define weechat_nicklist_nick_set(__buffer, __nick, __property, \ __value) \ - weechat_plugin->nicklist_nick_set(__buffer, __nick, __property, \ - __value) + (weechat_plugin->nicklist_nick_set)(__buffer, __nick, __property, \ + __value) /* bars */ #define weechat_bar_item_search(__name) \ - weechat_plugin->bar_item_search(__name) + (weechat_plugin->bar_item_search)(__name) #define weechat_bar_item_new(__name, __build_callback, __data) \ - weechat_plugin->bar_item_new(weechat_plugin, __name, \ - __build_callback, __data) + (weechat_plugin->bar_item_new)(weechat_plugin, __name, \ + __build_callback, __data) #define weechat_bar_item_update(__name) \ - weechat_plugin->bar_item_update(__name) + (weechat_plugin->bar_item_update)(__name) #define weechat_bar_item_remove(__item) \ - weechat_plugin->bar_item_remove(__item) + (weechat_plugin->bar_item_remove)(__item) #define weechat_bar_search(__name) \ - weechat_plugin->bar_search(__name) + (weechat_plugin->bar_search)(__name) #define weechat_bar_new(__name, __hidden, __priority, __type, \ __condition, __position, __filling_top_bottom, \ __filling_left_right, __size, __size_max, \ __color_fg, __color_delim, __color_bg, \ __separator, __items) \ - weechat_plugin->bar_new(__name, __hidden, __priority, __type, \ - __condition, __position, \ - __filling_top_bottom, __filling_left_right, \ - __size, __size_max, __color_fg, \ - __color_delim, __color_bg, __separator, \ - __items) + (weechat_plugin->bar_new)(__name, __hidden, __priority, __type, \ + __condition, __position, \ + __filling_top_bottom, \ + __filling_left_right, \ + __size, __size_max, __color_fg, \ + __color_delim, __color_bg, __separator, \ + __items) #define weechat_bar_set(__bar, __property, __value) \ - weechat_plugin->bar_set(__bar, __property, __value) + (weechat_plugin->bar_set)(__bar, __property, __value) #define weechat_bar_update(__name) \ - weechat_plugin->bar_update(__name) + (weechat_plugin->bar_update)(__name) #define weechat_bar_remove(__bar) \ - weechat_plugin->bar_remove(__bar) + (weechat_plugin->bar_remove)(__bar) /* command */ #define weechat_command(__buffer, __command) \ - weechat_plugin->command(weechat_plugin, __buffer, __command) + (weechat_plugin->command)(weechat_plugin, __buffer, __command) /* network */ #define weechat_network_pass_proxy(__proxy, __sock, __address, __port) \ - weechat_plugin->network_pass_proxy(__proxy, __sock, __address, \ - __port) + (weechat_plugin->network_pass_proxy)(__proxy, __sock, __address, \ + __port) #define weechat_network_connect_to(__proxy, __address, \ __address_length) \ - weechat_plugin->network_connect_to(__proxy, __address, \ - __address_length) + (weechat_plugin->network_connect_to)(__proxy, __address, \ + __address_length) /* infos */ #define weechat_info_get(__info_name, __arguments) \ - weechat_plugin->info_get(weechat_plugin, __info_name, __arguments) + (weechat_plugin->info_get)(weechat_plugin, __info_name, \ + __arguments) #define weechat_info_get_hashtable(__info_name, __hashtable) \ - weechat_plugin->info_get_hashtable(weechat_plugin, __info_name, \ - __hashtable) + (weechat_plugin->info_get_hashtable)(weechat_plugin, __info_name, \ + __hashtable) /* infolists */ #define weechat_infolist_new() \ - weechat_plugin->infolist_new(weechat_plugin) + (weechat_plugin->infolist_new)(weechat_plugin) #define weechat_infolist_new_item(__list) \ - weechat_plugin->infolist_new_item(__list) + (weechat_plugin->infolist_new_item)(__list) #define weechat_infolist_new_var_integer(__item, __name, __value) \ - weechat_plugin->infolist_new_var_integer(__item, __name, __value) + (weechat_plugin->infolist_new_var_integer)(__item, __name, __value) #define weechat_infolist_new_var_string(__item, __name, __value) \ - weechat_plugin->infolist_new_var_string(__item, __name, __value) + (weechat_plugin->infolist_new_var_string)(__item, __name, __value) #define weechat_infolist_new_var_pointer(__item, __name, __pointer) \ - weechat_plugin->infolist_new_var_pointer(__item, __name, __pointer) + (weechat_plugin->infolist_new_var_pointer)(__item, __name, \ + __pointer) #define weechat_infolist_new_var_buffer(__item, __name, __buffer, \ __size) \ - weechat_plugin->infolist_new_var_buffer(__item, __name, __buffer, \ - __size) + (weechat_plugin->infolist_new_var_buffer)(__item, __name, __buffer, \ + __size) #define weechat_infolist_new_var_time(__item, __name, __time) \ - weechat_plugin->infolist_new_var_time(__item, __name, __time) + (weechat_plugin->infolist_new_var_time)(__item, __name, __time) #define weechat_infolist_search_var(__list, __name) \ - weechat_plugin->infolist_search_var(__list, __name) + (weechat_plugin->infolist_search_var)(__list, __name) #define weechat_infolist_get(__infolist_name, __pointer, __arguments) \ - weechat_plugin->infolist_get(weechat_plugin, __infolist_name, \ - __pointer, __arguments) + (weechat_plugin->infolist_get)(weechat_plugin, __infolist_name, \ + __pointer, __arguments) #define weechat_infolist_next(__list) \ - weechat_plugin->infolist_next(__list) + (weechat_plugin->infolist_next)(__list) #define weechat_infolist_prev(__list) \ - weechat_plugin->infolist_prev(__list) + (weechat_plugin->infolist_prev)(__list) #define weechat_infolist_reset_item_cursor(__list) \ - weechat_plugin->infolist_reset_item_cursor(__list) + (weechat_plugin->infolist_reset_item_cursor)(__list) #define weechat_infolist_fields(__list) \ - weechat_plugin->infolist_fields(__list) + (weechat_plugin->infolist_fields)(__list) #define weechat_infolist_integer(__item, __var) \ - weechat_plugin->infolist_integer(__item, __var) + (weechat_plugin->infolist_integer)(__item, __var) #define weechat_infolist_string(__item, __var) \ - weechat_plugin->infolist_string(__item, __var) + (weechat_plugin->infolist_string)(__item, __var) #define weechat_infolist_pointer(__item, __var) \ - weechat_plugin->infolist_pointer(__item, __var) + (weechat_plugin->infolist_pointer)(__item, __var) #define weechat_infolist_buffer(__item, __var, __size) \ - weechat_plugin->infolist_buffer(__item, __var, __size) + (weechat_plugin->infolist_buffer)(__item, __var, __size) #define weechat_infolist_time(__item, __var) \ - weechat_plugin->infolist_time(__item, __var) + (weechat_plugin->infolist_time)(__item, __var) #define weechat_infolist_free(__list) \ - weechat_plugin->infolist_free(__list) + (weechat_plugin->infolist_free)(__list) /* hdata */ #define weechat_hdata_new(__hdata_name, __var_prev, __var_next, \ __create_allowed, __delete_allowed, \ __callback_update, __callback_update_data) \ - weechat_plugin->hdata_new(weechat_plugin, __hdata_name, __var_prev, \ - __var_next, __create_allowed, \ - __delete_allowed, __callback_update, \ - __callback_update_data) + (weechat_plugin->hdata_new)(weechat_plugin, __hdata_name, \ + __var_prev, __var_next, \ + __create_allowed, __delete_allowed, \ + __callback_update, \ + __callback_update_data) #define weechat_hdata_new_var(__hdata, __name, __offset, __type, \ __update_allowed, __array_size, \ __hdata_name) \ - weechat_plugin->hdata_new_var(__hdata, __name, __offset, __type, \ - __update_allowed, __array_size, \ - __hdata_name) + (weechat_plugin->hdata_new_var)(__hdata, __name, __offset, __type, \ + __update_allowed, __array_size, \ + __hdata_name) #define WEECHAT_HDATA_VAR(__struct, __name, __type, __update_allowed, \ __array_size, __hdata_name) \ weechat_hdata_new_var (hdata, #__name, offsetof (__struct, __name), \ WEECHAT_HDATA_##__type, __update_allowed, \ __array_size, __hdata_name) #define weechat_hdata_new_list(__hdata, __name, __pointer, __flags) \ - weechat_plugin->hdata_new_list(__hdata, __name, __pointer, __flags) + (weechat_plugin->hdata_new_list)(__hdata, __name, __pointer, \ + __flags) #define WEECHAT_HDATA_LIST(__name, __flags) \ weechat_hdata_new_list (hdata, #__name, &(__name), __flags); #define weechat_hdata_get(__hdata_name) \ - weechat_plugin->hdata_get(weechat_plugin, __hdata_name) + (weechat_plugin->hdata_get)(weechat_plugin, __hdata_name) #define weechat_hdata_get_var_offset(__hdata, __name) \ - weechat_plugin->hdata_get_var_offset(__hdata, __name) + (weechat_plugin->hdata_get_var_offset)(__hdata, __name) #define weechat_hdata_get_var_type(__hdata, __name) \ - weechat_plugin->hdata_get_var_type(__hdata, __name) + (weechat_plugin->hdata_get_var_type)(__hdata, __name) #define weechat_hdata_get_var_type_string(__hdata, __name) \ - weechat_plugin->hdata_get_var_type_string(__hdata, __name) + (weechat_plugin->hdata_get_var_type_string)(__hdata, __name) #define weechat_hdata_get_var_array_size(__hdata, __pointer, __name) \ - weechat_plugin->hdata_get_var_array_size(__hdata, __pointer, \ - __name) + (weechat_plugin->hdata_get_var_array_size)(__hdata, __pointer, \ + __name) #define weechat_hdata_get_var_array_size_string(__hdata, __pointer, \ __name) \ - weechat_plugin->hdata_get_var_array_size_string(__hdata, __pointer, \ - __name) + (weechat_plugin->hdata_get_var_array_size_string)(__hdata, \ + __pointer, \ + __name) #define weechat_hdata_get_var_hdata(__hdata, __name) \ - weechat_plugin->hdata_get_var_hdata(__hdata, __name) + (weechat_plugin->hdata_get_var_hdata)(__hdata, __name) #define weechat_hdata_get_var(__hdata, __pointer, __name) \ - weechat_plugin->hdata_get_var(__hdata, __pointer, __name) + (weechat_plugin->hdata_get_var)(__hdata, __pointer, __name) #define weechat_hdata_get_var_at_offset(__hdata, __pointer, __offset) \ - weechat_plugin->hdata_get_var_at_offset(__hdata, __pointer, \ - __offset) + (weechat_plugin->hdata_get_var_at_offset)(__hdata, __pointer, \ + __offset) #define weechat_hdata_get_list(__hdata, __name) \ - weechat_plugin->hdata_get_list(__hdata, __name) + (weechat_plugin->hdata_get_list)(__hdata, __name) #define weechat_hdata_check_pointer(__hdata, __list, __pointer) \ - weechat_plugin->hdata_check_pointer(__hdata, __list, __pointer) + (weechat_plugin->hdata_check_pointer)(__hdata, __list, __pointer) #define weechat_hdata_move(__hdata, __pointer, __count) \ - weechat_plugin->hdata_move(__hdata, __pointer, __count) + (weechat_plugin->hdata_move)(__hdata, __pointer, __count) #define weechat_hdata_search(__hdata, __pointer, __search, __move) \ - weechat_plugin->hdata_search(__hdata, __pointer, __search, __move) + (weechat_plugin->hdata_search)(__hdata, __pointer, __search, \ + __move) #define weechat_hdata_char(__hdata, __pointer, __name) \ - weechat_plugin->hdata_char(__hdata, __pointer, __name) + (weechat_plugin->hdata_char)(__hdata, __pointer, __name) #define weechat_hdata_integer(__hdata, __pointer, __name) \ - weechat_plugin->hdata_integer(__hdata, __pointer, __name) + (weechat_plugin->hdata_integer)(__hdata, __pointer, __name) #define weechat_hdata_long(__hdata, __pointer, __name) \ - weechat_plugin->hdata_long(__hdata, __pointer, __name) + (weechat_plugin->hdata_long)(__hdata, __pointer, __name) #define weechat_hdata_string(__hdata, __pointer, __name) \ - weechat_plugin->hdata_string(__hdata, __pointer, __name) + (weechat_plugin->hdata_string)(__hdata, __pointer, __name) #define weechat_hdata_pointer(__hdata, __pointer, __name) \ - weechat_plugin->hdata_pointer(__hdata, __pointer, __name) + (weechat_plugin->hdata_pointer)(__hdata, __pointer, __name) #define weechat_hdata_time(__hdata, __pointer, __name) \ - weechat_plugin->hdata_time(__hdata, __pointer, __name) + (weechat_plugin->hdata_time)(__hdata, __pointer, __name) #define weechat_hdata_hashtable(__hdata, __pointer, __name) \ - weechat_plugin->hdata_hashtable(__hdata, __pointer, __name) + (weechat_plugin->hdata_hashtable)(__hdata, __pointer, __name) #define weechat_hdata_set(__hdata, __pointer, __name, __value) \ - weechat_plugin->hdata_set(__hdata, __pointer, __name, __value) + (weechat_plugin->hdata_set)(__hdata, __pointer, __name, __value) #define weechat_hdata_update(__hdata, __pointer, __hashtable) \ - weechat_plugin->hdata_update(__hdata, __pointer, __hashtable) + (weechat_plugin->hdata_update)(__hdata, __pointer, __hashtable) #define weechat_hdata_get_string(__hdata, __property) \ - weechat_plugin->hdata_get_string(__hdata, __property) + (weechat_plugin->hdata_get_string)(__hdata, __property) /* upgrade */ #define weechat_upgrade_new(__filename, __write) \ - weechat_plugin->upgrade_new(__filename, __write) + (weechat_plugin->upgrade_new)(__filename, __write) #define weechat_upgrade_write_object(__upgrade_file, __object_id, \ __infolist) \ - weechat_plugin->upgrade_write_object(__upgrade_file, __object_id, \ - __infolist) + (weechat_plugin->upgrade_write_object)(__upgrade_file, __object_id, \ + __infolist) #define weechat_upgrade_read(__upgrade_file, __callback_read, \ __callback_read_data) \ - weechat_plugin->upgrade_read(__upgrade_file, __callback_read, \ - __callback_read_data) + (weechat_plugin->upgrade_read)(__upgrade_file, __callback_read, \ + __callback_read_data) #define weechat_upgrade_close(__upgrade_file) \ - weechat_plugin->upgrade_close(__upgrade_file) + (weechat_plugin->upgrade_close)(__upgrade_file) #ifdef __cplusplus } diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index 0584b6d95..1cf5b34f8 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -933,6 +933,59 @@ xfer_free (struct t_xfer *xfer) xfer_buffer_selected_line = (xfer_count == 0) ? 0 : xfer_count - 1; } + +/* + * Resolves address. + * + * Returns: + * 1: OK + * 0: error + */ + +int +xfer_resolve_addr (const char *str_address, const char *str_port, + struct sockaddr *addr, socklen_t *addr_len, int ai_flags) +{ + struct addrinfo *ainfo, hints; + int rc; + + memset (&hints, 0, sizeof (struct addrinfo)); + hints.ai_flags = ai_flags; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = 0; + hints.ai_canonname = NULL; + hints.ai_addr = NULL; + hints.ai_next = NULL; + + rc = getaddrinfo (str_address, str_port, &hints, &ainfo); + if ((rc == 0) && ainfo && ainfo->ai_addr) + { + if (ainfo->ai_addrlen > *addr_len) + { + weechat_printf (NULL, + _("%s%s: address \"%s\" resolved to a larger " + "sockaddr than expected"), + weechat_prefix ("error"), XFER_PLUGIN_NAME, + str_address); + freeaddrinfo (ainfo); + return 0; + } + memcpy (addr, ainfo->ai_addr, ainfo->ai_addrlen); + *addr_len = ainfo->ai_addrlen; + freeaddrinfo (ainfo); + return 1; + } + + weechat_printf (NULL, + _("%s%s: invalid address \"%s\": error %d %s"), + weechat_prefix ("error"), XFER_PLUGIN_NAME, + str_address, rc, gai_strerror (rc)); + if ((rc == 0) && ainfo) + freeaddrinfo (ainfo); + return 0; +} + /* * Callback for signal "xfer_add". */ @@ -945,13 +998,12 @@ xfer_add_cb (void *data, const char *signal, const char *type_data, const char *plugin_name, *plugin_id, *str_type, *str_protocol; const char *remote_nick, *local_nick, *charset_modifier, *filename, *proxy; const char *weechat_dir, *str_address, *str_port; - int type, protocol, args, port_start, port_end, sock, port, rc; + int type, protocol, args, port_start, port_end, sock, port; char *dir1, *dir2, *filename2, *short_filename, *pos, str_port_temp[16]; struct stat st; - struct addrinfo *ainfo, hints; - struct sockaddr_storage addr, own_ip_addr; + struct sockaddr_storage addr, own_ip_addr, bind_addr; struct sockaddr *out_addr = (struct sockaddr*)&addr; - socklen_t length; + socklen_t length, bind_addr_len; unsigned long long file_size; struct t_xfer *ptr_xfer; @@ -1101,80 +1153,74 @@ xfer_add_cb (void *data, const char *signal, const char *type_data, } port = weechat_infolist_integer (infolist, "port"); - /* set address */ - memset (&hints, 0, sizeof (struct addrinfo)); - hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV; - hints.ai_family = AF_UNSPEC; /* allow IPv4 or IPv6 */ - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = 0; - hints.ai_canonname = NULL; - hints.ai_addr = NULL; - hints.ai_next = NULL; - + /* resolve address */ if (XFER_IS_RECV(type)) { str_address = weechat_infolist_string (infolist, "remote_address"); snprintf (str_port_temp, sizeof (str_port_temp), "%d", port); str_port = str_port_temp; + length = sizeof (addr); + if (!xfer_resolve_addr (str_address, str_port, + (struct sockaddr*)&addr, &length, + AI_NUMERICSERV | AI_NUMERICHOST)) + { + goto error; + } } else { - str_port = NULL; + memset(&bind_addr, 0, sizeof(bind_addr)); + + /* determine bind_addr family from either own_ip or default */ if (weechat_config_string (xfer_config_network_own_ip) && weechat_config_string (xfer_config_network_own_ip)[0]) { + /* resolve own_ip to a numeric address */ str_address = weechat_config_string (xfer_config_network_own_ip); - hints.ai_flags = AI_NUMERICSERV; + length = sizeof (own_ip_addr); - rc = getaddrinfo (str_address, str_port, &hints, &ainfo); - if ((rc == 0) && ainfo && ainfo->ai_addr) + if (!xfer_resolve_addr (str_address, NULL, + (struct sockaddr*)&own_ip_addr, &length, + AI_NUMERICSERV)) { - out_addr = (struct sockaddr*)&own_ip_addr; - memset (&own_ip_addr, 0, sizeof (addr)); - memcpy (&own_ip_addr, ainfo->ai_addr, ainfo->ai_addrlen); - length = ainfo->ai_addrlen; - freeaddrinfo (ainfo); + goto error; } - else + + /* set the advertised address to own_ip */ + out_addr = (struct sockaddr*)&own_ip_addr; + + /* bind_addr's family should be the advertised family */ + bind_addr.ss_family = own_ip_addr.ss_family; + } + else + { + /* no own_ip, so bind_addr's family comes from irc connection */ + str_address = weechat_infolist_string (infolist, "local_address"); + length = sizeof (addr); + if (!xfer_resolve_addr (str_address, NULL, + (struct sockaddr*)&addr, &length, + AI_NUMERICSERV | AI_NUMERICHOST)) { - weechat_printf (NULL, - _("%s%s: invalid address \"%s\" (option " - "xfer.network.own_ip): error %d %s"), - weechat_prefix ("error"), XFER_PLUGIN_NAME, - str_address, rc, gai_strerror (rc)); - if (rc == 0) - freeaddrinfo (ainfo); goto error; } + bind_addr.ss_family = addr.ss_family; } - str_address = weechat_infolist_string (infolist, "local_address"); - } - - rc = getaddrinfo (str_address, str_port, &hints, &ainfo); - if ((rc == 0) && ainfo && ainfo->ai_addr) - { - memset (&addr, 0, sizeof (addr)); - memcpy (&addr, ainfo->ai_addr, ainfo->ai_addrlen); - length = ainfo->ai_addrlen; - freeaddrinfo (ainfo); - } - else - { - weechat_printf (NULL, - _("%s%s: unable to find address for \"%s\": " - "error %d %s"), - weechat_prefix ("error"), XFER_PLUGIN_NAME, - str_address, rc, gai_strerror (rc)); - if (rc == 0) - freeaddrinfo (ainfo); - goto error; - } + /* determine bind wildcard address */ + if (bind_addr.ss_family == AF_INET) + { + ((struct sockaddr_in*)&bind_addr)->sin_addr.s_addr = INADDR_ANY; + bind_addr_len = sizeof (struct sockaddr_in); + } + else + { + memcpy (&((struct sockaddr_in6*)&bind_addr)->sin6_addr, + &in6addr_any, sizeof (in6addr_any)); + bind_addr_len = sizeof (struct sockaddr_in6); + } - if (XFER_IS_SEND(type)) - { /* open socket for xfer */ - sock = socket (addr.ss_family, SOCK_STREAM, 0); + sock = socket (bind_addr.ss_family, SOCK_STREAM, 0); if (sock < 0) { weechat_printf (NULL, @@ -1205,11 +1251,11 @@ xfer_add_cb (void *data, const char *signal, const char *type_data, if (!xfer_port_in_use (port)) { /* attempt to bind to the free port */ - if (addr.ss_family == AF_INET) - ((struct sockaddr_in *)&addr)->sin_port = htons (port); + if (bind_addr.ss_family == AF_INET) + ((struct sockaddr_in *)&bind_addr)->sin_port = htons (port); else - ((struct sockaddr_in6 *)&addr)->sin6_port = htons (port); - if (bind (sock, (struct sockaddr *)&addr, length) == 0) + ((struct sockaddr_in6 *)&bind_addr)->sin6_port = htons (port); + if (bind (sock, (struct sockaddr *)&bind_addr, bind_addr_len) == 0) break; } port++; @@ -1223,13 +1269,13 @@ xfer_add_cb (void *data, const char *signal, const char *type_data, if (port == 0) { /* find port automatically */ - if (bind (sock, (struct sockaddr *)&addr, length) == 0) + if (bind (sock, (struct sockaddr *)&bind_addr, bind_addr_len) == 0) { - getsockname (sock, (struct sockaddr *)&addr, &length); - if (addr.ss_family == AF_INET) - port = ntohs (((struct sockaddr_in *)&addr)->sin_port); + getsockname (sock, (struct sockaddr *)&bind_addr, &bind_addr_len); + if (bind_addr.ss_family == AF_INET) + port = ntohs (((struct sockaddr_in *)&bind_addr)->sin_port); else - port = ntohs (((struct sockaddr_in6 *)&addr)->sin6_port); + port = ntohs (((struct sockaddr_in6 *)&bind_addr)->sin6_port); } else port = -1; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 43d9f2e52..19ff1003e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -26,11 +26,11 @@ set(LIB_WEECHAT_NCURSES_FAKE_SRC ncurses-fake.c) add_library(weechat_ncurses_fake STATIC ${LIB_WEECHAT_NCURSES_FAKE_SRC}) remove_definitions(-DHAVE_CONFIG_H) -include_directories(${CPPUTEST_INCLUDE_DIRS}) -include_directories(${PROJECT_BINARY_DIR}) +include_directories(${CPPUTEST_INCLUDE_DIRS} ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}) # unit tests set(LIB_WEECHAT_UNIT_TESTS_SRC + unit/core/test-arraylist.cpp unit/core/test-eval.cpp unit/core/test-hashtable.cpp unit/core/test-hdata.cpp @@ -54,6 +54,8 @@ set(LIBS ${PROJECT_BINARY_DIR}/src/gui/curses/libweechat_gui_curses.a ${CMAKE_CURRENT_BINARY_DIR}/libweechat_ncurses_fake.a ${CMAKE_CURRENT_BINARY_DIR}/libweechat_unit_tests.a + # due to circular references, we must link two times with libweechat_core.a + ${PROJECT_BINARY_DIR}/src/core/libweechat_core.a ${EXTRA_LIBS} ${CURL_LIBRARIES} ${CPPUTEST_LIBRARIES}) diff --git a/tests/Makefile.am b/tests/Makefile.am index a093cce84..5e04c5122 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -17,13 +17,14 @@ # along with WeeChat. If not, see <http://www.gnu.org/licenses/>. # -AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(CPPUTEST_CFLAGS) +AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(CPPUTEST_CFLAGS) -I$(abs_top_srcdir) noinst_LIBRARIES = lib_ncurses_fake.a lib_weechat_unit_tests.a lib_ncurses_fake_a_SOURCES = ncurses-fake.c -lib_weechat_unit_tests_a_SOURCES = unit/core/test-eval.cpp \ +lib_weechat_unit_tests_a_SOURCES = unit/core/test-arraylist.cpp \ + unit/core/test-eval.cpp \ unit/core/test-hashtable.cpp \ unit/core/test-hdata.cpp \ unit/core/test-infolist.cpp \ @@ -35,15 +36,15 @@ lib_weechat_unit_tests_a_SOURCES = unit/core/test-eval.cpp \ noinst_PROGRAMS = tests -# Because of a linker bug, we have to link 2 times with lib_weechat_core.a +# Due to circular references, we must link two times with libweechat_core.a # (and it must be 2 different path/names to be kept by linker) tests_LDADD = ./../src/core/lib_weechat_core.a \ ../src/plugins/lib_weechat_plugins.a \ ../src/gui/lib_weechat_gui_common.a \ ../src/gui/curses/lib_weechat_gui_curses.a \ - ../src/core/lib_weechat_core.a \ lib_ncurses_fake.a \ lib_weechat_unit_tests.a \ + ../src/core/lib_weechat_core.a \ $(PLUGINS_LFLAGS) \ $(GCRYPT_LFLAGS) \ $(GNUTLS_LFLAGS) \ diff --git a/tests/tests.cpp b/tests/tests.cpp index 94bf8f536..f134fed03 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -32,13 +32,13 @@ extern "C" #ifndef HAVE_CONFIG_H #define HAVE_CONFIG_H #endif -#include "../src/core/weechat.h" -#include "../src/core/wee-hook.h" -#include "../src/core/wee-input.h" -#include "../src/core/wee-string.h" -#include "../src/plugins/plugin.h" -#include "../src/gui/gui-main.h" -#include "../src/gui/gui-buffer.h" +#include "src/core/weechat.h" +#include "src/core/wee-hook.h" +#include "src/core/wee-input.h" +#include "src/core/wee-string.h" +#include "src/plugins/plugin.h" +#include "src/gui/gui-main.h" +#include "src/gui/gui-buffer.h" extern void gui_main_init (); extern void gui_main_loop (); @@ -47,6 +47,7 @@ extern "C" #include "CppUTest/CommandLineTestRunner.h" /* import tests from libs */ +IMPORT_TEST_GROUP(Arraylist); IMPORT_TEST_GROUP(Eval); IMPORT_TEST_GROUP(Hashtable); IMPORT_TEST_GROUP(Hdata); diff --git a/tests/unit/core/test-arraylist.cpp b/tests/unit/core/test-arraylist.cpp new file mode 100644 index 000000000..29be18918 --- /dev/null +++ b/tests/unit/core/test-arraylist.cpp @@ -0,0 +1,503 @@ +/* + * test-arraylist.cpp - test arraylist functions + * + * Copyright (C) 2014 Sébastien Helleu <flashcode@flashtux.org> + * + * This file is part of WeeChat, the extensible chat client. + * + * WeeChat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * WeeChat is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WeeChat. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "CppUTest/TestHarness.h" + +extern "C" +{ +#include <string.h> +#include "src/core/wee-arraylist.h" +#include "src/core/wee-string.h" +} + +#define TEST_ARRAYLIST_ADD(__result, __value) \ + LONGS_EQUAL(__result, \ + arraylist_add (arraylist, (void *)(__value))); + +#define TEST_ARRAYLIST_SEARCH(__result_ptr, __result_index, \ + __result_index_insert, __value) \ + pointer = arraylist_search (arraylist, (void *)(__value), \ + &index, &index_insert); \ + if (__result_ptr && pointer) \ + { \ + STRCMP_EQUAL(__result_ptr, (const char *)pointer); \ + } \ + else \ + { \ + POINTERS_EQUAL(__result_ptr, pointer); \ + } \ + LONGS_EQUAL(__result_index, index); \ + LONGS_EQUAL(__result_index_insert, index_insert); + +TEST_GROUP(Arraylist) +{ +}; + +/* + * Test callback comparing two arraylist elements. + * Note: NULL element is considered lower than any other. + * + * Returns: + * -1: element(pointer1) < element(pointer2) + * 0: element(pointer1) == element(pointer2) + * 1: element(pointer1) > element(pointer2) + */ + +int +test_cmp_cb (void *data, struct t_arraylist *arraylist, + void *pointer1, void *pointer2) +{ + if (!pointer1 || !pointer2) + return (pointer1) ? 1 : ((pointer2) ? -1 : 0); + + return string_strcasecmp ((const char *)pointer1, (const char *)pointer2); +} + +void +test_arraylist (int initial_size, int sorted, int allow_duplicates) +{ + struct t_arraylist *arraylist; + int i, index, index_insert, expected_pos; + void *pointer; + const char *item_aaa = "aaa"; + const char *item_abc = "abc"; + const char *item_DEF = "DEF"; + const char *item_Def = "Def"; + const char *item_def = "def"; + const char *item_xxx = "xxx"; + const char *item_zzz = "zzz"; + + /* create arraylist */ + arraylist = arraylist_new (initial_size, + sorted, + allow_duplicates, + &test_cmp_cb, NULL, + NULL, NULL); + + /* check values after creation */ + CHECK(arraylist); + LONGS_EQUAL(0, arraylist->size); + LONGS_EQUAL(initial_size, arraylist->size_alloc); + LONGS_EQUAL(initial_size, arraylist->size_alloc_min); + if (initial_size > 0) + { + CHECK(arraylist->data); + for (i = 0; i < initial_size; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + POINTERS_EQUAL(NULL, arraylist->data); + } + LONGS_EQUAL(sorted, arraylist->sorted); + LONGS_EQUAL(allow_duplicates, arraylist->allow_duplicates); + + /* check size */ + LONGS_EQUAL(0, arraylist_size (arraylist)); + + /* get element (this should always fail, the list is empty!) */ + POINTERS_EQUAL(NULL, arraylist_get (NULL, -1)); + POINTERS_EQUAL(NULL, arraylist_get (NULL, 0)); + POINTERS_EQUAL(NULL, arraylist_get (NULL, 1)); + POINTERS_EQUAL(NULL, arraylist_get (arraylist, -1)); + POINTERS_EQUAL(NULL, arraylist_get (arraylist, 0)); + POINTERS_EQUAL(NULL, arraylist_get (arraylist, 1)); + + /* search element (this should always fail, the list is empty!) */ + POINTERS_EQUAL(NULL, arraylist_search (NULL, NULL, NULL, NULL)); + POINTERS_EQUAL(NULL, arraylist_search (arraylist, NULL, NULL, NULL)); + POINTERS_EQUAL(NULL, + arraylist_search (NULL, (void *)item_abc, NULL, NULL)); + POINTERS_EQUAL(NULL, + arraylist_search (arraylist, (void *)item_abc, NULL, NULL)); + + /* invalid add of element */ + LONGS_EQUAL(-1, arraylist_add (NULL, NULL)); + + /* add some elements */ + if (sorted) + { + TEST_ARRAYLIST_ADD(0, item_zzz); + TEST_ARRAYLIST_ADD(0, item_xxx); + TEST_ARRAYLIST_ADD(0, NULL); + TEST_ARRAYLIST_ADD(1, item_DEF); + TEST_ARRAYLIST_ADD((allow_duplicates) ? 2 : 1, item_def); + TEST_ARRAYLIST_ADD((allow_duplicates) ? 3 : 1, item_Def); + TEST_ARRAYLIST_ADD(1, item_abc); + } + else + { + TEST_ARRAYLIST_ADD(0, item_zzz); + TEST_ARRAYLIST_ADD(1, item_xxx); + TEST_ARRAYLIST_ADD(2, NULL); + TEST_ARRAYLIST_ADD(3, item_DEF); + TEST_ARRAYLIST_ADD((allow_duplicates) ? 4 : 3, item_def); + TEST_ARRAYLIST_ADD((allow_duplicates) ? 5 : 3, item_Def); + TEST_ARRAYLIST_ADD((allow_duplicates) ? 6 : 4, item_abc); + } + + /* + * arraylist is now: + * sorted: + * dup : [NULL, "abc", "DEF", "def", "Def", "xxx", "zzz"] + 2 NULL + * no dup: [NULL, "abc", "Def", "xxx", "zzz"] + 1 NULL + * not sorted: + * dup : ["zzz", "xxx", NULL, "DEF", "def", "Def", "abc"] + 2 NULL + * no dup: ["zzz", "xxx", NULL, "Def", "abc"] + 1 NULL + */ + + /* check size after adds */ + LONGS_EQUAL((allow_duplicates) ? 7 : 5, arraylist->size); + LONGS_EQUAL((allow_duplicates) ? 7 : 5, arraylist_size (arraylist)); + LONGS_EQUAL((allow_duplicates) ? 9 : 6, arraylist->size_alloc); + + /* check content after adds */ + if (sorted) + { + if (allow_duplicates) + { + POINTERS_EQUAL(NULL, arraylist->data[0]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_DEF, (const char *)arraylist->data[2]); + STRCMP_EQUAL(item_def, (const char *)arraylist->data[3]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[4]); + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[5]); + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[6]); + for (i = 7; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + POINTERS_EQUAL(NULL, arraylist->data[0]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[2]); + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[3]); + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[4]); + for (i = 5; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + } + else + { + if (allow_duplicates) + { + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[1]); + POINTERS_EQUAL(NULL, arraylist->data[2]); + STRCMP_EQUAL(item_DEF, (const char *)arraylist->data[3]); + STRCMP_EQUAL(item_def, (const char *)arraylist->data[4]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[5]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[6]); + for (i = 7; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[1]); + POINTERS_EQUAL(NULL, arraylist->data[2]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[3]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[4]); + for (i = 5; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + } + + /* search elements */ + if (sorted) + { + if (allow_duplicates) + { + TEST_ARRAYLIST_SEARCH(NULL, 0, 1, NULL); + TEST_ARRAYLIST_SEARCH(item_abc, 1, 2, item_abc); + TEST_ARRAYLIST_SEARCH(item_DEF, 2, 5, item_DEF); + TEST_ARRAYLIST_SEARCH(item_DEF, 2, 5, item_def); + TEST_ARRAYLIST_SEARCH(item_DEF, 2, 5, item_Def); + TEST_ARRAYLIST_SEARCH(item_xxx, 5, 6, item_xxx); + TEST_ARRAYLIST_SEARCH(item_zzz, 6, 7, item_zzz); + } + else + { + TEST_ARRAYLIST_SEARCH(NULL, 0, 1, NULL); + TEST_ARRAYLIST_SEARCH(item_abc, 1, 2, item_abc); + TEST_ARRAYLIST_SEARCH(item_Def, 2, 3, item_DEF); + TEST_ARRAYLIST_SEARCH(item_Def, 2, 3, item_def); + TEST_ARRAYLIST_SEARCH(item_Def, 2, 3, item_Def); + TEST_ARRAYLIST_SEARCH(item_xxx, 3, 4, item_xxx); + TEST_ARRAYLIST_SEARCH(item_zzz, 4, 5, item_zzz); + } + + /* search non-existing element */ + TEST_ARRAYLIST_SEARCH(NULL, -1, 1, item_aaa); + } + else + { + if (allow_duplicates) + { + TEST_ARRAYLIST_SEARCH(item_zzz, 0, -1, item_zzz); + TEST_ARRAYLIST_SEARCH(item_xxx, 1, -1, item_xxx); + TEST_ARRAYLIST_SEARCH(NULL, 2, -1, NULL); + TEST_ARRAYLIST_SEARCH(item_DEF, 3, -1, item_DEF); + TEST_ARRAYLIST_SEARCH(item_DEF, 3, -1, item_def); + TEST_ARRAYLIST_SEARCH(item_DEF, 3, -1, item_Def); + TEST_ARRAYLIST_SEARCH(item_abc, 6, -1, item_abc); + } + else + { + TEST_ARRAYLIST_SEARCH(item_zzz, 0, -1, item_zzz); + TEST_ARRAYLIST_SEARCH(item_xxx, 1, -1, item_xxx); + TEST_ARRAYLIST_SEARCH(NULL, 2, -1, NULL); + TEST_ARRAYLIST_SEARCH(item_Def, 3, -1, item_DEF); + TEST_ARRAYLIST_SEARCH(item_Def, 3, -1, item_def); + TEST_ARRAYLIST_SEARCH(item_Def, 3, -1, item_Def); + TEST_ARRAYLIST_SEARCH(item_abc, 4, -1, item_abc); + } + + /* search non-existing element */ + TEST_ARRAYLIST_SEARCH(NULL, -1, -1, item_aaa); + } + + /* invalid remove of elements */ + LONGS_EQUAL(-1, arraylist_remove (NULL, -1)); + LONGS_EQUAL(-1, arraylist_remove (arraylist, -1)); + LONGS_EQUAL(-1, arraylist_remove (NULL, 0)); + + /* remove the 3 first elements and check size after each remove */ + LONGS_EQUAL(0, arraylist_remove (arraylist, 0)); + LONGS_EQUAL((allow_duplicates) ? 6 : 4, arraylist->size); + LONGS_EQUAL((allow_duplicates) ? 6 : 4, arraylist_size (arraylist)); + LONGS_EQUAL((allow_duplicates) ? 9 : 6, arraylist->size_alloc); + LONGS_EQUAL(0, arraylist_remove (arraylist, 0)); + LONGS_EQUAL((allow_duplicates) ? 5 : 3, arraylist->size); + LONGS_EQUAL((allow_duplicates) ? 5 : 3, arraylist_size (arraylist)); + LONGS_EQUAL((allow_duplicates) ? 9 : 6, arraylist->size_alloc); + LONGS_EQUAL(0, arraylist_remove (arraylist, 0)); + LONGS_EQUAL((allow_duplicates) ? 4 : 2, arraylist->size); + LONGS_EQUAL((allow_duplicates) ? 4 : 2, arraylist_size (arraylist)); + LONGS_EQUAL((allow_duplicates) ? 5 : 3, arraylist->size_alloc); + + /* + * arraylist is now: + * sorted: + * dup : ["def", "Def", "xxx", "zzz"] + 1 NULL + * no dup: ["xxx", "zzz"] + 1 NULL + * not sorted: + * dup : ["DEF", "def", "Def", "abc"] + 1 NULL + * no dup: ["Def", "abc"] + 1 NULL + */ + + /* check content after the 3 deletions */ + if (sorted) + { + if (allow_duplicates) + { + STRCMP_EQUAL(item_def, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[2]); + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[3]); + for (i = 4; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[1]); + for (i = 2; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + } + else + { + if (allow_duplicates) + { + STRCMP_EQUAL(item_DEF, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_def, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[2]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[3]); + for (i = 4; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[1]); + for (i = 2; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + } + + /* invalid insert of element */ + LONGS_EQUAL(-1, arraylist_insert (NULL, 0, NULL)); + + /* insert of one element */ + LONGS_EQUAL(0, arraylist_insert (arraylist, 0, (void *)item_aaa)); + + /* + * arraylist is now: + * sorted: + * dup : ["aaa", "def", "Def", "xxx", "zzz"] + * no dup: ["aaa", "xxx", "zzz"] + * not sorted: + * dup : ["aaa", "DEF", "def", "Def", "abc"] + * no dup: ["aaa", "Def", "abc"] + */ + + /* check size after insert */ + LONGS_EQUAL((allow_duplicates) ? 5 : 3, arraylist->size); + LONGS_EQUAL((allow_duplicates) ? 5 : 3, arraylist_size (arraylist)); + LONGS_EQUAL((allow_duplicates) ? 5 : 3, arraylist->size_alloc); + + /* check content after the insert */ + if (sorted) + { + if (allow_duplicates) + { + STRCMP_EQUAL(item_aaa, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_def, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[2]); + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[3]); + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[4]); + for (i = 5; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + STRCMP_EQUAL(item_aaa, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_xxx, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_zzz, (const char *)arraylist->data[2]); + for (i = 3; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + } + else + { + if (allow_duplicates) + { + STRCMP_EQUAL(item_aaa, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_DEF, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_def, (const char *)arraylist->data[2]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[3]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[4]); + for (i = 5; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + STRCMP_EQUAL(item_aaa, (const char *)arraylist->data[0]); + STRCMP_EQUAL(item_Def, (const char *)arraylist->data[1]); + STRCMP_EQUAL(item_abc, (const char *)arraylist->data[2]); + for (i = 3; i < arraylist->size_alloc; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + } + + /* clear arraylist */ + LONGS_EQUAL(0, arraylist_clear (NULL)); + LONGS_EQUAL(1, arraylist_clear (arraylist)); + + /* check size and data after clear */ + LONGS_EQUAL(0, arraylist->size); + LONGS_EQUAL(0, arraylist_size (arraylist)); + LONGS_EQUAL(initial_size, arraylist->size_alloc); + if (initial_size > 0) + { + CHECK(arraylist->data); + for (i = 0; i < initial_size; i++) + { + POINTERS_EQUAL(NULL, arraylist->data[i]); + } + } + else + { + POINTERS_EQUAL(NULL, arraylist->data); + } + + /* free arraylist */ + arraylist_free (arraylist); +} + +/* + * Tests functions: + * arraylist_new + * arraylist_size + * arraylist_get + * arraylist_search + * arraylist_insert + * arraylist_add + * arraylist_remove + * arraylist_clear + * arraylist_free + */ + +TEST(Arraylist, New) +{ + int initial_size, sorted, allow_duplicates; + + /* + * in order to create an arraylist, initial_size must be >= 0 and a + * comparison callback must be given + */ + POINTERS_EQUAL(NULL, + arraylist_new (-1, 0, 0, NULL, NULL, NULL, NULL)); + POINTERS_EQUAL(NULL, + arraylist_new (-1, 0, 0, &test_cmp_cb, NULL, NULL, NULL)); + POINTERS_EQUAL(NULL, + arraylist_new (0, 0, 0, NULL, NULL, NULL, NULL)); + + /* tests on arraylists */ + for (initial_size = 0; initial_size < 2; initial_size++) + { + for (sorted = 0; sorted < 2; sorted++) + { + for (allow_duplicates = 0; allow_duplicates < 2; + allow_duplicates++) + { + test_arraylist (initial_size, sorted, allow_duplicates); + } + } + } +} diff --git a/tests/unit/core/test-eval.cpp b/tests/unit/core/test-eval.cpp index 131bd8959..d9fc79241 100644 --- a/tests/unit/core/test-eval.cpp +++ b/tests/unit/core/test-eval.cpp @@ -24,22 +24,20 @@ extern "C" { #include <stdio.h> -#include "../src/core/wee-eval.h" -#include "../src/core/wee-config.h" -#include "../src/core/wee-hashtable.h" -#include "../src/core/wee-version.h" -#include "../src/plugins/plugin.h" +#include <regex.h> +#include "src/core/wee-eval.h" +#include "src/core/wee-config.h" +#include "src/core/wee-hashtable.h" +#include "src/core/wee-string.h" +#include "src/core/wee-version.h" +#include "src/gui/gui-color.h" +#include "src/plugins/plugin.h" } #define WEE_CHECK_EVAL(__result, __expr) \ - value = eval_expression (__expr, NULL, extra_vars, NULL); \ + value = eval_expression (__expr, pointers, extra_vars, options); \ STRCMP_EQUAL(__result, value); \ free (value); -#define WEE_CHECK_EVAL_COND(__result, __expr) \ - value = eval_expression (__expr, NULL, extra_vars, options); \ - STRCMP_EQUAL(__result, value); \ - free (value); - TEST_GROUP(Eval) { }; @@ -70,94 +68,96 @@ TEST(Eval, Boolean) TEST(Eval, EvalCondition) { - struct t_hashtable *extra_vars, *options; + struct t_hashtable *pointers, *extra_vars, *options; char *value; + pointers = NULL; + extra_vars = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, NULL, NULL); - hashtable_set (extra_vars, "test", "value"); CHECK(extra_vars); + hashtable_set (extra_vars, "test", "value"); options = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, NULL, NULL); - hashtable_set (options, "type", "condition"); CHECK(options); + hashtable_set (options, "type", "condition"); POINTERS_EQUAL(NULL, eval_expression (NULL, NULL, NULL, options)); /* conditions evaluated as false */ - WEE_CHECK_EVAL_COND("0", ""); - WEE_CHECK_EVAL_COND("0", "0"); - WEE_CHECK_EVAL_COND("0", "1 == 2"); - WEE_CHECK_EVAL_COND("0", "1 >= 2"); - WEE_CHECK_EVAL_COND("0", "2 <= 1"); - WEE_CHECK_EVAL_COND("0", "2 != 2"); - WEE_CHECK_EVAL_COND("0", "18 < 5"); - WEE_CHECK_EVAL_COND("0", "5 > 18"); - WEE_CHECK_EVAL_COND("0", "1 == 5 > 18"); - WEE_CHECK_EVAL_COND("0", "abc == def"); - WEE_CHECK_EVAL_COND("0", "()"); - WEE_CHECK_EVAL_COND("0", "(5 > 26)"); - WEE_CHECK_EVAL_COND("0", "((5 > 26))"); - WEE_CHECK_EVAL_COND("0", "(26 < 5)"); - WEE_CHECK_EVAL_COND("0", "abc > def"); - WEE_CHECK_EVAL_COND("0", "1 && 0"); - WEE_CHECK_EVAL_COND("0", "abc && 0"); - WEE_CHECK_EVAL_COND("0", "0 || 0"); - WEE_CHECK_EVAL_COND("0", "0 || 0 || 0"); - WEE_CHECK_EVAL_COND("0", "0 || 1 && 0"); - WEE_CHECK_EVAL_COND("0", "0 || (1 && 0)"); - WEE_CHECK_EVAL_COND("0", "0 || (0 || (1 && 0))"); - WEE_CHECK_EVAL_COND("0", "1 && (0 || 0)"); - WEE_CHECK_EVAL_COND("0", "(0 || 1) && 0"); - WEE_CHECK_EVAL_COND("0", "((0 || 1) && 1) && 0"); - WEE_CHECK_EVAL_COND("0", "abcd =~ (?-i)^ABC"); - WEE_CHECK_EVAL_COND("0", "abcd =~ \\(abcd\\)"); - WEE_CHECK_EVAL_COND("0", "(abcd) =~ \\(\\(abcd\\)\\)"); - WEE_CHECK_EVAL_COND("0", "${test} == test"); - WEE_CHECK_EVAL_COND("0", "${test2} == value2"); - WEE_CHECK_EVAL_COND("0", "${buffer.number} == 2"); - WEE_CHECK_EVAL_COND("0", "${window.buffer.number} == 2"); + WEE_CHECK_EVAL("0", ""); + WEE_CHECK_EVAL("0", "0"); + WEE_CHECK_EVAL("0", "1 == 2"); + WEE_CHECK_EVAL("0", "1 >= 2"); + WEE_CHECK_EVAL("0", "2 <= 1"); + WEE_CHECK_EVAL("0", "2 != 2"); + WEE_CHECK_EVAL("0", "18 < 5"); + WEE_CHECK_EVAL("0", "5 > 18"); + WEE_CHECK_EVAL("0", "1 == 5 > 18"); + WEE_CHECK_EVAL("0", "abc == def"); + WEE_CHECK_EVAL("0", "()"); + WEE_CHECK_EVAL("0", "(5 > 26)"); + WEE_CHECK_EVAL("0", "((5 > 26))"); + WEE_CHECK_EVAL("0", "(26 < 5)"); + WEE_CHECK_EVAL("0", "abc > def"); + WEE_CHECK_EVAL("0", "1 && 0"); + WEE_CHECK_EVAL("0", "abc && 0"); + WEE_CHECK_EVAL("0", "0 || 0"); + WEE_CHECK_EVAL("0", "0 || 0 || 0"); + WEE_CHECK_EVAL("0", "0 || 1 && 0"); + WEE_CHECK_EVAL("0", "0 || (1 && 0)"); + WEE_CHECK_EVAL("0", "0 || (0 || (1 && 0))"); + WEE_CHECK_EVAL("0", "1 && (0 || 0)"); + WEE_CHECK_EVAL("0", "(0 || 1) && 0"); + WEE_CHECK_EVAL("0", "((0 || 1) && 1) && 0"); + WEE_CHECK_EVAL("0", "abcd =~ (?-i)^ABC"); + WEE_CHECK_EVAL("0", "abcd =~ \\(abcd\\)"); + WEE_CHECK_EVAL("0", "(abcd) =~ \\(\\(abcd\\)\\)"); + WEE_CHECK_EVAL("0", "${test} == test"); + WEE_CHECK_EVAL("0", "${test2} == value2"); + WEE_CHECK_EVAL("0", "${buffer.number} == 2"); + WEE_CHECK_EVAL("0", "${window.buffer.number} == 2"); /* conditions evaluated as true */ - WEE_CHECK_EVAL_COND("1", "1"); - WEE_CHECK_EVAL_COND("1", "123"); - WEE_CHECK_EVAL_COND("1", "abc"); - WEE_CHECK_EVAL_COND("1", "2 == 2"); - WEE_CHECK_EVAL_COND("1", "2 >= 1"); - WEE_CHECK_EVAL_COND("1", "1 <= 2"); - WEE_CHECK_EVAL_COND("1", "1 != 2"); - WEE_CHECK_EVAL_COND("1", "18 > 5"); - WEE_CHECK_EVAL_COND("1", "5 < 18"); - WEE_CHECK_EVAL_COND("1", "1 == 18 > 5"); - WEE_CHECK_EVAL_COND("1", "abc == abc"); - WEE_CHECK_EVAL_COND("1", "(26 > 5)"); - WEE_CHECK_EVAL_COND("1", "((26 > 5))"); - WEE_CHECK_EVAL_COND("1", "(5 < 26)"); - WEE_CHECK_EVAL_COND("1", "def > abc"); - WEE_CHECK_EVAL_COND("1", "1 && 1"); - WEE_CHECK_EVAL_COND("1", "abc && 1"); - WEE_CHECK_EVAL_COND("1", "0 || 1"); - WEE_CHECK_EVAL_COND("1", "0 || 0 || 1"); - WEE_CHECK_EVAL_COND("1", "1 || 1 && 0"); - WEE_CHECK_EVAL_COND("1", "0 || (1 && 1)"); - WEE_CHECK_EVAL_COND("1", "0 || (0 || (1 && 1))"); - WEE_CHECK_EVAL_COND("1", "1 && (0 || 1)"); - WEE_CHECK_EVAL_COND("1", "(0 || 1) && 1"); - WEE_CHECK_EVAL_COND("1", "((0 || 1) && 1) && 1"); - WEE_CHECK_EVAL_COND("1", "abcd =~ ^ABC"); - WEE_CHECK_EVAL_COND("1", "abcd =~ (?-i)^abc"); - WEE_CHECK_EVAL_COND("1", "(abcd) =~ (abcd)"); - WEE_CHECK_EVAL_COND("1", "(abcd) =~ \\(abcd\\)"); - WEE_CHECK_EVAL_COND("1", "((abcd)) =~ \\(\\(abcd\\)\\)"); - WEE_CHECK_EVAL_COND("1", "${test} == value"); - WEE_CHECK_EVAL_COND("1", "${test2} =="); - WEE_CHECK_EVAL_COND("1", "${buffer.number} == 1"); - WEE_CHECK_EVAL_COND("1", "${window.buffer.number} == 1"); + WEE_CHECK_EVAL("1", "1"); + WEE_CHECK_EVAL("1", "123"); + WEE_CHECK_EVAL("1", "abc"); + WEE_CHECK_EVAL("1", "2 == 2"); + WEE_CHECK_EVAL("1", "2 >= 1"); + WEE_CHECK_EVAL("1", "1 <= 2"); + WEE_CHECK_EVAL("1", "1 != 2"); + WEE_CHECK_EVAL("1", "18 > 5"); + WEE_CHECK_EVAL("1", "5 < 18"); + WEE_CHECK_EVAL("1", "1 == 18 > 5"); + WEE_CHECK_EVAL("1", "abc == abc"); + WEE_CHECK_EVAL("1", "(26 > 5)"); + WEE_CHECK_EVAL("1", "((26 > 5))"); + WEE_CHECK_EVAL("1", "(5 < 26)"); + WEE_CHECK_EVAL("1", "def > abc"); + WEE_CHECK_EVAL("1", "1 && 1"); + WEE_CHECK_EVAL("1", "abc && 1"); + WEE_CHECK_EVAL("1", "0 || 1"); + WEE_CHECK_EVAL("1", "0 || 0 || 1"); + WEE_CHECK_EVAL("1", "1 || 1 && 0"); + WEE_CHECK_EVAL("1", "0 || (1 && 1)"); + WEE_CHECK_EVAL("1", "0 || (0 || (1 && 1))"); + WEE_CHECK_EVAL("1", "1 && (0 || 1)"); + WEE_CHECK_EVAL("1", "(0 || 1) && 1"); + WEE_CHECK_EVAL("1", "((0 || 1) && 1) && 1"); + WEE_CHECK_EVAL("1", "abcd =~ ^ABC"); + WEE_CHECK_EVAL("1", "abcd =~ (?-i)^abc"); + WEE_CHECK_EVAL("1", "(abcd) =~ (abcd)"); + WEE_CHECK_EVAL("1", "(abcd) =~ \\(abcd\\)"); + WEE_CHECK_EVAL("1", "((abcd)) =~ \\(\\(abcd\\)\\)"); + WEE_CHECK_EVAL("1", "${test} == value"); + WEE_CHECK_EVAL("1", "${test2} =="); + WEE_CHECK_EVAL("1", "${buffer.number} == 1"); + WEE_CHECK_EVAL("1", "${window.buffer.number} == 1"); hashtable_free (extra_vars); hashtable_free (options); @@ -170,18 +170,24 @@ TEST(Eval, EvalCondition) TEST(Eval, EvalExpression) { - struct t_hashtable *extra_vars; + struct t_hashtable *pointers, *extra_vars, *options; char *value, str_value[256]; void *toto; + pointers = NULL; + extra_vars = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, NULL, NULL); - hashtable_set (extra_vars, "test", "value"); CHECK(extra_vars); + hashtable_set (extra_vars, "test", "value"); + + options = NULL; POINTERS_EQUAL(NULL, eval_expression (NULL, NULL, NULL, NULL)); + + /* test with simple strings */ WEE_CHECK_EVAL("", ""); WEE_CHECK_EVAL("a b c", "a b c"); WEE_CHECK_EVAL("$", "$"); @@ -189,15 +195,108 @@ TEST(Eval, EvalExpression) WEE_CHECK_EVAL("}", "}"); WEE_CHECK_EVAL("", "${}"); WEE_CHECK_EVAL("", "${xyz}"); + + /* test value from extra_vars */ + WEE_CHECK_EVAL("value", "${test}"); + + /* test escaped chars */ WEE_CHECK_EVAL("\t", "${\\t}"); + WEE_CHECK_EVAL("\t", "${esc:\t}"); + + /* test hidden chars */ + WEE_CHECK_EVAL("********", "${hide:*,password}"); + WEE_CHECK_EVAL("\u2603\u2603\u2603", "${hide:${esc:\u2603},abc}"); + + /* test color */ + WEE_CHECK_EVAL(gui_color_get_custom ("green"), "${color:green}"); + WEE_CHECK_EVAL(gui_color_get_custom ("*214"), "${color:*214}"); + + /* test info */ WEE_CHECK_EVAL(version_get_version (), "${info:version}"); + + /* test option */ + snprintf (str_value, sizeof (str_value), + "%d", CONFIG_INTEGER(config_look_scroll_amount)); + WEE_CHECK_EVAL(str_value, "${weechat.look.scroll_amount}"); + WEE_CHECK_EVAL(str_value, "${${window.buffer.name}.look.scroll_amount}"); + + /* test hdata */ + WEE_CHECK_EVAL("x", "x${buffer.number"); + WEE_CHECK_EVAL("x${buffer.number}1", + "x\\${buffer.number}${buffer.number}"); WEE_CHECK_EVAL("1", "${buffer.number}"); WEE_CHECK_EVAL("1", "${window.buffer.number}"); WEE_CHECK_EVAL("core.weechat", "${buffer.full_name}"); WEE_CHECK_EVAL("core.weechat", "${window.buffer.full_name}"); - snprintf (str_value, sizeof (str_value), - "%d", CONFIG_INTEGER(config_look_scroll_amount)); - WEE_CHECK_EVAL(str_value, "${weechat.look.scroll_amount}"); hashtable_free (extra_vars); } + +/* + * Tests functions: + * eval_expression (replace with regex) + */ + +TEST(Eval, EvalReplaceRegex) +{ + struct t_hashtable *pointers, *extra_vars, *options; + char *value; + regex_t regex; + + pointers = hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_POINTER, + NULL, NULL); + CHECK(pointers); + + extra_vars = hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, NULL); + CHECK(extra_vars); + hashtable_set (extra_vars, "test", "value"); + + options = hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, NULL); + CHECK(options); + + /* add brackets around URLs (regex as string) */ + hashtable_remove (pointers, "regex"); + hashtable_set (options, "regex", "\\w+://\\S+"); + hashtable_set (options, "regex_replace", "[ ${re:0} ]"); + WEE_CHECK_EVAL("test: [ http://weechat.org ]", + "test: http://weechat.org"); + + /* add brackets around URLs (compiled regex) */ + LONGS_EQUAL(0, string_regcomp (®ex, "\\w+://\\S+", + REG_EXTENDED | REG_ICASE)); + hashtable_set (pointers, "regex", ®ex); + hashtable_remove (options, "regex"); + hashtable_set (options, "regex_replace", "[ ${re:0} ]"); + WEE_CHECK_EVAL("test: [ http://weechat.org ]", + "test: http://weechat.org"); + regfree (®ex); + + /* hide passwords (regex as string) */ + hashtable_remove (pointers, "regex"); + hashtable_set (options, "regex", "(password=)(\\S+)"); + hashtable_set (options, "regex_replace", "${re:1}${hide:*,${re:2}}"); + WEE_CHECK_EVAL("password=*** password=***", + "password=abc password=def"); + + /* hide passwords (compiled regex) */ + LONGS_EQUAL(0, string_regcomp (®ex, "(password=)(\\S+)", + REG_EXTENDED | REG_ICASE)); + hashtable_set (pointers, "regex", ®ex); + hashtable_remove (options, "regex"); + hashtable_set (options, "regex_replace", "${re:1}${hide:*,${re:2}}"); + WEE_CHECK_EVAL("password=*** password=***", + "password=abc password=def"); + regfree (®ex); + + hashtable_free (pointers); + hashtable_free (extra_vars); + hashtable_free (options); +} diff --git a/tests/unit/core/test-hashtable.cpp b/tests/unit/core/test-hashtable.cpp index fb030f2ba..e92ea328f 100644 --- a/tests/unit/core/test-hashtable.cpp +++ b/tests/unit/core/test-hashtable.cpp @@ -24,10 +24,14 @@ extern "C" { #include <string.h> -#include "../src/core/wee-hashtable.h" -#include "../src/plugins/plugin.h" +#include "src/core/wee-hashtable.h" +#include "src/plugins/plugin.h" } +#define HASHTABLE_TEST_KEY "test" +#define HASHTABLE_TEST_KEY_HASH 5849825121ULL +#define HASHTABLE_TEST_VALUE "this is a value" + TEST_GROUP(Hashtable) { }; @@ -41,8 +45,8 @@ TEST(Hashtable, HashDbj2) { unsigned long long hash; - hash = hashtable_hash_key_djb2 ("test"); - CHECK(hash == 5849825121ULL); + hash = hashtable_hash_key_djb2 (HASHTABLE_TEST_KEY); + CHECK(hash == HASHTABLE_TEST_KEY_HASH); } /* @@ -119,37 +123,150 @@ TEST(Hashtable, New) * Tests functions: * hashtable_set_with_size * hashtable_set + * hashtable_get_item + * hashtable_get + * hashtable_has_key + * hashtable_dup + * hashtable_remove + * hashtable_remove_all + * hashtable_free */ -TEST(Hashtable, Set) +TEST(Hashtable, SetGetRemove) { - struct t_hashtable *hashtable; - struct t_hashtable_item *item; - const char *value = "this is a string"; + struct t_hashtable *hashtable, *hashtable2; + struct t_hashtable_item *item, *ptr_item, *ptr_item2; + const char *str_key = HASHTABLE_TEST_KEY; + const char *str_value = HASHTABLE_TEST_VALUE; + const char *ptr_value; + unsigned long long hash; + int i, j; hashtable = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, &test_hashtable_hash_key_cb, &test_hashtable_keycmp_cb); + LONGS_EQUAL(32, hashtable->size); + LONGS_EQUAL(0, hashtable->items_count); + + /* invalid set of items */ POINTERS_EQUAL(NULL, hashtable_set_with_size (NULL, NULL, -1, NULL, -1)); POINTERS_EQUAL(NULL, hashtable_set_with_size (NULL, NULL, -1, NULL, -1)); - /* TODO: write more tests */ - - hashtable_free (hashtable); -} + /* add an item in hashtable with NULL value */ + item = hashtable_set (hashtable, str_key, NULL); + CHECK(item); + LONGS_EQUAL(1, hashtable->items_count); + STRCMP_EQUAL(str_key, (const char *)item->key); + LONGS_EQUAL(strlen (str_key) + 1, item->key_size); + POINTERS_EQUAL(NULL, item->value); + LONGS_EQUAL(0, item->value_size); + POINTERS_EQUAL(NULL, item->prev_item); + POINTERS_EQUAL(NULL, item->next_item); + + /* set a string value for the same key */ + item = hashtable_set (hashtable, str_key, str_value); + CHECK(item); + LONGS_EQUAL(1, hashtable->items_count); + STRCMP_EQUAL(str_key, (const char *)item->key); + LONGS_EQUAL(strlen (str_key) + 1, item->key_size); + STRCMP_EQUAL(str_value, (const char *)item->value); + LONGS_EQUAL(strlen (str_value) + 1, item->value_size); + POINTERS_EQUAL(NULL, item->prev_item); + POINTERS_EQUAL(NULL, item->next_item); + + /* get item */ + item = hashtable_get_item (hashtable, str_key, &hash); + CHECK(item); + STRCMP_EQUAL(str_key, (const char *)item->key); + STRCMP_EQUAL(str_value, (const char *)item->value); + LONGS_EQUAL(2, hash); + + /* get value */ + ptr_value = (const char *)hashtable_get (hashtable, str_key); + CHECK(ptr_value); + STRCMP_EQUAL(ptr_value, str_value); + + /* check if key is in hashtable */ + LONGS_EQUAL(0, hashtable_has_key (hashtable, NULL)); + LONGS_EQUAL(0, hashtable_has_key (hashtable, "")); + LONGS_EQUAL(0, hashtable_has_key (hashtable, "xxx")); + LONGS_EQUAL(1, hashtable_has_key (hashtable, str_key)); + + /* delete an item */ + hashtable_remove (hashtable, str_key); + LONGS_EQUAL(0, hashtable->items_count); -/* - * Tests functions: - * hashtable_get_item - * hashtable_get - * hashtable_has_key - */ + /* add an item with size in hashtable */ + item = hashtable_set_with_size (hashtable, + str_key, strlen (str_key) + 1, + str_value, strlen (str_value) + 1); + CHECK(item); + LONGS_EQUAL(1, hashtable->items_count); + STRCMP_EQUAL(str_key, (const char *)item->key); + LONGS_EQUAL(strlen (str_key) + 1, item->key_size); + STRCMP_EQUAL(str_value, (const char *)item->value); + LONGS_EQUAL(strlen (str_value) + 1, item->value_size); + + /* add another item */ + hashtable_set (hashtable, "xxx", "zzz"); + LONGS_EQUAL(2, hashtable->items_count); + + /* + * test duplication of hashtable and check that duplicated content is + * exactly the same as initial hashtable + */ + hashtable2 = hashtable_dup (hashtable); + CHECK(hashtable2); + LONGS_EQUAL(hashtable->size, hashtable2->size); + LONGS_EQUAL(hashtable->items_count, hashtable2->items_count); + for (i = 0; i < hashtable->size; i++) + { + if (hashtable->htable[i]) + { + ptr_item = hashtable->htable[i]; + ptr_item2 = hashtable2->htable[i]; + while (ptr_item && ptr_item2) + { + LONGS_EQUAL(ptr_item->key_size, ptr_item2->key_size); + LONGS_EQUAL(ptr_item->value_size, ptr_item2->value_size); + if (ptr_item->key) + { + STRCMP_EQUAL((const char *)ptr_item->key, + (const char *)ptr_item2->key); + } + else + { + POINTERS_EQUAL(ptr_item->key, ptr_item2->key); + } + if (ptr_item->value) + { + STRCMP_EQUAL((const char *)ptr_item->value, + (const char *)ptr_item2->value); + } + else + { + POINTERS_EQUAL(ptr_item->value, ptr_item2->value); + } + ptr_item = ptr_item->next_item; + ptr_item2 = ptr_item2->next_item; + CHECK((ptr_item && ptr_item2) || (!ptr_item && !ptr_item2)); + } + } + else + { + POINTERS_EQUAL(hashtable->htable[i], hashtable2->htable[i]); + } + } + + /* remove all items */ + hashtable_remove_all (hashtable); + LONGS_EQUAL(0, hashtable->items_count); -TEST(Hashtable, Get) -{ - /* TODO: write tests */ + /* free hashtable */ + hashtable_free (hashtable); + hashtable_free (hashtable2); } /* @@ -165,16 +282,6 @@ TEST(Hashtable, Map) /* * Tests functions: - * hashtable_dup - */ - -TEST(Hashtable, Dup) -{ - /* TODO: write tests */ -} - -/* - * Tests functions: * hashtable_get_list_keys * hashtable_get_integer * hashtable_get_string @@ -198,18 +305,6 @@ TEST(Hashtable, Infolist) /* * Tests functions: - * hashtable_remove - * hashtable_remove_all - * hashtable_free - */ - -TEST(Hashtable, Free) -{ - /* TODO: write tests */ -} - -/* - * Tests functions: * hashtable_print_log */ diff --git a/tests/unit/core/test-hdata.cpp b/tests/unit/core/test-hdata.cpp index 31af084a0..400f7e847 100644 --- a/tests/unit/core/test-hdata.cpp +++ b/tests/unit/core/test-hdata.cpp @@ -23,7 +23,7 @@ extern "C" { -#include "../src/core/wee-hdata.h" +#include "src/core/wee-hdata.h" } TEST_GROUP(Hdata) diff --git a/tests/unit/core/test-infolist.cpp b/tests/unit/core/test-infolist.cpp index 6b7a67c11..e559f15d2 100644 --- a/tests/unit/core/test-infolist.cpp +++ b/tests/unit/core/test-infolist.cpp @@ -23,7 +23,7 @@ extern "C" { -#include "../src/core/wee-infolist.h" +#include "src/core/wee-infolist.h" } TEST_GROUP(Infolist) diff --git a/tests/unit/core/test-list.cpp b/tests/unit/core/test-list.cpp index 7e804c1f2..9f5e4c3c7 100644 --- a/tests/unit/core/test-list.cpp +++ b/tests/unit/core/test-list.cpp @@ -23,7 +23,7 @@ extern "C" { -#include "../src/core/wee-list.h" +#include "src/core/wee-list.h" } TEST_GROUP(List) diff --git a/tests/unit/core/test-string.cpp b/tests/unit/core/test-string.cpp index 9851e3a9d..a22599b29 100644 --- a/tests/unit/core/test-string.cpp +++ b/tests/unit/core/test-string.cpp @@ -26,8 +26,9 @@ extern "C" #include <stdio.h> #include <string.h> #include <regex.h> -#include "../tests/tests.h" -#include "../src/core/wee-string.h" +#include "tests/tests.h" +#include "src/core/wee-string.h" +#include "src/core/wee-hashtable.h" } #define ONE_KB 1000ULL @@ -94,6 +95,8 @@ extern "C" STRCMP_EQUAL(__result, str); \ free (str); +extern struct t_hashtable *string_hashtable_shared; + TEST_GROUP(String) { }; @@ -690,16 +693,16 @@ TEST(String, Split) POINTERS_EQUAL(NULL, string_split ("", NULL, 0, 0, NULL)); POINTERS_EQUAL(NULL, string_split ("", "", 0, 0, NULL)); - argc = 1; + argc = -1; POINTERS_EQUAL(NULL, string_split (NULL, NULL, 0, 0, &argc)); LONGS_EQUAL(0, argc); - argc = 1; + argc = -1; POINTERS_EQUAL(NULL, string_split (NULL, "", 0, 0, &argc)); LONGS_EQUAL(0, argc); - argc = 1; + argc = -1; POINTERS_EQUAL(NULL, string_split ("", NULL, 0, 0, &argc)); LONGS_EQUAL(0, argc); - argc = 1; + argc = -1; POINTERS_EQUAL(NULL, string_split ("", "", 0, 0, &argc)); LONGS_EQUAL(0, argc); @@ -709,6 +712,7 @@ TEST(String, Split) /* standard split */ argv = string_split (" abc de fghi ", " ", 0, 0, &argc); LONGS_EQUAL(3, argc); + CHECK(argv); STRCMP_EQUAL("abc", argv[0]); STRCMP_EQUAL("de", argv[1]); STRCMP_EQUAL("fghi", argv[2]); @@ -718,6 +722,7 @@ TEST(String, Split) /* max 2 items */ argv = string_split (" abc de fghi ", " ", 0, 2, &argc); LONGS_EQUAL(2, argc); + CHECK(argv); STRCMP_EQUAL("abc", argv[0]); STRCMP_EQUAL("de", argv[1]); POINTERS_EQUAL(NULL, argv[2]); @@ -726,6 +731,7 @@ TEST(String, Split) /* keep eol */ argv = string_split (" abc de fghi ", " ", 1, 0, &argc); LONGS_EQUAL(3, argc); + CHECK(argv); STRCMP_EQUAL("abc de fghi", argv[0]); STRCMP_EQUAL("de fghi", argv[1]); STRCMP_EQUAL("fghi", argv[2]); @@ -735,6 +741,7 @@ TEST(String, Split) /* keep eol and max 2 items */ argv = string_split (" abc de fghi ", " ", 1, 2, &argc); LONGS_EQUAL(2, argc); + CHECK(argv); STRCMP_EQUAL("abc de fghi", argv[0]); STRCMP_EQUAL("de fghi", argv[1]); POINTERS_EQUAL(NULL, argv[2]); @@ -759,6 +766,7 @@ TEST(String, SplitShared) argv = string_split_shared (" abc de abc ", " ", 0, 0, &argc); LONGS_EQUAL(3, argc); + CHECK(argv); STRCMP_EQUAL("abc", argv[0]); STRCMP_EQUAL("de", argv[1]); STRCMP_EQUAL("abc", argv[2]); @@ -786,15 +794,24 @@ TEST(String, SplitShell) POINTERS_EQUAL(NULL, string_split_shell (NULL, NULL)); + /* test with an empty string */ + argc = -1; + argv = string_split_shell ("", &argc); + LONGS_EQUAL(0, argc); + CHECK(argv); + POINTERS_EQUAL(NULL, argv[0]); + string_free_split (argv); + + /* test with a real string (command + arguments) */ argv = string_split_shell ("/path/to/bin arg1 \"arg2 here\" 'arg3 here'", &argc); LONGS_EQUAL(4, argc); + CHECK(argv); STRCMP_EQUAL("/path/to/bin", argv[0]); STRCMP_EQUAL("arg1", argv[1]); STRCMP_EQUAL("arg2 here", argv[2]); STRCMP_EQUAL("arg3 here", argv[3]); POINTERS_EQUAL(NULL, argv[4]); - string_free_split (argv); /* free split with NULL */ @@ -815,6 +832,7 @@ TEST(String, SplitCommand) POINTERS_EQUAL(NULL, string_split_command (NULL, ';')); POINTERS_EQUAL(NULL, string_split_command ("", ';')); argv = string_split_command ("abc;de;fghi", ';'); + CHECK(argv); STRCMP_EQUAL("abc", argv[0]); STRCMP_EQUAL("de", argv[1]); STRCMP_EQUAL("fghi", argv[2]); @@ -1066,5 +1084,35 @@ TEST(String, Input) TEST(String, Shared) { - /* TODO: write tests */ + const char *str1, *str2, *str3; + int count; + + count = string_hashtable_shared->items_count; + + str1 = string_shared_get ("this is a test"); + CHECK(str1); + + LONGS_EQUAL(count + 1, string_hashtable_shared->items_count); + + str2 = string_shared_get ("this is a test"); + CHECK(str2); + POINTERS_EQUAL(str1, str2); + + LONGS_EQUAL(count + 1, string_hashtable_shared->items_count); + + str3 = string_shared_get ("this is another test"); + CHECK(str3); + CHECK(str1 != str3); + CHECK(str2 != str3); + + LONGS_EQUAL(count + 2, string_hashtable_shared->items_count); + + string_shared_free (str1); + LONGS_EQUAL(count + 2, string_hashtable_shared->items_count); + + string_shared_free (str2); + LONGS_EQUAL(count + 1, string_hashtable_shared->items_count); + + string_shared_free (str3); + LONGS_EQUAL(count + 0, string_hashtable_shared->items_count); } diff --git a/tests/unit/core/test-url.cpp b/tests/unit/core/test-url.cpp index 5401af156..837ad4c29 100644 --- a/tests/unit/core/test-url.cpp +++ b/tests/unit/core/test-url.cpp @@ -23,7 +23,7 @@ extern "C" { -#include "../src/core/wee-url.h" +#include "src/core/wee-url.h" } TEST_GROUP(Url) diff --git a/tests/unit/core/test-utf8.cpp b/tests/unit/core/test-utf8.cpp index ef430d9e5..b7f567281 100644 --- a/tests/unit/core/test-utf8.cpp +++ b/tests/unit/core/test-utf8.cpp @@ -26,8 +26,8 @@ extern "C" #include <stdio.h> #include <string.h> #include <wctype.h> -#include "../tests/tests.h" -#include "../src/core/wee-utf8.h" +#include "tests/tests.h" +#include "src/core/wee-utf8.h" } const char *noel_valid = "no\xc3\xabl"; /* noël */ diff --git a/tests/unit/core/test-util.cpp b/tests/unit/core/test-util.cpp index 96a930e0c..eb2174e1e 100644 --- a/tests/unit/core/test-util.cpp +++ b/tests/unit/core/test-util.cpp @@ -27,7 +27,7 @@ extern "C" #include <stdio.h> #include <string.h> #include <sys/time.h> -#include "../src/core/wee-util.h" +#include "src/core/wee-util.h" } TEST_GROUP(Util) @@ -43,9 +43,11 @@ TEST_GROUP(Util) TEST(Util, Timeval) { + struct timeval tv_zero = { 0, 0 }; struct timeval tv1 = { 123456, 12000 }; struct timeval tv2 = { 123456, 15000 }; struct timeval tv3 = { 123457, 15000 }; + struct timeval tv4 = { 1409288400, 0 }; /* 2014-08-29 05:00:00 GMT */ struct timeval tv; /* comparison */ @@ -60,17 +62,18 @@ TEST(Util, Timeval) LONGS_EQUAL(0, util_timeval_diff (NULL, NULL)); LONGS_EQUAL(0, util_timeval_diff (NULL, &tv1)); LONGS_EQUAL(0, util_timeval_diff (&tv1, NULL)); - LONGS_EQUAL(3, util_timeval_diff (&tv1, &tv2)); - LONGS_EQUAL(1003, util_timeval_diff (&tv1, &tv3)); + LONGS_EQUAL(3000, util_timeval_diff (&tv1, &tv2)); + LONGS_EQUAL(1003000, util_timeval_diff (&tv1, &tv3)); + CHECK(1409288400 * 1000000LL == util_timeval_diff (&tv_zero, &tv4)); /* add interval */ util_timeval_add (NULL, 0); tv.tv_sec = 123456; tv.tv_usec = 12000; - util_timeval_add (&tv, 10); + util_timeval_add (&tv, 10000); LONGS_EQUAL(123456, tv.tv_sec); LONGS_EQUAL(22000, tv.tv_usec); - util_timeval_add (&tv, 4000); + util_timeval_add (&tv, 4000000); LONGS_EQUAL(123460, tv.tv_sec); LONGS_EQUAL(22000, tv.tv_usec); } diff --git a/weechat.cygport.in b/weechat.cygport.in index 710c530bb..b9765765e 100644 --- a/weechat.cygport.in +++ b/weechat.cygport.in @@ -48,7 +48,7 @@ SRC_URI="http://weechat.org/files/src/weechat-${VERSION}.tar.bz2" # Build dependencies only DEPEND="asciidoc cmake docbook-xml-simple11 docbook-xsl gettext gettext-devel \ gnutls-devel libaspell-devel libcurl-devel libgcrypt-devel libncursesw-devel \ -lua perl python ruby source-highlight tcl zlib-devel" +lua perl pkg-config python ruby source-highlight tcl zlib-devel" # # CMake compilation of WeeChat: |