diff options
Diffstat (limited to 'src/plugins')
263 files changed, 1201 insertions, 498 deletions
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index ce7546859..40d73e10d 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # Copyright (C) 2009 Emmanuel Bouthenot <kolter@openics.org> # # This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 4836aec07..aa46965f7 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # Copyright (C) 2006-2009 Emmanuel Bouthenot <kolter@openics.org> # # This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/alias/CMakeLists.txt b/src/plugins/alias/CMakeLists.txt index 7214efbc3..8f1c39958 100644 --- a/src/plugins/alias/CMakeLists.txt +++ b/src/plugins/alias/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/alias/Makefile.am b/src/plugins/alias/Makefile.am index 0214ef60d..fb9cffa96 100644 --- a/src/plugins/alias/Makefile.am +++ b/src/plugins/alias/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/alias/alias-command.c b/src/plugins/alias/alias-command.c index 74c1964ff..59975387d 100644 --- a/src/plugins/alias/alias-command.c +++ b/src/plugins/alias/alias-command.c @@ -1,7 +1,7 @@ /* * alias-command.c - alias commands * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -123,11 +123,36 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, weechat_printf (NULL, _("All aliases:")); } } - weechat_printf (NULL, " %s %s=>%s %s", - ptr_alias->name, - weechat_color ("chat_delimiters"), - weechat_color ("chat"), - ptr_alias->command); + ptr_option = weechat_config_search_option ( + alias_config_file, + alias_config_section_completion, + ptr_alias->name); + if (ptr_option) + { + weechat_printf ( + NULL, + " %s %s=>%s %s %s(%s%s %s%s)%s", + ptr_alias->name, + weechat_color ("chat_delimiters"), + weechat_color ("chat"), + ptr_alias->command, + weechat_color ("chat_delimiters"), + weechat_color ("chat"), + _("completion:"), + weechat_config_string (ptr_option), + weechat_color ("chat_delimiters"), + weechat_color ("chat")); + } + else + { + weechat_printf ( + NULL, + " %s %s=>%s %s", + ptr_alias->name, + weechat_color ("chat_delimiters"), + weechat_color ("chat"), + ptr_alias->command); + } alias_found = 1; } } @@ -190,7 +215,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, ptr_option = weechat_config_search_option ( alias_config_file, alias_config_section_cmd, - ptr_alias_name); + ptr_alias_name); if (ptr_option) weechat_config_option_free (ptr_option); ptr_option = weechat_config_search_option ( diff --git a/src/plugins/alias/alias-command.h b/src/plugins/alias/alias-command.h index 14b75dbef..033a9bf28 100644 --- a/src/plugins/alias/alias-command.h +++ b/src/plugins/alias/alias-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/alias/alias-completion.c b/src/plugins/alias/alias-completion.c index 44a590abc..42e3a553e 100644 --- a/src/plugins/alias/alias-completion.c +++ b/src/plugins/alias/alias-completion.c @@ -1,7 +1,7 @@ /* * alias-completion.c - completion for alias commands * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/alias/alias-completion.h b/src/plugins/alias/alias-completion.h index eb5ca1e0d..3808c9319 100644 --- a/src/plugins/alias/alias-completion.h +++ b/src/plugins/alias/alias-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c index 2a892649c..9a2128b39 100644 --- a/src/plugins/alias/alias-config.c +++ b/src/plugins/alias/alias-config.c @@ -1,7 +1,7 @@ /* * alias-config.c - alias configuration options (file alias.conf) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/alias/alias-config.h b/src/plugins/alias/alias-config.h index 9d7ce25ec..714abfcde 100644 --- a/src/plugins/alias/alias-config.h +++ b/src/plugins/alias/alias-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/alias/alias-info.c b/src/plugins/alias/alias-info.c index f91a12487..600f0c8c2 100644 --- a/src/plugins/alias/alias-info.c +++ b/src/plugins/alias/alias-info.c @@ -1,7 +1,7 @@ /* * alias-info.c - info and infolist hooks for alias plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/alias/alias-info.h b/src/plugins/alias/alias-info.h index 3d0a65ba1..a06373a74 100644 --- a/src/plugins/alias/alias-info.h +++ b/src/plugins/alias/alias-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c index d4e3126ff..db02f987c 100644 --- a/src/plugins/alias/alias.c +++ b/src/plugins/alias/alias.c @@ -1,7 +1,7 @@ /* * alias.c - alias plugin for WeeChat: command aliases * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -572,6 +572,33 @@ alias_update_completion (struct t_alias *alias, const char *completion) } /* + * Checks if an alias name is valid: it must not contain any slashes nor + * any spaces. + * + * Returns: + * 1: name is valid + * 0: name is invalid + */ + +int +alias_name_valid (const char *name) +{ + if (!name || !name[0]) + return 0; + + /* no spaces allowed */ + if (strchr (name, ' ')) + return 0; + + /* no slashes allowed */ + if (strchr (name, '/')) + return 0; + + /* name is valid */ + return 1; +} + +/* * Creates a new alias and adds it to alias list. * * Returns pointer to new alias, NULL if error. @@ -582,7 +609,16 @@ alias_new (const char *name, const char *command, const char *completion) { struct t_alias *new_alias, *ptr_alias, *pos_alias; - if (!name || !name[0] || !command || !command[0]) + if (!alias_name_valid (name)) + { + weechat_printf (NULL, + _("%s%s: invalid alias name: \"%s\""), + weechat_prefix ("error"), ALIAS_PLUGIN_NAME, + name); + return NULL; + } + + if (!command || !command[0]) return NULL; while (weechat_string_is_command_char (name)) diff --git a/src/plugins/alias/alias.h b/src/plugins/alias/alias.h index 1fd47f378..58c78a8d4 100644 --- a/src/plugins/alias/alias.h +++ b/src/plugins/alias/alias.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/CMakeLists.txt b/src/plugins/aspell/CMakeLists.txt index 846ef4c4e..2002871af 100644 --- a/src/plugins/aspell/CMakeLists.txt +++ b/src/plugins/aspell/CMakeLists.txt @@ -1,6 +1,6 @@ # # Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> -# Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/aspell/Makefile.am b/src/plugins/aspell/Makefile.am index 70464ca3c..0e50bf45a 100644 --- a/src/plugins/aspell/Makefile.am +++ b/src/plugins/aspell/Makefile.am @@ -1,6 +1,6 @@ # # Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> -# Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/aspell/weechat-aspell-bar-item.c b/src/plugins/aspell/weechat-aspell-bar-item.c index f088cbf0c..c723ce782 100644 --- a/src/plugins/aspell/weechat-aspell-bar-item.c +++ b/src/plugins/aspell/weechat-aspell-bar-item.c @@ -2,7 +2,7 @@ * weechat-aspell-bar-item.c - bar items for aspell plugin * * Copyright (C) 2012 Nils Görs <weechatter@arcor.de> - * Copyright (C) 2012-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2012-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-command.c b/src/plugins/aspell/weechat-aspell-command.c index 343467a36..36b06ece7 100644 --- a/src/plugins/aspell/weechat-aspell-command.c +++ b/src/plugins/aspell/weechat-aspell-command.c @@ -1,7 +1,7 @@ /* * weechat-aspell-command.c - aspell commands * - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-command.h b/src/plugins/aspell/weechat-aspell-command.h index 1cbf8f391..920b00b3b 100644 --- a/src/plugins/aspell/weechat-aspell-command.h +++ b/src/plugins/aspell/weechat-aspell-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-completion.c b/src/plugins/aspell/weechat-aspell-completion.c index f0b3ef191..c095a0091 100644 --- a/src/plugins/aspell/weechat-aspell-completion.c +++ b/src/plugins/aspell/weechat-aspell-completion.c @@ -1,7 +1,7 @@ /* * weechat-aspell-completion.c - completion for aspell commands * - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-completion.h b/src/plugins/aspell/weechat-aspell-completion.h index cba724bb4..afa15770a 100644 --- a/src/plugins/aspell/weechat-aspell-completion.h +++ b/src/plugins/aspell/weechat-aspell-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-config.c b/src/plugins/aspell/weechat-aspell-config.c index ac381359d..ee46731be 100644 --- a/src/plugins/aspell/weechat-aspell-config.c +++ b/src/plugins/aspell/weechat-aspell-config.c @@ -2,7 +2,7 @@ * weechat-aspell-config.c - aspell configuration options (file aspell.conf) * * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-config.h b/src/plugins/aspell/weechat-aspell-config.h index 010350209..266af1774 100644 --- a/src/plugins/aspell/weechat-aspell-config.h +++ b/src/plugins/aspell/weechat-aspell-config.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-info.c b/src/plugins/aspell/weechat-aspell-info.c index 8860c9bba..33e6eed86 100644 --- a/src/plugins/aspell/weechat-aspell-info.c +++ b/src/plugins/aspell/weechat-aspell-info.c @@ -1,7 +1,7 @@ /* * weechat-aspell-info.c - info for aspell plugin * - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-info.h b/src/plugins/aspell/weechat-aspell-info.h index e170709b8..f1b50bc7f 100644 --- a/src/plugins/aspell/weechat-aspell-info.h +++ b/src/plugins/aspell/weechat-aspell-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-speller.c b/src/plugins/aspell/weechat-aspell-speller.c index 460c7509c..fdaee28f5 100644 --- a/src/plugins/aspell/weechat-aspell-speller.c +++ b/src/plugins/aspell/weechat-aspell-speller.c @@ -2,7 +2,7 @@ * weechat-aspell-speller.c - speller management for aspell plugin * * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell-speller.h b/src/plugins/aspell/weechat-aspell-speller.h index cc696f4e2..705afa553 100644 --- a/src/plugins/aspell/weechat-aspell-speller.h +++ b/src/plugins/aspell/weechat-aspell-speller.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c index ae2775b2c..961d2553d 100644 --- a/src/plugins/aspell/weechat-aspell.c +++ b/src/plugins/aspell/weechat-aspell.c @@ -2,7 +2,7 @@ * weechat-aspell.c - aspell plugin for WeeChat: color for misspelled words * * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2012 Nils Görs <weechatter@arcor.de> * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/aspell/weechat-aspell.h b/src/plugins/aspell/weechat-aspell.h index fbcbc3fb8..e947f83bd 100644 --- a/src/plugins/aspell/weechat-aspell.h +++ b/src/plugins/aspell/weechat-aspell.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/charset/CMakeLists.txt b/src/plugins/charset/CMakeLists.txt index 052b46711..16cf17d05 100644 --- a/src/plugins/charset/CMakeLists.txt +++ b/src/plugins/charset/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/charset/Makefile.am b/src/plugins/charset/Makefile.am index 9f746b83f..1a2ed9805 100644 --- a/src/plugins/charset/Makefile.am +++ b/src/plugins/charset/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c index ad275e848..7e6a50baf 100644 --- a/src/plugins/charset/charset.c +++ b/src/plugins/charset/charset.c @@ -1,7 +1,7 @@ /* * charset.c - charset plugin for WeeChat: encode/decode strings * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/CMakeLists.txt b/src/plugins/exec/CMakeLists.txt index f250dc720..8c1e115ed 100644 --- a/src/plugins/exec/CMakeLists.txt +++ b/src/plugins/exec/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/exec/Makefile.am b/src/plugins/exec/Makefile.am index 9413e12e2..eb1908724 100644 --- a/src/plugins/exec/Makefile.am +++ b/src/plugins/exec/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/exec/exec-buffer.c b/src/plugins/exec/exec-buffer.c index 48c8f3e5c..1339dbd5b 100644 --- a/src/plugins/exec/exec-buffer.c +++ b/src/plugins/exec/exec-buffer.c @@ -1,7 +1,7 @@ /* * exec-buffer.c - buffers with output of commands * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec-buffer.h b/src/plugins/exec/exec-buffer.h index 0b7f1a956..d0ee022ee 100644 --- a/src/plugins/exec/exec-buffer.h +++ b/src/plugins/exec/exec-buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c index 4d75f6dd6..dbe692c3f 100644 --- a/src/plugins/exec/exec-command.c +++ b/src/plugins/exec/exec-command.c @@ -1,7 +1,7 @@ /* * exec-command.c - exec command * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec-command.h b/src/plugins/exec/exec-command.h index ab5fb474e..eb4d737fe 100644 --- a/src/plugins/exec/exec-command.h +++ b/src/plugins/exec/exec-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec-completion.c b/src/plugins/exec/exec-completion.c index 9eb430cad..d243f6692 100644 --- a/src/plugins/exec/exec-completion.c +++ b/src/plugins/exec/exec-completion.c @@ -1,7 +1,7 @@ /* * exec-completion.c - completion for exec commands * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec-completion.h b/src/plugins/exec/exec-completion.h index 7012ac6e7..4b6bf8c8b 100644 --- a/src/plugins/exec/exec-completion.h +++ b/src/plugins/exec/exec-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec-config.c b/src/plugins/exec/exec-config.c index 8c4145fe8..7ead68550 100644 --- a/src/plugins/exec/exec-config.c +++ b/src/plugins/exec/exec-config.c @@ -1,7 +1,7 @@ /* * exec-config.c - exec configuration options (file exec.conf) * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec-config.h b/src/plugins/exec/exec-config.h index 679bafac1..04ebcb065 100644 --- a/src/plugins/exec/exec-config.h +++ b/src/plugins/exec/exec-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c index 7363700b4..3922a1154 100644 --- a/src/plugins/exec/exec.c +++ b/src/plugins/exec/exec.c @@ -1,7 +1,7 @@ /* * exec.c - execution of external commands in WeeChat * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/exec/exec.h b/src/plugins/exec/exec.h index 2efea0402..e54187a73 100644 --- a/src/plugins/exec/exec.h +++ b/src/plugins/exec/exec.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/fifo/CMakeLists.txt b/src/plugins/fifo/CMakeLists.txt index 9a547d86e..b1c27b62f 100644 --- a/src/plugins/fifo/CMakeLists.txt +++ b/src/plugins/fifo/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # @@ -19,6 +19,7 @@ add_library(fifo MODULE fifo.c fifo.h +fifo-command.c fifo-command.h fifo-info.c fifo-info.h) set_target_properties(fifo PROPERTIES PREFIX "") diff --git a/src/plugins/fifo/Makefile.am b/src/plugins/fifo/Makefile.am index b7fb2ec7e..8a51e9fb2 100644 --- a/src/plugins/fifo/Makefile.am +++ b/src/plugins/fifo/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # @@ -25,6 +25,8 @@ lib_LTLIBRARIES = fifo.la fifo_la_SOURCES = fifo.c \ fifo.h \ + fifo-command.c \ + fifo-command.h \ fifo-info.c \ fifo-info.h fifo_la_LDFLAGS = -module -no-undefined diff --git a/src/plugins/fifo/fifo-command.c b/src/plugins/fifo/fifo-command.c new file mode 100644 index 000000000..ece6ea646 --- /dev/null +++ b/src/plugins/fifo/fifo-command.c @@ -0,0 +1,117 @@ +/* + * fifo-command.c - fifo command + * + * Copyright (C) 2003-2016 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 <stdlib.h> + +#include "../weechat-plugin.h" +#include "fifo.h" + + +/* + * Callback for command "/fifo": manages FIFO pipe. + */ + +int +fifo_command_fifo (void *data, struct t_gui_buffer *buffer, int argc, + char **argv, char **argv_eol) +{ + /* make C compiler happy */ + (void) data; + (void) buffer; + (void) argv_eol; + + if (argc == 1) + { + if (fifo_fd != -1) + { + weechat_printf (NULL, + _("%s: pipe is enabled (file: %s)"), + FIFO_PLUGIN_NAME, + fifo_filename); + } + else + { + weechat_printf (NULL, + _("%s: pipe is disabled"), FIFO_PLUGIN_NAME); + } + return WEECHAT_RC_OK; + } + + /* enable pipe */ + if (weechat_strcasecmp (argv[1], "enable") == 0) + { + weechat_config_set_plugin (FIFO_OPTION_NAME, "on"); + return WEECHAT_RC_OK; + } + + /* disable pipe */ + if (weechat_strcasecmp (argv[1], "disable") == 0) + { + weechat_config_set_plugin (FIFO_OPTION_NAME, "off"); + return WEECHAT_RC_OK; + } + + /* toggle pipe */ + if (weechat_strcasecmp (argv[1], "toggle") == 0) + { + weechat_config_set_plugin (FIFO_OPTION_NAME, + (fifo_fd == -1) ? "on" : "off"); + return WEECHAT_RC_OK; + } + + WEECHAT_COMMAND_ERROR; +} + +/* + * Hooks fifo command. + */ + +void +fifo_command_init () +{ + weechat_hook_command ( + "fifo", + N_("fifo plugin configuration"), + N_("enable|disable|toggle"), + N_(" enable: enable FIFO pipe\n" + "disable: disable FIFO pipe\n" + " toggle: toggle FIFO pipe\n" + "\n" + "FIFO pipe is used as remote control of WeeChat: you can send " + "commands or text to the FIFO pipe from your shell.\n" + "By default the FIFO pipe is in ~/.weechat/weechat_fifo_xxx " + "(\"xxx\" is the WeeChat PID).\n" + "\n" + "The expected format is one of:\n" + " plugin.buffer *text or command here\n" + " *text or command here\n" + "\n" + "For example to change your freenode nick:\n" + " echo 'irc.server.freenode */nick newnick' " + ">~/.weechat/weechat_fifo_12345\n" + "\n" + "Please read the user's guide for more info and examples.\n" + "\n" + "Examples:\n" + " /fifo toggle"), + "enable|disable|toggle", + &fifo_command_fifo, NULL); +} diff --git a/src/plugins/fifo/fifo-command.h b/src/plugins/fifo/fifo-command.h new file mode 100644 index 000000000..0b7f29b81 --- /dev/null +++ b/src/plugins/fifo/fifo-command.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2003-2016 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_FIFO_COMMAND_H +#define WEECHAT_FIFO_COMMAND_H 1 + +extern void fifo_command_init (); + +#endif /* WEECHAT_FIFO_COMMAND_H */ diff --git a/src/plugins/fifo/fifo-info.c b/src/plugins/fifo/fifo-info.c index 6c5fe2d35..dd709fb9f 100644 --- a/src/plugins/fifo/fifo-info.c +++ b/src/plugins/fifo/fifo-info.c @@ -1,7 +1,7 @@ /* * fifo-info.c - info and infolist hooks for fifo plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/fifo/fifo-info.h b/src/plugins/fifo/fifo-info.h index 234c0b6ab..0a41e7817 100644 --- a/src/plugins/fifo/fifo-info.h +++ b/src/plugins/fifo/fifo-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c index 8694b57c8..4331eeafa 100644 --- a/src/plugins/fifo/fifo.c +++ b/src/plugins/fifo/fifo.c @@ -1,7 +1,7 @@ /* * fifo.c - fifo plugin for WeeChat: remote control with FIFO pipe * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -32,6 +32,7 @@ #include "../weechat-plugin.h" #include "fifo.h" +#include "fifo-command.h" #include "fifo-info.h" @@ -158,8 +159,9 @@ fifo_create () if ((weechat_fifo_plugin->debug >= 1) || !fifo_quiet) { weechat_printf (NULL, - _("%s: pipe opened"), - FIFO_PLUGIN_NAME); + _("%s: pipe opened (file: %s)"), + FIFO_PLUGIN_NAME, + fifo_filename); } fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0, &fifo_read, NULL); @@ -259,7 +261,7 @@ fifo_exec (const char *text) if (!pos_msg) { weechat_printf (NULL, - _("%s%s: error, invalid text received on pipe"), + _("%s%s: invalid text received in pipe"), weechat_prefix ("error"), FIFO_PLUGIN_NAME); free (text2); return; @@ -267,15 +269,15 @@ fifo_exec (const char *text) pos_msg[0] = '\0'; pos_msg += 2; ptr_buffer = weechat_buffer_search ("==", text2); - } - - if (!ptr_buffer) - { - weechat_printf (NULL, - _("%s%s: error, buffer not found for pipe data"), - weechat_prefix ("error"), FIFO_PLUGIN_NAME); - free (text2); - return; + if (!ptr_buffer) + { + weechat_printf (NULL, + _("%s%s: buffer \"%s\" not found"), + weechat_prefix ("error"), FIFO_PLUGIN_NAME, + text2); + free (text2); + return; + } } weechat_command (ptr_buffer, pos_msg); @@ -424,6 +426,8 @@ fifo_config_cb (void *data, const char *option, const char *value) int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { + char str_option[256]; + /* make C compiler happy */ (void) argc; (void) argv; @@ -434,8 +438,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) fifo_create (); - weechat_hook_config ("plugins.var.fifo.fifo", &fifo_config_cb, NULL); + snprintf (str_option, sizeof (str_option), + "plugins.var.fifo.%s", FIFO_OPTION_NAME); + weechat_hook_config (str_option, &fifo_config_cb, NULL); + fifo_command_init (); fifo_info_init (); fifo_quiet = 0; diff --git a/src/plugins/fifo/fifo.h b/src/plugins/fifo/fifo.h index 008251ef5..35eb72b0d 100644 --- a/src/plugins/fifo/fifo.h +++ b/src/plugins/fifo/fifo.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -22,8 +22,10 @@ #define weechat_plugin weechat_fifo_plugin #define FIFO_PLUGIN_NAME "fifo" +#define FIFO_OPTION_NAME "fifo" extern struct t_weechat_plugin *weechat_fifo_plugin; +extern int fifo_fd; extern char *fifo_filename; #endif /* WEECHAT_FIFO_H */ diff --git a/src/plugins/guile/CMakeLists.txt b/src/plugins/guile/CMakeLists.txt index 3076fe948..16bfa4c0c 100644 --- a/src/plugins/guile/CMakeLists.txt +++ b/src/plugins/guile/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2011-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2011-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/guile/Makefile.am b/src/plugins/guile/Makefile.am index 5ef2cded9..170fecef1 100644 --- a/src/plugins/guile/Makefile.am +++ b/src/plugins/guile/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2011-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2011-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index 676a85e50..3ac2b766a 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -1,7 +1,7 @@ /* * weechat-guile-api.c - guile API functions * - * Copyright (C) 2011-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2011-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2012 Simon Arlott * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/guile/weechat-guile-api.h b/src/plugins/guile/weechat-guile-api.h index 42dae4a4c..91d05b6d2 100644 --- a/src/plugins/guile/weechat-guile-api.h +++ b/src/plugins/guile/weechat-guile-api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2011-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c index fa962ea43..85d49e76d 100644 --- a/src/plugins/guile/weechat-guile.c +++ b/src/plugins/guile/weechat-guile.c @@ -1,7 +1,7 @@ /* * weechat-guile.c - guile (scheme) plugin for WeeChat * - * Copyright (C) 2011-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2011-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/guile/weechat-guile.h b/src/plugins/guile/weechat-guile.h index 7d5446568..537757623 100644 --- a/src/plugins/guile/weechat-guile.h +++ b/src/plugins/guile/weechat-guile.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2011-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/CMakeLists.txt b/src/plugins/irc/CMakeLists.txt index 399dc89c4..b773dcf3e 100644 --- a/src/plugins/irc/CMakeLists.txt +++ b/src/plugins/irc/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/irc/Makefile.am b/src/plugins/irc/Makefile.am index 85af3f343..a086e3edf 100644 --- a/src/plugins/irc/Makefile.am +++ b/src/plugins/irc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c index 740a6f6a9..08c365bf6 100644 --- a/src/plugins/irc/irc-bar-item.c +++ b/src/plugins/irc/irc-bar-item.c @@ -1,7 +1,7 @@ /* * irc-bar-item.c - bar items for IRC plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-bar-item.h b/src/plugins/irc/irc-bar-item.h index 688e9f665..948abd75d 100644 --- a/src/plugins/irc/irc-bar-item.h +++ b/src/plugins/irc/irc-bar-item.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-buffer.c b/src/plugins/irc/irc-buffer.c index a1be1c361..f7df9d267 100644 --- a/src/plugins/irc/irc-buffer.c +++ b/src/plugins/irc/irc-buffer.c @@ -1,7 +1,7 @@ /* * irc-buffer.c - buffer functions for IRC plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-buffer.h b/src/plugins/irc/irc-buffer.h index e02ffea1e..b31a5c2bb 100644 --- a/src/plugins/irc/irc-buffer.h +++ b/src/plugins/irc/irc-buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 11d0c4df1..fe7b92863 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -1,7 +1,7 @@ /* * irc-channel.c - channel and private chat management for IRC plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -655,7 +655,7 @@ irc_channel_remove_account (struct t_irc_server *server, { if (ptr_nick->account) free (ptr_nick->account); - ptr_nick->account = strdup ("*"); + ptr_nick->account = NULL; } } } diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h index 08f7f1e9b..479dbba45 100644 --- a/src/plugins/irc/irc-channel.h +++ b/src/plugins/irc/irc-channel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -78,6 +78,11 @@ struct t_irc_channel extern int irc_channel_valid (struct t_irc_server *server, struct t_irc_channel *channel); +extern struct t_irc_channel *irc_channel_search (struct t_irc_server *server, + const char *channel_name); +extern struct t_gui_buffer *irc_channel_search_buffer (struct t_irc_server *server, + int channel_type, + const char *channel_name); extern struct t_gui_buffer *irc_channel_create_buffer (struct t_irc_server *server, int channel_type, const char *channel_name, @@ -98,8 +103,6 @@ extern void irc_channel_set_modes (struct t_irc_channel *channel, extern void irc_channel_free (struct t_irc_server *server, struct t_irc_channel *channel); extern void irc_channel_free_all (struct t_irc_server *server); -extern struct t_irc_channel *irc_channel_search (struct t_irc_server *server, - const char *channel_name); extern int irc_channel_is_channel (struct t_irc_server *server, const char *string); extern const char *irc_channel_get_auto_chantype (struct t_irc_server *server, diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index f5f4d2688..194a32ac3 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -1,7 +1,7 @@ /* * irc-color.c - IRC color decoding/encoding in messages * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index cc8f58bf6..9425db0ac 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index a5bb53559..d3fa3becf 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -1,7 +1,7 @@ /* * irc-command.c - IRC commands * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. @@ -1366,69 +1366,106 @@ int irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - char *irc_cmd, str_time[512]; + char **targets, *ctcp_type, str_time[512]; + const char *ctcp_target, *ctcp_args; + int num_targets, arg_target, arg_type, arg_args, i; struct timeval tv; - IRC_BUFFER_GET_SERVER(buffer); - IRC_COMMAND_CHECK_SERVER("ctcp", 1); + IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); - irc_cmd = strdup (argv[2]); - if (!irc_cmd) + arg_target = 1; + arg_type = 2; + arg_args = 3; + + if ((argc >= 5) && (weechat_strcasecmp (argv[1], "-server") == 0)) + { + ptr_server = irc_server_search (argv[2]); + ptr_channel = NULL; + arg_target = 3; + arg_type = 4; + arg_args = 5; + } + + IRC_COMMAND_CHECK_SERVER("ctcp", 1); + + targets = weechat_string_split (argv[arg_target], ",", 0, 0, &num_targets); + if (!targets) + WEECHAT_COMMAND_ERROR; + + ctcp_type = strdup (argv[arg_type]); + if (!ctcp_type) + { + weechat_string_free_split (targets); WEECHAT_COMMAND_ERROR; + } - weechat_string_toupper (irc_cmd); + weechat_string_toupper (ctcp_type); - if ((weechat_strcasecmp (argv[2], "ping") == 0) && !argv_eol[3]) + if ((strcmp (ctcp_type, "PING") == 0) && !argv_eol[arg_args]) { + /* generate argument for PING if not provided */ gettimeofday (&tv, NULL); snprintf (str_time, sizeof (str_time), "%ld %ld", (long)tv.tv_sec, (long)tv.tv_usec); - 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_msg (ptr_server, 0, NULL, argv[1]), - argv[1], - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - irc_cmd, - IRC_COLOR_RESET, - " ", - str_time); + ctcp_args = str_time; } else { - irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :\01%s%s%s\01", - argv[1], - 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_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); + ctcp_args = argv_eol[arg_args]; + } + + for (i = 0; i < num_targets; i++) + { + ctcp_target = targets[i]; + + if (strcmp (targets[i], "*") == 0) + { + if (!ptr_channel + || ((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, "ctcp *"); + ctcp_target = NULL; + } + else + ctcp_target = ptr_channel->name; + } + + if (ctcp_target) + { + irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "PRIVMSG %s :\01%s%s%s\01", + ctcp_target, + ctcp_type, + (ctcp_args) ? " " : "", + (ctcp_args) ? ctcp_args : ""); + weechat_printf ( + irc_msgbuffer_get_target_buffer ( + ptr_server, ctcp_target, 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, ctcp_target), + ctcp_target, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + ctcp_type, + IRC_COLOR_RESET, + (ctcp_args) ? " " : "", + (ctcp_args) ? ctcp_args : ""); + } + } + + free (ctcp_type); + weechat_string_free_split (targets); return WEECHAT_RC_OK; } @@ -3069,6 +3106,7 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, char **targets, *msg_pwd_hidden, *string; int num_targets, i, j, arg_target, arg_text, is_channel, status_msg; int hide_password; + struct t_irc_channel *ptr_channel2; IRC_BUFFER_GET_SERVER_CHANNEL(buffer); @@ -3108,42 +3146,46 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, _("%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], - weechat_config_boolean (irc_config_network_colors_send)); - irc_input_user_message_display (ptr_channel->buffer, 0, - (string) ? string : argv_eol[arg_text]); - if (string) - free (string); + else + { + string = irc_color_decode ( + argv_eol[arg_text], + weechat_config_boolean (irc_config_network_colors_send)); + irc_input_user_message_display ( + ptr_channel->buffer, 0, + (string) ? string : argv_eol[arg_text]); + if (string) + free (string); - irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :%s", - ptr_channel->name, argv_eol[arg_text]); + irc_server_sendf (ptr_server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "PRIVMSG %s :%s", + ptr_channel->name, argv_eol[arg_text]); + } } else { is_channel = 0; - ptr_channel = NULL; + ptr_channel2 = NULL; status_msg = 0; if (irc_server_prefix_char_statusmsg (ptr_server, targets[i][0]) && irc_channel_is_channel (ptr_server, targets[i] + 1)) { - ptr_channel = irc_channel_search (ptr_server, targets[i] + 1); + ptr_channel2 = irc_channel_search (ptr_server, targets[i] + 1); is_channel = 1; status_msg = 1; } else { - ptr_channel = irc_channel_search (ptr_server, targets[i]); - if (ptr_channel) + ptr_channel2 = irc_channel_search (ptr_server, targets[i]); + if (ptr_channel2) is_channel = 1; } if (is_channel) { - if (ptr_channel) + if (ptr_channel2) { string = irc_color_decode ( argv_eol[arg_text], @@ -3155,7 +3197,7 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, * (to "@#channel" or "+#channel") */ weechat_printf_tags ( - ptr_channel->buffer, + ptr_channel2->buffer, "notify_none,no_highlight", "%s%s%s -> %s%s%s: %s", weechat_prefix ("network"), @@ -3170,7 +3212,7 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, { /* standard message (to "#channel") */ irc_input_user_message_display ( - ptr_channel->buffer, + ptr_channel2->buffer, 0, (string) ? string : argv_eol[arg_text]); } @@ -3231,12 +3273,12 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, 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) + ptr_channel2 = irc_channel_search (ptr_server, + targets[i]); + if (ptr_channel2) { irc_input_user_message_display ( - ptr_channel->buffer, + ptr_channel2->buffer, 0, (string) ? string : argv_eol[arg_text]); } @@ -4532,7 +4574,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) else weechat_printf (NULL, " ipv6 . . . . . . . . : %s%s", IRC_COLOR_CHAT_VALUE, - weechat_config_boolean (server->options[IRC_SERVER_OPTION_IPV6]) ? + (weechat_config_boolean (server->options[IRC_SERVER_OPTION_IPV6])) ? _("on") : _("off")); /* ssl */ if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_SSL])) @@ -4542,7 +4584,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) else weechat_printf (NULL, " ssl. . . . . . . . . : %s%s", IRC_COLOR_CHAT_VALUE, - weechat_config_boolean (server->options[IRC_SERVER_OPTION_SSL]) ? + (weechat_config_boolean (server->options[IRC_SERVER_OPTION_SSL])) ? _("on") : _("off")); /* ssl_cert */ if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_SSL_CERT])) @@ -4584,7 +4626,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) else weechat_printf (NULL, " ssl_verify . . . . . : %s%s", IRC_COLOR_CHAT_VALUE, - weechat_config_boolean (server->options[IRC_SERVER_OPTION_SSL_VERIFY]) ? + (weechat_config_boolean (server->options[IRC_SERVER_OPTION_SSL_VERIFY])) ? _("on") : _("off")); /* password */ if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_PASSWORD])) @@ -4660,7 +4702,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) else weechat_printf (NULL, " autoconnect. . . . . : %s%s", IRC_COLOR_CHAT_VALUE, - weechat_config_boolean (server->options[IRC_SERVER_OPTION_AUTOCONNECT]) ? + (weechat_config_boolean (server->options[IRC_SERVER_OPTION_AUTOCONNECT])) ? _("on") : _("off")); /* autoreconnect */ if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_AUTORECONNECT])) @@ -4670,7 +4712,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) else weechat_printf (NULL, " autoreconnect. . . . : %s%s", IRC_COLOR_CHAT_VALUE, - weechat_config_boolean (server->options[IRC_SERVER_OPTION_AUTORECONNECT]) ? + (weechat_config_boolean (server->options[IRC_SERVER_OPTION_AUTORECONNECT])) ? _("on") : _("off")); /* autoreconnect_delay */ if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_AUTORECONNECT_DELAY])) @@ -4690,6 +4732,16 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) weechat_printf (NULL, " nicks. . . . . . . . : %s'%s'", IRC_COLOR_CHAT_VALUE, weechat_config_string (server->options[IRC_SERVER_OPTION_NICKS])); + /* nicks_alternate */ + if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_NICKS_ALTERNATE])) + weechat_printf (NULL, " nicks_alternate. . . : (%s)", + (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_NICKS_ALTERNATE)) ? + _("on") : _("off")); + else + weechat_printf (NULL, " nicks_alternate. . . : %s%s", + IRC_COLOR_CHAT_VALUE, + (weechat_config_boolean (server->options[IRC_SERVER_OPTION_NICKS_ALTERNATE])) ? + _("on") : _("off")); /* username */ if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_USERNAME])) weechat_printf (NULL, " username . . . . . . : ('%s')", @@ -4762,7 +4814,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) else weechat_printf (NULL, " autorejoin . . . . . : %s%s", IRC_COLOR_CHAT_VALUE, - weechat_config_boolean (server->options[IRC_SERVER_OPTION_AUTOREJOIN]) ? + (weechat_config_boolean (server->options[IRC_SERVER_OPTION_AUTOREJOIN])) ? _("on") : _("off")); /* autorejoin_delay */ if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_AUTOREJOIN_DELAY])) @@ -6138,19 +6190,18 @@ irc_command_init () "cap", N_("client capability negotiation"), N_("ls || list || req|ack [<capability> [<capability>...]]" - " || clear || end"), + " || end"), N_(" ls: list the capabilities supported by the server\n" " list: list the capabilities currently enabled\n" " req: request a capability\n" " ack: acknowledge capabilities which require client-side " "acknowledgement\n" - "clear: clear the capabilities currently enabled\n" " end: end the capability negotiation\n" "\n" "Without argument, \"ls\" and \"list\" are sent.\n" "\n" "Capabilities supported by WeeChat are: " - "account-notify, away-notify, extended-join, " + "account-notify, away-notify, cap-notify, extended-join, " "multi-prefix, server-time, userhost-in-names.\n" "\n" "The capabilities to automatically enable on servers can be set " @@ -6159,13 +6210,11 @@ irc_command_init () "\n" "Examples:\n" " /cap\n" - " /cap req multi-prefix\n" - " /cap clear"), + " /cap req multi-prefix away-notify"), "ls" " || list" " || req " IRC_COMMAND_CAP_SUPPORTED_COMPLETION " || ack " IRC_COMMAND_CAP_SUPPORTED_COMPLETION - " || clear" " || end", &irc_command_cap, NULL); weechat_hook_command ( @@ -6209,12 +6258,20 @@ irc_command_init () weechat_hook_command ( "ctcp", N_("send a CTCP message (Client-To-Client Protocol)"), - N_("<target> <type> [<arguments>]"), - N_(" target: nick or channel name to send CTCP to\n" - " type: CTCP type (examples: \"version\", \"ping\", ..)\n" - "arguments: arguments for CTCP"), - "%(irc_channel)|%(nicks) action|clientinfo|finger|ping|source|time|" - "userinfo|version", + N_("[-server <server>] <target>[,<target>...] <type> [<arguments>]"), + N_(" server: send to this server (internal name)\n" + " target: nick or channel ('*' = current channel)\n" + " type: CTCP type (examples: \"version\", \"ping\", ..)\n" + "arguments: arguments for CTCP\n" + "\n" + "Examples:\n" + " /ctcp toto time\n" + " /ctcp toto version\n" + " /ctcp * version"), + "-server %(irc_servers) %(irc_channel)|%(nicks)|* " + IRC_COMMAND_CTCP_SUPPORTED_COMPLETION + " || %(irc_channel)|%(nicks)|* " + IRC_COMMAND_CTCP_SUPPORTED_COMPLETION, &irc_command_ctcp, NULL); weechat_hook_command ( "cycle", @@ -6481,8 +6538,8 @@ 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) %(nicks)" - " || %(nicks)", + "-server %(irc_servers) %(nicks)|*" + " || %(nicks)|*", &irc_command_msg, NULL); weechat_hook_command ( "names", diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h index 358bc6385..ac48c941f 100644 --- a/src/plugins/irc/irc-command.h +++ b/src/plugins/irc/irc-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -45,9 +45,12 @@ struct t_irc_channel; /* list of supported capabilities (for completion in command /cap) */ #define IRC_COMMAND_CAP_SUPPORTED_COMPLETION \ - "account-notify|away-notify|extended-join|" \ - "multi-prefix|server-time|userhost-in-names" \ - "|%*" + "account-notify|away-notify|cap-notify|extended-join|" \ + "multi-prefix|server-time|userhost-in-names|%*" + +/* list of supported CTCPs (for completion in command /ctcp) */ +#define IRC_COMMAND_CTCP_SUPPORTED_COMPLETION \ + "action|clientinfo|finger|ping|source|time|userinfo|version" extern void irc_command_away_server (struct t_irc_server *server, const char *arguments, diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c index 831429fe9..153bad8d6 100644 --- a/src/plugins/irc/irc-completion.c +++ b/src/plugins/irc/irc-completion.c @@ -1,7 +1,7 @@ /* * irc-completion.c - completion for IRC commands * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -93,26 +93,32 @@ irc_completion_server_channels_cb (void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { - struct t_irc_channel *ptr_channel; + struct t_irc_channel *ptr_channel2; - IRC_BUFFER_GET_SERVER(buffer); + IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ (void) data; (void) completion_item; - (void) buffer; if (ptr_server) { - for (ptr_channel = ptr_server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) + for (ptr_channel2 = ptr_server->channels; ptr_channel2; + ptr_channel2 = ptr_channel2->next_channel) { - if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) + if (ptr_channel2->type == IRC_CHANNEL_TYPE_CHANNEL) { - weechat_hook_completion_list_add (completion, ptr_channel->name, + weechat_hook_completion_list_add (completion, ptr_channel2->name, 0, WEECHAT_LIST_POS_SORT); } } + + /* add current channel first in list */ + if (ptr_channel) + { + weechat_hook_completion_list_add (completion, ptr_channel->name, + 0, WEECHAT_LIST_POS_BEGINNING); + } } return WEECHAT_RC_OK; @@ -134,7 +140,6 @@ irc_completion_server_privates_cb (void *data, const char *completion_item, /* make C compiler happy */ (void) data; (void) completion_item; - (void) buffer; if (ptr_server) { @@ -458,28 +463,65 @@ irc_completion_channels_cb (void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { - struct t_irc_server *ptr_server; - struct t_irc_channel *ptr_channel; + struct t_irc_server *ptr_server2; + struct t_irc_channel *ptr_channel2; + struct t_weelist *channels_current_server; + int i; + + IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ (void) data; (void) completion_item; - (void) buffer; - for (ptr_server = irc_servers; ptr_server; - ptr_server = ptr_server->next_server) + channels_current_server = weechat_list_new (); + + for (ptr_server2 = irc_servers; ptr_server2; + ptr_server2 = ptr_server2->next_server) { - for (ptr_channel = ptr_server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) + for (ptr_channel2 = ptr_server2->channels; ptr_channel2; + ptr_channel2 = ptr_channel2->next_channel) { - if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) + if (ptr_channel2->type == IRC_CHANNEL_TYPE_CHANNEL) { - weechat_hook_completion_list_add (completion, ptr_channel->name, - 0, WEECHAT_LIST_POS_SORT); + if (ptr_server2 == ptr_server) + { + /* will be added later to completions */ + weechat_list_add (channels_current_server, + ptr_channel2->name, + WEECHAT_LIST_POS_SORT, + NULL); + } + else + { + weechat_hook_completion_list_add (completion, + ptr_channel2->name, + 0, + WEECHAT_LIST_POS_SORT); + } } } } + /* add channels of current server first in list */ + for (i = weechat_list_size (channels_current_server) - 1; i >= 0; i--) + { + weechat_hook_completion_list_add ( + completion, + weechat_list_string ( + weechat_list_get (channels_current_server, i)), + 0, + WEECHAT_LIST_POS_BEGINNING); + } + weechat_list_free (channels_current_server); + + /* add current channel first in list */ + if (ptr_channel) + { + weechat_hook_completion_list_add (completion, ptr_channel->name, + 0, WEECHAT_LIST_POS_BEGINNING); + } + return WEECHAT_RC_OK; } diff --git a/src/plugins/irc/irc-completion.h b/src/plugins/irc/irc-completion.h index aa2eb1a6f..20dacb576 100644 --- a/src/plugins/irc/irc-completion.h +++ b/src/plugins/irc/irc-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index fa879e4f8..20b6aff58 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -1,7 +1,7 @@ /* * irc-config.c - IRC configuration options (file irc.conf) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -131,7 +131,6 @@ struct t_config_option *irc_config_color_topic_old; /* IRC config, network section */ -struct t_config_option *irc_config_network_alternate_nick; struct t_config_option *irc_config_network_autoreconnect_delay_growing; struct t_config_option *irc_config_network_autoreconnect_delay_max; struct t_config_option *irc_config_network_ban_mask_default; @@ -1594,7 +1593,8 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "string", N_("list of hostname/port or IP/port for server (separated by " - "comma)"), + "comma) " + "(note: content is evaluated, see /help eval)"), NULL, 0, 0, default_value, value, null_value_allowed, @@ -1885,6 +1885,22 @@ irc_config_server_new_option (struct t_config_file *config_file, callback_change, callback_change_data, NULL, NULL); break; + case IRC_SERVER_OPTION_NICKS_ALTERNATE: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "boolean", + N_("get an alternate nick when all the declared nicks are " + "already used on server: add some \"_\" until the nick has " + "a length of 9, and then replace last char (or the two " + "last chars) by a number from 1 to 99, until we find " + "a nick not used on server"), + NULL, 0, 0, + default_value, value, + null_value_allowed, + callback_check_value, callback_check_value_data, + callback_change, callback_change_data, + NULL, NULL); + break; case IRC_SERVER_OPTION_USERNAME: new_option = weechat_config_new_option ( config_file, section, @@ -2893,8 +2909,8 @@ irc_config_init () "found, WeeChat will try with next modes received from server " "(\"PREFIX\"); a special mode \"*\" can be used as default color " "if no mode has been found in list)"), - NULL, 0, 0, "q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;" - "v:yellow;*:lightblue", NULL, 0, NULL, NULL, + NULL, 0, 0, "y:lightred;q:lightred;a:lightcyan;o:lightgreen;" + "h:lightmagenta;v:yellow;*:lightblue", NULL, 0, NULL, NULL, &irc_config_change_color_nick_prefixes, NULL, NULL, NULL); irc_config_color_notice = weechat_config_new_option ( irc_config_file, ptr_section, @@ -2940,14 +2956,6 @@ irc_config_init () return 0; } - irc_config_network_alternate_nick = weechat_config_new_option ( - irc_config_file, ptr_section, - "alternate_nick", "boolean", - N_("get an alternate nick when the nick is already used on server: add " - "some \"_\" until the nick has a length of 9, and then replace last " - "char (or the two last chars) by a number from 1 to 99, until we " - "find a nick not used on server"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_autoreconnect_delay_growing = weechat_config_new_option ( irc_config_file, ptr_section, "autoreconnect_delay_growing", "integer", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index cd0a766b5..caca3f6aa 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -172,7 +172,6 @@ extern struct t_config_option *irc_config_color_topic_current; extern struct t_config_option *irc_config_color_topic_new; extern struct t_config_option *irc_config_color_topic_old; -extern struct t_config_option *irc_config_network_alternate_nick; extern struct t_config_option *irc_config_network_autoreconnect_delay_growing; extern struct t_config_option *irc_config_network_autoreconnect_delay_max; extern struct t_config_option *irc_config_network_ban_mask_default; diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c index 55d7c6b2e..081a5414a 100644 --- a/src/plugins/irc/irc-ctcp.c +++ b/src/plugins/irc/irc-ctcp.c @@ -1,7 +1,7 @@ /* * irc-ctcp.c - IRC CTCP protocol * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-ctcp.h b/src/plugins/irc/irc-ctcp.h index 179f2ed21..0febcd0cc 100644 --- a/src/plugins/irc/irc-ctcp.h +++ b/src/plugins/irc/irc-ctcp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-debug.c b/src/plugins/irc/irc-debug.c index ea33f0a37..9e8ffca6d 100644 --- a/src/plugins/irc/irc-debug.c +++ b/src/plugins/irc/irc-debug.c @@ -1,7 +1,7 @@ /* * irc-debug.c - debug functions for IRC plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-debug.h b/src/plugins/irc/irc-debug.h index 199d9e7af..8daa12139 100644 --- a/src/plugins/irc/irc-debug.h +++ b/src/plugins/irc/irc-debug.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-ignore.c b/src/plugins/irc/irc-ignore.c index 2f18a4fea..4ef33d3ad 100644 --- a/src/plugins/irc/irc-ignore.c +++ b/src/plugins/irc/irc-ignore.c @@ -1,7 +1,7 @@ /* * irc-ignore.c - ignore (nicks/hosts) management for IRC plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-ignore.h b/src/plugins/irc/irc-ignore.h index 70d37c85f..9a8284903 100644 --- a/src/plugins/irc/irc-ignore.h +++ b/src/plugins/irc/irc-ignore.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c index f905a6a4b..46c9c1a8f 100644 --- a/src/plugins/irc/irc-info.c +++ b/src/plugins/irc/irc-info.c @@ -1,7 +1,7 @@ /* * irc-info.c - info, infolist and hdata hooks for IRC plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-info.h b/src/plugins/irc/irc-info.h index 888a1d93a..7f50323a8 100644 --- a/src/plugins/irc/irc-info.h +++ b/src/plugins/irc/irc-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c index f7e3b5af3..81cbcc044 100644 --- a/src/plugins/irc/irc-input.c +++ b/src/plugins/irc/irc-input.c @@ -1,7 +1,7 @@ /* * irc-input.c - input data management for IRC buffers * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-input.h b/src/plugins/irc/irc-input.h index f4fc4bdb4..9a7988102 100644 --- a/src/plugins/irc/irc-input.h +++ b/src/plugins/irc/irc-input.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index e0c4dcf4f..1524a9f3b 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -1,7 +1,7 @@ /* * irc-message.c - functions for IRC messages * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -70,7 +70,7 @@ irc_message_parse (struct t_irc_server *server, const char *message, int *pos_command, int *pos_arguments, int *pos_channel, int *pos_text) { - const char *ptr_message, *pos, *pos2, *pos3, *pos4; + const char *ptr_message, *pos, *pos2, *pos3, *pos4, *ptr_channel_found; if (tags) *tags = NULL; @@ -96,6 +96,7 @@ irc_message_parse (struct t_irc_server *server, const char *message, *pos_channel = -1; if (pos_text) *pos_text = -1; + ptr_channel_found = NULL; if (!message) return; @@ -209,6 +210,7 @@ irc_message_parse (struct t_irc_server *server, const char *message, { if (irc_channel_is_channel (server, pos)) { + ptr_channel_found = pos; pos2 = strchr (pos, ' '); if (channel) { @@ -253,6 +255,7 @@ irc_message_parse (struct t_irc_server *server, const char *message, } if (irc_channel_is_channel (server, pos2)) { + ptr_channel_found = pos2; pos4 = strchr (pos2, ' '); if (channel) { @@ -277,13 +280,38 @@ irc_message_parse (struct t_irc_server *server, const char *message, *pos_text = pos4 - message; } } - else if ((channel && !*channel) - || (pos_channel && (*pos_channel < 0))) + else { - if (channel) - *channel = weechat_strndup (pos, pos3 - pos); - if (pos_channel) - *pos_channel = pos - message; + if (ptr_channel_found) + { + if (pos[0] == ':') + pos++; + if (text) + *text = strdup (pos); + if (pos_text) + *pos_text = pos - message; + } + else + { + if (channel) + *channel = weechat_strndup (pos, pos3 - pos); + if (pos_channel) + *pos_channel = pos - message; + pos4 = strchr (pos3, ' '); + if (pos4) + { + while (pos4[0] == ' ') + { + pos4++; + } + if (pos4[0] == ':') + pos4++; + if (text) + *text = strdup (pos4); + if (pos_text) + *pos_text = pos4 - message; + } + } } } } diff --git a/src/plugins/irc/irc-message.h b/src/plugins/irc/irc-message.h index 026595b7e..a4478115c 100644 --- a/src/plugins/irc/irc-message.h +++ b/src/plugins/irc/irc-message.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c index 163e9cdd7..a31d64388 100644 --- a/src/plugins/irc/irc-mode.c +++ b/src/plugins/irc/irc-mode.c @@ -1,7 +1,7 @@ /* * irc-mode.c - IRC channel/user modes management * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-mode.h b/src/plugins/irc/irc-mode.h index f6a498626..8dbd2220e 100644 --- a/src/plugins/irc/irc-mode.h +++ b/src/plugins/irc/irc-mode.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-msgbuffer.c b/src/plugins/irc/irc-msgbuffer.c index 0e58a417a..27708fccb 100644 --- a/src/plugins/irc/irc-msgbuffer.c +++ b/src/plugins/irc/irc-msgbuffer.c @@ -1,7 +1,7 @@ /* * irc-msgbuffer.c - target buffer for IRC messages * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-msgbuffer.h b/src/plugins/irc/irc-msgbuffer.h index 370c2dd92..a27e7daa2 100644 --- a/src/plugins/irc/irc-msgbuffer.h +++ b/src/plugins/irc/irc-msgbuffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index 0877f331a..98b470641 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -1,7 +1,7 @@ /* * irc-nick.c - nick management for IRC plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -626,7 +626,7 @@ irc_nick_nicklist_set_color_all () struct t_irc_nick * irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel, const char *nickname, const char *host, const char *prefixes, - int away, const char *account) + int away, const char *account, const char *realname) { struct t_irc_nick *new_nick, *ptr_nick; int length; @@ -650,6 +650,9 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel, if (ptr_nick->account) free (ptr_nick->account); ptr_nick->account = (account) ? strdup (account) : NULL; + if (ptr_nick->realname) + free (ptr_nick->realname); + ptr_nick->realname = (realname) ? strdup (realname) : NULL; /* add new nick in nicklist */ irc_nick_nicklist_add (server, channel, ptr_nick); @@ -665,6 +668,7 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel, new_nick->name = strdup (nickname); new_nick->host = (host) ? strdup (host) : NULL; new_nick->account = (account) ? strdup (account) : NULL; + new_nick->realname = (realname) ? strdup (realname) : NULL; length = strlen (irc_server_get_prefix_chars (server)); new_nick->prefixes = malloc (length + 1); if (!new_nick->name || !new_nick->prefixes) @@ -675,6 +679,8 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel, free (new_nick->host); if (new_nick->account) free (new_nick->account); + if (new_nick->realname) + free (new_nick->realname); if (new_nick->prefixes) free (new_nick->prefixes); free (new_nick); @@ -817,6 +823,8 @@ irc_nick_free (struct t_irc_server *server, struct t_irc_channel *channel, free (nick->prefixes); if (nick->account) free (nick->account); + if (nick->realname) + free (nick->realname); if (nick->color) free (nick->color); @@ -1137,6 +1145,7 @@ irc_nick_hdata_nick_cb (void *data, const char *hdata_name) WEECHAT_HDATA_VAR(struct t_irc_nick, prefix, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_nick, away, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_nick, account, STRING, 0, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_irc_nick, realname, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_nick, color, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_nick, prev_nick, POINTER, 0, NULL, hdata_name); WEECHAT_HDATA_VAR(struct t_irc_nick, next_nick, POINTER, 0, NULL, hdata_name); @@ -1177,6 +1186,8 @@ irc_nick_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_string (ptr_item, "account", nick->account)) return 0; + if (!weechat_infolist_new_var_string (ptr_item, "realname", nick->realname)) + return 0; if (!weechat_infolist_new_var_string (ptr_item, "color", nick->color)) return 0; @@ -1197,6 +1208,7 @@ irc_nick_print_log (struct t_irc_nick *nick) weechat_log_printf (" prefix . . . . : '%s'", nick->prefix); weechat_log_printf (" away . . . . . : %d", nick->away); weechat_log_printf (" account. . . . : '%s'", nick->account); + weechat_log_printf (" realname . . . : '%s'", nick->realname); weechat_log_printf (" color. . . . . : '%s'", nick->color); weechat_log_printf (" prev_nick. . . : 0x%lx", nick->prev_nick); weechat_log_printf (" next_nick. . . : 0x%lx", nick->next_nick); diff --git a/src/plugins/irc/irc-nick.h b/src/plugins/irc/irc-nick.h index 3079a437b..d723db180 100644 --- a/src/plugins/irc/irc-nick.h +++ b/src/plugins/irc/irc-nick.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -39,6 +39,7 @@ struct t_irc_nick /* prefixes) */ int away; /* 1 if nick is away */ char *account; /* account name of the user */ + char *realname; /* realname (aka gecos) of the user */ char *color; /* color for nickname */ struct t_irc_nick *prev_nick; /* link to previous nick on channel */ struct t_irc_nick *next_nick; /* link to next nick on channel */ @@ -66,7 +67,8 @@ extern struct t_irc_nick *irc_nick_new (struct t_irc_server *server, const char *host, const char *prefixes, int away, - const char *account); + const char *account, + const char *realname); extern void irc_nick_change (struct t_irc_server *server, struct t_irc_channel *channel, struct t_irc_nick *nick, const char *new_nick); diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c index cb9a2e590..2d39250ca 100644 --- a/src/plugins/irc/irc-notify.c +++ b/src/plugins/irc/irc-notify.c @@ -1,7 +1,7 @@ /* * irc-notify.c - notify lists for IRC plugin * - * Copyright (C) 2010-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2010-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-notify.h b/src/plugins/irc/irc-notify.h index 19c310dba..63bd96347 100644 --- a/src/plugins/irc/irc-notify.h +++ b/src/plugins/irc/irc-notify.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2010-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index f3d7bff92..689a3c91f 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1,7 +1,7 @@ /* * irc-protocol.c - implementation of IRC protocol (RFCs 1459/2810/2811/2812/2813) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> * Copyright (C) 2014 Shawn Smith <ShawnSmith0828@gmail.com> * @@ -206,9 +206,12 @@ IRC_PROTOCOL_CALLBACK(account) { struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; + char *pos_account; IRC_PROTOCOL_MIN_ARGS(3); + pos_account = (strcmp (argv[2], "*") != 0) ? argv[2] : NULL; + for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { @@ -217,8 +220,8 @@ IRC_PROTOCOL_CALLBACK(account) { if (ptr_nick->account) free (ptr_nick->account); - ptr_nick->account = (server->cap_account_notify) ? - strdup (argv[2]) : strdup ("*"); + ptr_nick->account = (server->cap_account_notify && pos_account) ? + strdup (pos_account) : NULL; } } @@ -337,11 +340,11 @@ IRC_PROTOCOL_CALLBACK(away) IRC_PROTOCOL_CALLBACK(cap) { - char *ptr_caps, **caps_supported, **caps_requested, *cap_option, *cap_req; - char str_msg_auth[512]; + char *ptr_caps, **caps_supported, **caps_requested, **caps_added; + char **caps_removed, *cap_option, *cap_req, str_msg_auth[512]; const char *ptr_cap_option; - int num_caps_supported, num_caps_requested; - int sasl_requested, sasl_to_do, sasl_mechanism; + int num_caps_supported, num_caps_requested, num_caps_added; + int num_caps_removed, sasl_requested, sasl_to_do, sasl_mechanism; int i, j, timeout, length; IRC_PROTOCOL_MIN_ARGS(4); @@ -363,9 +366,11 @@ IRC_PROTOCOL_CALLBACK(cap) { sasl_requested = irc_server_sasl_enabled (server); sasl_to_do = 0; - ptr_cap_option = IRC_SERVER_OPTION_STRING(server, - IRC_SERVER_OPTION_CAPABILITIES); - length = ((ptr_cap_option && ptr_cap_option[0]) ? strlen (ptr_cap_option) : 0) + 16; + ptr_cap_option = IRC_SERVER_OPTION_STRING( + server, + IRC_SERVER_OPTION_CAPABILITIES); + length = ((ptr_cap_option && ptr_cap_option[0]) ? + strlen (ptr_cap_option) : 0) + 16; cap_option = malloc (length); cap_req = malloc (length); if (cap_option && cap_req) @@ -473,6 +478,10 @@ IRC_PROTOCOL_CALLBACK(cap) { server->cap_account_notify = 1; } + else if (strcmp (caps_supported[i], "extended-join") == 0) + { + server->cap_extended_join = 1; + } } weechat_string_free_split (caps_supported); } @@ -514,6 +523,103 @@ IRC_PROTOCOL_CALLBACK(cap) irc_server_sendf (server, 0, NULL, "CAP END"); } } + else if (strcmp (argv[3], "NEW") == 0) + { + 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, now available: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, ptr_caps); + + /* + * assume that we're not requesting any already-enabled + * capabilities + * TODO: SASL Reauthentication + */ + ptr_cap_option = IRC_SERVER_OPTION_STRING( + server, + IRC_SERVER_OPTION_CAPABILITIES); + length = ((ptr_cap_option && ptr_cap_option[0]) ? + strlen (ptr_cap_option) : 0) + 16; + cap_option = malloc (length); + cap_req = malloc (length); + if (cap_option && cap_req) + { + cap_option[0] = '\0'; + if (ptr_cap_option && ptr_cap_option[0]) + strcat (cap_option, ptr_cap_option); + cap_req[0] = '\0'; + caps_requested = weechat_string_split (cap_option, ",", 0, 0, + &num_caps_requested); + caps_added = weechat_string_split (ptr_caps, " ", 0, 0, + &num_caps_added); + if (caps_requested && caps_added) + { + for (i = 0; i < num_caps_requested; i++) + { + for (j = 0; j < num_caps_added; j++) + { + if (weechat_strcasecmp (caps_requested[i], + caps_added[j]) == 0) + { + if (cap_req[0]) + strcat (cap_req, " "); + strcat (cap_req, caps_added[j]); + } + } + } + } + if (caps_requested) + weechat_string_free_split (caps_requested); + if (caps_added) + weechat_string_free_split (caps_added); + if (cap_req[0]) + { + 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); + } + } + if (cap_option) + free (cap_option); + if (cap_req) + free (cap_req); + } + } + else if (strcmp (argv[3], "DEL") == 0) + { + 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, removed: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, ptr_caps); + caps_removed = weechat_string_split (ptr_caps, " ", 0, 0, + &num_caps_removed); + if (caps_removed) + { + for (i = 0; i < num_caps_removed; i++) + { + if (strcmp (caps_removed[i], "away-notify") == 0) + { + server->cap_away_notify = 0; + } + else if (strcmp (caps_removed[i], "account-notify") == 0) + { + server->cap_account_notify = 0; + } + } + weechat_string_free_split (caps_removed); + } + } + } return WEECHAT_RC_OK; } @@ -648,7 +754,7 @@ IRC_PROTOCOL_CALLBACK(invite) * * With extended-join capability: * :nick!user@host JOIN :#channel * :real name - * *nick!user@host JOIN :#channel account :real name + * :nick!user@host JOIN :#channel account :real name */ IRC_PROTOCOL_CALLBACK(join) @@ -743,7 +849,8 @@ IRC_PROTOCOL_CALLBACK(join) /* add nick in channel */ ptr_nick = irc_nick_new (server, ptr_channel, nick, address, NULL, 0, - (pos_account) ? pos_account : "*"); + (pos_account) ? pos_account : NULL, + (pos_realname) ? pos_realname : NULL); /* rename the nick if it was in list with a different case */ irc_channel_nick_speaking_rename_if_present (server, ptr_channel, nick); @@ -1179,7 +1286,7 @@ IRC_PROTOCOL_CALLBACK(nick) /* temporary disable hotlist */ weechat_buffer_set (NULL, "hotlist", "-"); - /* set host for nick if needed */ + /* set host in nick if needed */ if (!ptr_nick->host) ptr_nick->host = strdup (address); @@ -4068,7 +4175,7 @@ IRC_PROTOCOL_CALLBACK(352) ptr_nick = (ptr_channel) ? irc_nick_search (server, ptr_channel, argv[7]) : NULL; - /* update host for nick */ + /* update host in nick */ if (ptr_nick) { if (ptr_nick->host) @@ -4079,13 +4186,22 @@ IRC_PROTOCOL_CALLBACK(352) snprintf (ptr_nick->host, length, "%s@%s", argv[4], argv[5]); } - /* update away flag for nick */ + /* update away flag in nick */ if (ptr_channel && ptr_nick && pos_attr) { irc_nick_set_away (server, ptr_channel, ptr_nick, (pos_attr[0] == 'G') ? 1 : 0); } + /* update realname in nick */ + if (ptr_channel && ptr_nick && pos_realname) + { + if (ptr_nick->realname) + free (ptr_nick->realname); + ptr_nick->realname = (pos_realname && server->cap_extended_join) ? + strdup (pos_realname) : NULL; + } + /* display output of who (manual who from user) */ if (!ptr_channel || (ptr_channel->checking_whox <= 0)) { @@ -4196,7 +4312,7 @@ IRC_PROTOCOL_CALLBACK(353) if (ptr_channel && ptr_channel->nicks) { if (!irc_nick_new (server, ptr_channel, nickname, pos_host, - prefixes, 0, "*")) + prefixes, 0, NULL, NULL)) { weechat_printf ( server->buffer, @@ -4291,7 +4407,7 @@ IRC_PROTOCOL_CALLBACK(354) ptr_nick = (ptr_channel) ? irc_nick_search (server, ptr_channel, argv[7]) : NULL; - /* update host for nick */ + /* update host in nick */ if (ptr_nick) { if (ptr_nick->host) @@ -4305,7 +4421,7 @@ IRC_PROTOCOL_CALLBACK(354) snprintf (ptr_nick->host, length, "%s@%s", argv[4], argv[5]); } - /* update away flag for nick */ + /* update away flag in nick */ if (ptr_channel && ptr_nick) { if (pos_attr @@ -4326,14 +4442,24 @@ IRC_PROTOCOL_CALLBACK(354) } } - /* update account flag for nick */ + /* update account flag in nick */ if (ptr_nick) { if (ptr_nick->account) free (ptr_nick->account); ptr_nick->account = (ptr_channel && pos_account && server->cap_account_notify) ? - strdup (pos_account) : strdup ("*"); + strdup (pos_account) : NULL; + } + + /* update realname in nick */ + if (ptr_nick) + { + if (ptr_nick->realname) + free (ptr_nick->realname); + ptr_nick->realname = (ptr_channel && pos_realname + && server->cap_extended_join) ? + strdup (pos_realname) : NULL; } /* display output of who (manual who from user) */ @@ -4912,6 +5038,74 @@ IRC_PROTOCOL_CALLBACK(438) } /* + * Callback for the IRC message "470": forwarding to another channel. + * + * Message looks like: + * :server 470 mynick #channel ##channel :Forwarding to another channel + */ + +IRC_PROTOCOL_CALLBACK(470) +{ + struct t_gui_buffer *ptr_buffer; + struct t_gui_lines *own_lines; + const char *buffer_name, *short_name, *localvar_channel; + int lines_count; + + irc_protocol_cb_generic_error (server, + date, nick, address, host, command, + ignored, argc, argv, argv_eol); + + if ((argc >= 5) && !irc_channel_search (server, argv[3])) + { + ptr_buffer = irc_channel_search_buffer (server, + IRC_CHANNEL_TYPE_CHANNEL, + argv[3]); + if (ptr_buffer) + { + short_name = weechat_buffer_get_string (ptr_buffer, "short_name"); + localvar_channel = weechat_buffer_get_string (ptr_buffer, + "localvar_channel"); + if (!short_name + || (localvar_channel + && (strcmp (localvar_channel, short_name) == 0))) + { + /* + * update the short_name only if it was not changed by the + * user + */ + weechat_buffer_set (ptr_buffer, "short_name", argv[4]); + } + buffer_name = irc_buffer_build_name (server->name, argv[4]); + weechat_buffer_set (ptr_buffer, "name", buffer_name); + weechat_buffer_set (ptr_buffer, "localvar_set_channel", argv[4]); + + /* + * check if logger backlog should be displayed for the new channel + * name: it is displayed only if the buffer is currently completely + * empty (no messages at all) + */ + lines_count = 0; + own_lines = weechat_hdata_pointer (weechat_hdata_get ("buffer"), + ptr_buffer, "own_lines"); + if (own_lines) + { + lines_count = weechat_hdata_integer ( + weechat_hdata_get ("lines"), + own_lines, "lines_count"); + } + if (lines_count == 0) + { + (void) weechat_hook_signal_send ("logger_backlog", + WEECHAT_HOOK_SIGNAL_POINTER, + ptr_buffer); + } + } + } + + return WEECHAT_RC_OK; +} + +/* * Callback for the IRC message "728": quietlist. * * Message looks like: @@ -5544,7 +5738,7 @@ irc_protocol_recv_command (struct t_irc_server *server, { "464", /* password incorrect */ 1, 0, &irc_protocol_cb_generic_error }, { "465", /* you are banned from this server */ 1, 0, &irc_protocol_cb_generic_error }, { "467", /* channel key already set */ 1, 0, &irc_protocol_cb_generic_error }, - { "470", /* forwarding to another channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "470", /* forwarding to another channel */ 1, 0, &irc_protocol_cb_470 }, { "471", /* channel is already full */ 1, 0, &irc_protocol_cb_generic_error }, { "472", /* unknown mode char to me */ 1, 0, &irc_protocol_cb_generic_error }, { "473", /* cannot join channel (invite only) */ 1, 0, &irc_protocol_cb_generic_error }, diff --git a/src/plugins/irc/irc-protocol.h b/src/plugins/irc/irc-protocol.h index c1f88d0d5..186a0729b 100644 --- a/src/plugins/irc/irc-protocol.h +++ b/src/plugins/irc/irc-protocol.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-raw.c b/src/plugins/irc/irc-raw.c index 6518cac15..4e5155090 100644 --- a/src/plugins/irc/irc-raw.c +++ b/src/plugins/irc/irc-raw.c @@ -1,7 +1,7 @@ /* * irc-raw.c - functions for IRC raw data messages * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-raw.h b/src/plugins/irc/irc-raw.h index 82fc529b0..6d9b23d78 100644 --- a/src/plugins/irc/irc-raw.h +++ b/src/plugins/irc/irc-raw.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c index 576d6fd24..de1c71ee5 100644 --- a/src/plugins/irc/irc-redirect.c +++ b/src/plugins/irc/irc-redirect.c @@ -1,7 +1,7 @@ /* * irc-redirect.c - redirection of IRC command output * - * Copyright (C) 2010-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2010-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-redirect.h b/src/plugins/irc/irc-redirect.h index b78db090a..7fd841621 100644 --- a/src/plugins/irc/irc-redirect.h +++ b/src/plugins/irc/irc-redirect.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2010-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-sasl.c b/src/plugins/irc/irc-sasl.c index 623d12a27..f5bf4dd8b 100644 --- a/src/plugins/irc/irc-sasl.c +++ b/src/plugins/irc/irc-sasl.c @@ -1,7 +1,7 @@ /* * irc-sasl.c - SASL authentication with IRC server * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-sasl.h b/src/plugins/irc/irc-sasl.h index 2677f5247..d3b61ddd9 100644 --- a/src/plugins/irc/irc-sasl.h +++ b/src/plugins/irc/irc-sasl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index f5824660c..6c081e3a0 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -1,7 +1,7 @@ /* * irc-server.c - I/O communication with IRC servers * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2010 Emmanuel Bouthenot <kolter@openics.org> * Copyright (C) 2012 Simon Arlott * @@ -96,6 +96,7 @@ char *irc_server_options[IRC_SERVER_NUM_OPTIONS][2] = { "autoreconnect", "on" }, { "autoreconnect_delay", "10" }, { "nicks", "" }, + { "nicks_alternate", "on" }, { "username", "" }, { "realname", "" }, { "local_hostname", "" }, @@ -407,7 +408,7 @@ void irc_server_set_addresses (struct t_irc_server *server, const char *addresses) { int i; - char *pos, *error; + char *pos, *error, *addresses_eval; long number; /* free data */ @@ -431,8 +432,11 @@ irc_server_set_addresses (struct t_irc_server *server, const char *addresses) /* set new addresses/ports */ if (addresses && addresses[0]) { + addresses_eval = weechat_string_eval_expression (addresses, + NULL, NULL, NULL); server->addresses_array = weechat_string_split ( - addresses, ",", 0, 0, &server->addresses_count); + (addresses_eval) ? addresses_eval : addresses, + ",", 0, 0, &server->addresses_count); server->ports_array = malloc ( server->addresses_count * sizeof (server->ports_array[0])); server->retry_array = malloc ( @@ -455,6 +459,8 @@ irc_server_set_addresses (struct t_irc_server *server, const char *addresses) } server->retry_array[i] = 0; } + if (addresses_eval) + free (addresses_eval); } } @@ -624,8 +630,8 @@ irc_server_get_alternate_nick (struct t_irc_server *server) /* now we have tried all nicks in list */ - /* if alternate nick is disabled, just return NULL */ - if (!weechat_config_boolean (irc_config_network_alternate_nick)) + /* if alternate nicks are disabled, just return NULL */ + if (!IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_NICKS_ALTERNATE)) return NULL; /* use main nick and we will add "_" and then number if needed */ @@ -1011,6 +1017,7 @@ irc_server_alloc (const char *name) new_server->nick_modes = NULL; new_server->cap_away_notify = 0; new_server->cap_account_notify = 0; + new_server->cap_extended_join = 0; new_server->isupport = NULL; new_server->prefix_modes = NULL; new_server->prefix_chars = NULL; @@ -1073,25 +1080,28 @@ irc_server_alloc (const char *name) for (i = 0; i < IRC_SERVER_NUM_OPTIONS; i++) { length = strlen (new_server->name) + 1 + - strlen (irc_server_options[i][0]) + 1; + strlen (irc_server_options[i][0]) + + 512 + /* inherited option name (irc.server_default.xxx) */ + 1; option_name = malloc (length); if (option_name) { - snprintf (option_name, length, "%s.%s", + snprintf (option_name, length, "%s.%s << irc.server_default.%s", new_server->name, + irc_server_options[i][0], irc_server_options[i][0]); - new_server->options[i] = - irc_config_server_new_option (irc_config_file, - irc_config_section_server, - i, - option_name, - NULL, - NULL, - 1, - &irc_config_server_check_value_cb, - irc_server_options[i][0], - &irc_config_server_change_cb, - irc_server_options[i][0]); + new_server->options[i] = irc_config_server_new_option ( + irc_config_file, + irc_config_section_server, + i, + option_name, + NULL, + NULL, + 1, + &irc_config_server_check_value_cb, + irc_server_options[i][0], + &irc_config_server_change_cb, + irc_server_options[i][0]); irc_config_server_change_cb (irc_server_options[i][0], new_server->options[i]); free (option_name); @@ -3328,7 +3338,13 @@ irc_server_login (struct t_irc_server *server) server, IRC_SERVER_OPTION_CAPABILITIES); if (password && password[0]) - irc_server_sendf (server, 0, NULL, "PASS %s", password); + { + irc_server_sendf ( + server, 0, NULL, + "PASS %s%s", + ((password[0] == ':') || (strchr (password, ' '))) ? ":" : "", + password); + } if (!server->nick) { @@ -4678,6 +4694,7 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address, } server->cap_away_notify = 0; server->cap_account_notify = 0; + server->cap_extended_join = 0; server->is_away = 0; server->away_time = 0; server->lag = 0; @@ -5261,6 +5278,7 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name) WEECHAT_HDATA_VAR(struct t_irc_server, nick_modes, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, cap_away_notify, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, cap_account_notify, INTEGER, 0, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_irc_server, cap_extended_join, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, isupport, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, prefix_modes, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, prefix_chars, STRING, 0, NULL, NULL); @@ -5402,6 +5420,9 @@ irc_server_add_to_infolist (struct t_infolist *infolist, if (!weechat_infolist_new_var_string (ptr_item, "nicks", IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_NICKS))) return 0; + if (!weechat_infolist_new_var_integer (ptr_item, "nicks_alternate", + IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_NICKS_ALTERNATE))) + return 0; if (!weechat_infolist_new_var_string (ptr_item, "username", IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_USERNAME))) return 0; @@ -5480,6 +5501,8 @@ irc_server_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_integer (ptr_item, "cap_account_notify", server->cap_account_notify)) return 0; + if (!weechat_infolist_new_var_integer (ptr_item, "cap_extended_join", server->cap_extended_join)) + return 0; if (!weechat_infolist_new_var_string (ptr_item, "isupport", server->isupport)) return 0; if (!weechat_infolist_new_var_string (ptr_item, "prefix_modes", server->prefix_modes)) @@ -5573,7 +5596,7 @@ irc_server_print_log () "on" : "off"); else weechat_log_printf (" ipv6 . . . . . . . . : %s", - weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_IPV6]) ? + (weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_IPV6])) ? "on" : "off"); /* ssl */ if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_SSL])) @@ -5582,7 +5605,7 @@ irc_server_print_log () "on" : "off"); else weechat_log_printf (" ssl. . . . . . . . . : %s", - weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_SSL]) ? + (weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_SSL])) ? "on" : "off"); /* ssl_cert */ if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_SSL_CERT])) @@ -5619,7 +5642,7 @@ irc_server_print_log () "on" : "off"); else weechat_log_printf (" ssl_verify . . . . . : %s", - weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_SSL_VERIFY]) ? + (weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_SSL_VERIFY])) ? "on" : "off"); /* password */ if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_PASSWORD])) @@ -5673,7 +5696,7 @@ irc_server_print_log () "on" : "off"); else weechat_log_printf (" autoconnect. . . . . : %s", - weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_AUTOCONNECT]) ? + (weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_AUTOCONNECT])) ? "on" : "off"); /* autoreconnect */ if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_AUTORECONNECT])) @@ -5682,7 +5705,7 @@ irc_server_print_log () "on" : "off"); else weechat_log_printf (" autoreconnect. . . . : %s", - weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_AUTORECONNECT]) ? + (weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_AUTORECONNECT])) ? "on" : "off"); /* autoreconnect_delay */ if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_AUTORECONNECT_DELAY])) @@ -5698,6 +5721,15 @@ irc_server_print_log () else weechat_log_printf (" nicks. . . . . . . . : '%s'", weechat_config_string (ptr_server->options[IRC_SERVER_OPTION_NICKS])); + /* nicks_alternate */ + if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_NICKS_ALTERNATE])) + weechat_log_printf (" nicks_alternate. . . : null (%s)", + (IRC_SERVER_OPTION_BOOLEAN(ptr_server, IRC_SERVER_OPTION_NICKS_ALTERNATE)) ? + "on" : "off"); + else + weechat_log_printf (" nicks_alternate. . . : %s", + (weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_NICKS_ALTERNATE])) ? + "on" : "off"); /* username */ if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_USERNAME])) weechat_log_printf (" username . . . . . . : null ('%s')", @@ -5745,7 +5777,7 @@ irc_server_print_log () "on" : "off"); else weechat_log_printf (" autorejoin . . . . . : %s", - weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_AUTOREJOIN]) ? + (weechat_config_boolean (ptr_server->options[IRC_SERVER_OPTION_AUTOREJOIN])) ? "on" : "off"); /* autorejoin_delay */ if (weechat_config_option_is_null (ptr_server->options[IRC_SERVER_OPTION_AUTOREJOIN_DELAY])) @@ -5843,6 +5875,7 @@ irc_server_print_log () weechat_log_printf (" nick_modes . . . . . : '%s'", ptr_server->nick_modes); weechat_log_printf (" cap_away_notify. . . : %d", ptr_server->cap_away_notify); weechat_log_printf (" cap_account_notify . : %d", ptr_server->cap_account_notify); + weechat_log_printf (" cap_extended_join. . : %d", ptr_server->cap_extended_join); weechat_log_printf (" isupport . . . . . . : '%s'", ptr_server->isupport); weechat_log_printf (" prefix_modes . . . . : '%s'", ptr_server->prefix_modes); weechat_log_printf (" prefix_chars . . . . : '%s'", ptr_server->prefix_chars); diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h index dd650c325..8ba3d96e6 100644 --- a/src/plugins/irc/irc-server.h +++ b/src/plugins/irc/irc-server.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2012 Simon Arlott * * This file is part of WeeChat, the extensible chat client. @@ -64,6 +64,7 @@ enum t_irc_server_option IRC_SERVER_OPTION_AUTORECONNECT, /* autoreconnect when disconnected */ IRC_SERVER_OPTION_AUTORECONNECT_DELAY, /* delay before trying again reco */ IRC_SERVER_OPTION_NICKS, /* nicknames (comma separated list) */ + IRC_SERVER_OPTION_NICKS_ALTERNATE, /* use alternate nicknames */ IRC_SERVER_OPTION_USERNAME, /* user name */ IRC_SERVER_OPTION_REALNAME, /* real name */ IRC_SERVER_OPTION_LOCAL_HOSTNAME,/* custom local hostname */ @@ -186,6 +187,7 @@ struct t_irc_server char *nick_modes; /* nick modes */ int cap_away_notify; /* 1 if capability away-notify is enabled*/ int cap_account_notify; /* 1 if CAP account-notify is enabled */ + int cap_extended_join; /* 1 if CAP extended-join is enabled */ char *isupport; /* copy of message 005 (ISUPPORT) */ char *prefix_modes; /* prefix modes from msg 005 (eg "ohv") */ char *prefix_chars; /* prefix chars from msg 005 (eg "@%+") */ diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c index 08a7f023d..458bf0204 100644 --- a/src/plugins/irc/irc-upgrade.c +++ b/src/plugins/irc/irc-upgrade.c @@ -1,7 +1,7 @@ /* * irc-upgrade.c - save/restore IRC plugin data when upgrading WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -373,6 +373,7 @@ irc_upgrade_read_cb (void *data, irc_upgrade_current_server->nick_modes = strdup (str); irc_upgrade_current_server->cap_away_notify = weechat_infolist_integer (infolist, "cap_away_notify"); irc_upgrade_current_server->cap_account_notify = weechat_infolist_integer (infolist, "cap_account_notify"); + irc_upgrade_current_server->cap_extended_join = weechat_infolist_integer (infolist, "cap_extended_join"); str = weechat_infolist_string (infolist, "isupport"); if (str) irc_upgrade_current_server->isupport = strdup (str); @@ -574,7 +575,8 @@ irc_upgrade_read_cb (void *data, weechat_infolist_string (infolist, "host"), weechat_infolist_string (infolist, "prefixes"), weechat_infolist_integer (infolist, "away"), - weechat_infolist_string (infolist, "account")); + weechat_infolist_string (infolist, "account"), + weechat_infolist_string (infolist, "realname")); if (ptr_nick) { /* diff --git a/src/plugins/irc/irc-upgrade.h b/src/plugins/irc/irc-upgrade.h index 17da632cd..0c9ab8730 100644 --- a/src/plugins/irc/irc-upgrade.h +++ b/src/plugins/irc/irc-upgrade.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c index 9222d3f88..934df21ce 100644 --- a/src/plugins/irc/irc.c +++ b/src/plugins/irc/irc.c @@ -1,7 +1,7 @@ /* * irc.c - IRC (Internet Relay Chat) plugin for WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/irc/irc.h b/src/plugins/irc/irc.h index 1ee4d538b..3e4cce9f2 100644 --- a/src/plugins/irc/irc.h +++ b/src/plugins/irc/irc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/javascript/CMakeLists.txt b/src/plugins/javascript/CMakeLists.txt index 91a56a340..a2911a218 100644 --- a/src/plugins/javascript/CMakeLists.txt +++ b/src/plugins/javascript/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/javascript/Makefile.am b/src/plugins/javascript/Makefile.am index 5a81350f3..983108751 100644 --- a/src/plugins/javascript/Makefile.am +++ b/src/plugins/javascript/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp index a5a07c432..fe223252b 100644 --- a/src/plugins/javascript/weechat-js-api.cpp +++ b/src/plugins/javascript/weechat-js-api.cpp @@ -2,7 +2,7 @@ * weechat-js-api.cpp - javascript API functions * * Copyright (C) 2013 Koka El Kiwi <kokakiwi@kokakiwi.net> - * Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -25,6 +25,7 @@ #include <cstdlib> #include <cstring> #include <string> +#include <time.h> extern "C" { diff --git a/src/plugins/javascript/weechat-js-api.h b/src/plugins/javascript/weechat-js-api.h index 74de77941..199296234 100644 --- a/src/plugins/javascript/weechat-js-api.h +++ b/src/plugins/javascript/weechat-js-api.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2013 Koka El Kiwi <kokakiwi@kokakiwi.net> - * Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/javascript/weechat-js-v8.cpp b/src/plugins/javascript/weechat-js-v8.cpp index 3effbd02c..2633c7a97 100644 --- a/src/plugins/javascript/weechat-js-v8.cpp +++ b/src/plugins/javascript/weechat-js-v8.cpp @@ -2,7 +2,7 @@ * weechat-js-v8.cpp - v8 javascript functions * * Copyright (C) 2013 Koka El Kiwi <kokakiwi@kokakiwi.net> - * Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/javascript/weechat-js-v8.h b/src/plugins/javascript/weechat-js-v8.h index 65aa930fe..d71965418 100644 --- a/src/plugins/javascript/weechat-js-v8.h +++ b/src/plugins/javascript/weechat-js-v8.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2013 Koka El Kiwi <kokakiwi@kokakiwi.net> - * Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/javascript/weechat-js.cpp b/src/plugins/javascript/weechat-js.cpp index 5636cda12..927f76cb8 100644 --- a/src/plugins/javascript/weechat-js.cpp +++ b/src/plugins/javascript/weechat-js.cpp @@ -2,7 +2,7 @@ * weechat-js.cpp - javascript plugin for WeeChat * * Copyright (C) 2013 Koka El Kiwi <kokakiwi@kokakiwi.net> - * Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/javascript/weechat-js.h b/src/plugins/javascript/weechat-js.h index a6412f347..4d26e9c6f 100644 --- a/src/plugins/javascript/weechat-js.h +++ b/src/plugins/javascript/weechat-js.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2013 Koka El Kiwi <kokakiwi@kokakiwi.net> - * Copyright (C) 2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2015-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/CMakeLists.txt b/src/plugins/logger/CMakeLists.txt index 85d1ab885..8b2a61b17 100644 --- a/src/plugins/logger/CMakeLists.txt +++ b/src/plugins/logger/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/logger/Makefile.am b/src/plugins/logger/Makefile.am index a0c5b7708..b150a4392 100644 --- a/src/plugins/logger/Makefile.am +++ b/src/plugins/logger/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/logger/logger-buffer.c b/src/plugins/logger/logger-buffer.c index 1a4d3e4c6..a5317a36e 100644 --- a/src/plugins/logger/logger-buffer.c +++ b/src/plugins/logger/logger-buffer.c @@ -1,7 +1,7 @@ /* * logger-buffer.c - logger buffer list management * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger-buffer.h b/src/plugins/logger/logger-buffer.h index 45d6799e1..4168fe736 100644 --- a/src/plugins/logger/logger-buffer.h +++ b/src/plugins/logger/logger-buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger-config.c b/src/plugins/logger/logger-config.c index cac61d8a9..49d28e0f1 100644 --- a/src/plugins/logger/logger-config.c +++ b/src/plugins/logger/logger-config.c @@ -1,7 +1,7 @@ /* * logger-config.c - logger configuration options (file logger.conf) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger-config.h b/src/plugins/logger/logger-config.h index c930ae0f5..834da3ab6 100644 --- a/src/plugins/logger/logger-config.h +++ b/src/plugins/logger/logger-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger-info.c b/src/plugins/logger/logger-info.c index cb3db8bf2..dd0f3ae60 100644 --- a/src/plugins/logger/logger-info.c +++ b/src/plugins/logger/logger-info.c @@ -1,7 +1,7 @@ /* * logger-info.c - info and infolist hooks for logger plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger-info.h b/src/plugins/logger/logger-info.h index 1d6a6fa14..21f4963e7 100644 --- a/src/plugins/logger/logger-info.h +++ b/src/plugins/logger/logger-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger-tail.c b/src/plugins/logger/logger-tail.c index 6325366af..d62dc13f9 100644 --- a/src/plugins/logger/logger-tail.c +++ b/src/plugins/logger/logger-tail.c @@ -1,7 +1,7 @@ /* * logger-tail.c - return last lines of a file * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger-tail.h b/src/plugins/logger/logger-tail.h index 086ef349a..fa5ef473d 100644 --- a/src/plugins/logger/logger-tail.h +++ b/src/plugins/logger/logger-tail.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c index 06e0ff4ca..8b698470a 100644 --- a/src/plugins/logger/logger.c +++ b/src/plugins/logger/logger.c @@ -1,7 +1,7 @@ /* * logger.c - logger plugin for WeeChat: save buffer lines to disk files * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -559,11 +559,12 @@ logger_write_line (struct t_logger_buffer *logger_buffer, fopen (logger_buffer->log_filename, "a"); if (!logger_buffer->log_file) { - weechat_printf_tags (NULL, - "no_log", - _("%s%s: unable to write log file \"%s\""), - weechat_prefix ("error"), LOGGER_PLUGIN_NAME, - logger_buffer->log_filename); + weechat_printf_tags ( + NULL, + "no_log", + _("%s%s: unable to write log file \"%s\": %s"), + weechat_prefix ("error"), LOGGER_PLUGIN_NAME, + logger_buffer->log_filename, strerror (errno)); logger_buffer_free (logger_buffer); return; } diff --git a/src/plugins/logger/logger.h b/src/plugins/logger/logger.h index dc40d1df8..df3e0d8e0 100644 --- a/src/plugins/logger/logger.h +++ b/src/plugins/logger/logger.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/lua/CMakeLists.txt b/src/plugins/lua/CMakeLists.txt index 4a075264c..b661285fe 100644 --- a/src/plugins/lua/CMakeLists.txt +++ b/src/plugins/lua/CMakeLists.txt @@ -1,6 +1,6 @@ # # Copyright (C) 2006-2007 Emmanuel Bouthenot <kolter@openics.org> -# Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/lua/Makefile.am b/src/plugins/lua/Makefile.am index 3ab660885..15a1a4d56 100644 --- a/src/plugins/lua/Makefile.am +++ b/src/plugins/lua/Makefile.am @@ -1,6 +1,6 @@ # # Copyright (C) 2006-2007 Emmanuel Bouthenot <kolter@openics.org> -# Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c index cfbe45f9c..ac9ad7397 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -2,7 +2,7 @@ * weechat-lua-api.c - lua API functions * * Copyright (C) 2006-2007 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2012 Simon Arlott * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/lua/weechat-lua-api.h b/src/plugins/lua/weechat-lua-api.h index 65abd09fc..3227967dd 100644 --- a/src/plugins/lua/weechat-lua-api.h +++ b/src/plugins/lua/weechat-lua-api.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2006-2007 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c index e78ebddf2..e20eaa912 100644 --- a/src/plugins/lua/weechat-lua.c +++ b/src/plugins/lua/weechat-lua.c @@ -2,7 +2,7 @@ * weechat-lua.c - lua plugin for WeeChat * * Copyright (C) 2006-2007 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/lua/weechat-lua.h b/src/plugins/lua/weechat-lua.h index 0a760babf..dee5d2f09 100644 --- a/src/plugins/lua/weechat-lua.h +++ b/src/plugins/lua/weechat-lua.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2006-2007 Emmanuel Bouthenot <kolter@openics.org> - * Copyright (C) 2006-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2006-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/perl/CMakeLists.txt b/src/plugins/perl/CMakeLists.txt index 41b2f8fa1..5dac3d925 100644 --- a/src/plugins/perl/CMakeLists.txt +++ b/src/plugins/perl/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/perl/Makefile.am b/src/plugins/perl/Makefile.am index b011f0caf..49eedeae3 100644 --- a/src/plugins/perl/Makefile.am +++ b/src/plugins/perl/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c index 61631c72b..c4cc5f303 100644 --- a/src/plugins/perl/weechat-perl-api.c +++ b/src/plugins/perl/weechat-perl-api.c @@ -1,7 +1,7 @@ /* * weechat-perl-api.c - perl API functions * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2008 Emmanuel Bouthenot <kolter@openics.org> * Copyright (C) 2012 Simon Arlott * diff --git a/src/plugins/perl/weechat-perl-api.h b/src/plugins/perl/weechat-perl-api.h index 2a3c31c00..48d06f9d4 100644 --- a/src/plugins/perl/weechat-perl-api.h +++ b/src/plugins/perl/weechat-perl-api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/perl/weechat-perl.c b/src/plugins/perl/weechat-perl.c index eed230b52..70182885b 100644 --- a/src/plugins/perl/weechat-perl.c +++ b/src/plugins/perl/weechat-perl.c @@ -1,7 +1,7 @@ /* * weechat-perl.c - perl plugin for WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2008 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/perl/weechat-perl.h b/src/plugins/perl/weechat-perl.h index 1d31fa794..107806ac0 100644 --- a/src/plugins/perl/weechat-perl.h +++ b/src/plugins/perl/weechat-perl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 157a94d04..455e46041 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -1,7 +1,7 @@ /* * plugin-api.c - extra functions for plugin API * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-api.h b/src/plugins/plugin-api.h index 672eac8c9..963cc874b 100644 --- a/src/plugins/plugin-api.h +++ b/src/plugins/plugin-api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-config.c b/src/plugins/plugin-config.c index a1c779fbb..dab7798e8 100644 --- a/src/plugins/plugin-config.c +++ b/src/plugins/plugin-config.c @@ -1,7 +1,7 @@ /* * plugin-config.c - plugin configuration options (file plugins.conf) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-config.h b/src/plugins/plugin-config.h index c7a0498fa..271d8eee9 100644 --- a/src/plugins/plugin-config.h +++ b/src/plugins/plugin-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-script-api.c b/src/plugins/plugin-script-api.c index a8b38b3a8..b46e236f3 100644 --- a/src/plugins/plugin-script-api.c +++ b/src/plugins/plugin-script-api.c @@ -1,7 +1,7 @@ /* * script-api.c - script API functions, used by script plugins * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2012 Simon Arlott * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/plugin-script-api.h b/src/plugins/plugin-script-api.h index 7786c8798..8ad03e742 100644 --- a/src/plugins/plugin-script-api.h +++ b/src/plugins/plugin-script-api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2012 Simon Arlott * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/plugin-script-callback.c b/src/plugins/plugin-script-callback.c index 437116c16..7d734f77c 100644 --- a/src/plugins/plugin-script-callback.c +++ b/src/plugins/plugin-script-callback.c @@ -1,7 +1,7 @@ /* * script-callback.c - script callbacks management * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-script-callback.h b/src/plugins/plugin-script-callback.h index e1b72fd2e..0ff2fa1f1 100644 --- a/src/plugins/plugin-script-callback.h +++ b/src/plugins/plugin-script-callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c index ffb003a84..fa5bf85e9 100644 --- a/src/plugins/plugin-script.c +++ b/src/plugins/plugin-script.c @@ -1,7 +1,7 @@ /* * plugin-script.c - common functions used by script plugins * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin-script.h b/src/plugins/plugin-script.h index 3f60191ae..d92b30d3b 100644 --- a/src/plugins/plugin-script.h +++ b/src/plugins/plugin-script.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index 960310d1f..73c842656 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -1,7 +1,7 @@ /* * plugin.c - WeeChat plugins management (load/unload dynamic C libraries) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/plugin.h b/src/plugins/plugin.h index 08028f95a..c605079f6 100644 --- a/src/plugins/plugin.h +++ b/src/plugins/plugin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/python/CMakeLists.txt b/src/plugins/python/CMakeLists.txt index 2684b889f..6fccb0ab2 100644 --- a/src/plugins/python/CMakeLists.txt +++ b/src/plugins/python/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/python/Makefile.am b/src/plugins/python/Makefile.am index 43de0e137..b95ec6913 100644 --- a/src/plugins/python/Makefile.am +++ b/src/plugins/python/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index 1eca2723a..cce3cd9ea 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -1,7 +1,7 @@ /* * weechat-python-api.c - python API functions * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * Copyright (C) 2012 Simon Arlott * diff --git a/src/plugins/python/weechat-python-api.h b/src/plugins/python/weechat-python-api.h index 058d28f75..68b434b33 100644 --- a/src/plugins/python/weechat-python-api.h +++ b/src/plugins/python/weechat-python-api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c index eb382d0d2..de19aa3f8 100644 --- a/src/plugins/python/weechat-python.c +++ b/src/plugins/python/weechat-python.c @@ -1,7 +1,7 @@ /* * weechat-python.c - python plugin for WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * Copyright (C) 2012 Simon Arlott * diff --git a/src/plugins/python/weechat-python.h b/src/plugins/python/weechat-python.h index 3a4375428..11920c187 100644 --- a/src/plugins/python/weechat-python.h +++ b/src/plugins/python/weechat-python.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/relay/CMakeLists.txt b/src/plugins/relay/CMakeLists.txt index e3a0a6f33..4dc1bb2e7 100644 --- a/src/plugins/relay/CMakeLists.txt +++ b/src/plugins/relay/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/relay/Makefile.am b/src/plugins/relay/Makefile.am index b27e27690..96c33157c 100644 --- a/src/plugins/relay/Makefile.am +++ b/src/plugins/relay/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 3facb21e0..5731edd1a 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -1,7 +1,7 @@ /* * relay-irc.c - IRC protocol for relay to client: IRC proxy/bouncer * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -754,7 +754,7 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, void *ptr_own_lines, *ptr_line, *ptr_line_data; void *ptr_hdata_line, *ptr_hdata_line_data; char *tags, *message; - const char *ptr_nick, *ptr_nick1, *ptr_nick2, *ptr_host; + const char *ptr_nick, *ptr_nick1, *ptr_nick2, *ptr_host, *localvar_nick; int irc_command, irc_action, count, max_number, max_minutes; time_t date_min, date_min2, date; @@ -780,6 +780,10 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, if (!ptr_hdata_line_data) return; + localvar_nick = NULL; + if (weechat_config_boolean (relay_config_irc_backlog_since_last_message)) + localvar_nick = weechat_buffer_get_string (buffer, "localvar_nick"); + max_number = weechat_config_integer (relay_config_irc_backlog_max_number); max_minutes = weechat_config_integer (relay_config_irc_backlog_max_minutes); date_min = (max_minutes > 0) ? time (NULL) - (max_minutes * 60) : 0; @@ -810,7 +814,7 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, &irc_command, NULL, /* irc_action */ &date, - NULL, /* nick */ + &ptr_nick, NULL, /* nick1 */ NULL, /* nick2 */ NULL, /* host */ @@ -826,6 +830,17 @@ relay_irc_send_channel_backlog (struct t_relay_client *client, /* if we have reached max number of messages, exit loop */ if ((max_number > 0) && (count > max_number)) break; + + if (localvar_nick && localvar_nick[0] + && ptr_nick && (strcmp (ptr_nick, localvar_nick) == 0)) + { + /* + * stop when we find a line sent by the current nick + * (and include this line) + */ + ptr_line = weechat_hdata_move (ptr_hdata_line, ptr_line, -1); + break; + } } ptr_line = weechat_hdata_move (ptr_hdata_line, ptr_line, -1); } diff --git a/src/plugins/relay/irc/relay-irc.h b/src/plugins/relay/irc/relay-irc.h index 90775a91d..fa2ea21ce 100644 --- a/src/plugins/relay/irc/relay-irc.h +++ b/src/plugins/relay/irc/relay-irc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-buffer.c b/src/plugins/relay/relay-buffer.c index 4eb355ab6..502384e4e 100644 --- a/src/plugins/relay/relay-buffer.c +++ b/src/plugins/relay/relay-buffer.c @@ -1,7 +1,7 @@ /* * relay-buffer.c - display clients list on relay buffer * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-buffer.h b/src/plugins/relay/relay-buffer.h index 72a67d661..a377f4340 100644 --- a/src/plugins/relay/relay-buffer.h +++ b/src/plugins/relay/relay-buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c index 4a6a2615b..fbb00cebb 100644 --- a/src/plugins/relay/relay-client.c +++ b/src/plugins/relay/relay-client.c @@ -1,7 +1,7 @@ /* * relay-client.c - client functions for relay plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -263,8 +263,8 @@ relay_client_handshake_timer_cb (void *data, int remaining_calls) #endif /* HAVE_GNUTLS */ /* - * Reads text data from a client: splits data on '\n' and keep a partial message - * if date does not end with '\n'. + * Reads text data from a client: splits data on '\n' and keeps a partial + * message if data does not end with '\n'. */ void @@ -515,8 +515,7 @@ relay_client_recv_cb (void *arg_client, int fd) * * "A Pong frame MAY be sent unsolicited. This serves as a * unidirectional heartbeat. A response to an unsolicited - * Pong - * frame is not expected." + * Pong frame is not expected." */ return WEECHAT_RC_OK; } @@ -943,8 +942,7 @@ relay_client_timer_cb (void *data, int remaining_calls) { for (i = 0; i < 2; i++) { - if (ptr_client->outqueue->raw_message - && ptr_client->outqueue->raw_message[i]) + if (ptr_client->outqueue->raw_message[i]) { /* * print raw message and remove it from outqueue diff --git a/src/plugins/relay/relay-client.h b/src/plugins/relay/relay-client.h index 8e8a2c59d..db2366aed 100644 --- a/src/plugins/relay/relay-client.h +++ b/src/plugins/relay/relay-client.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c index b6c958a06..e795bdeaa 100644 --- a/src/plugins/relay/relay-command.c +++ b/src/plugins/relay/relay-command.c @@ -1,7 +1,7 @@ /* * relay-command.c - relay command * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-command.h b/src/plugins/relay/relay-command.h index 0ff5c99d6..23a90dcf0 100644 --- a/src/plugins/relay/relay-command.h +++ b/src/plugins/relay/relay-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-completion.c b/src/plugins/relay/relay-completion.c index 7c6fd7486..b1fed1062 100644 --- a/src/plugins/relay/relay-completion.c +++ b/src/plugins/relay/relay-completion.c @@ -1,7 +1,7 @@ /* * relay-completion.c - completion for relay command * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-completion.h b/src/plugins/relay/relay-completion.h index f522103d5..e8f36f601 100644 --- a/src/plugins/relay/relay-completion.h +++ b/src/plugins/relay/relay-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c index cd76bd34d..ec1ec0474 100644 --- a/src/plugins/relay/relay-config.c +++ b/src/plugins/relay/relay-config.c @@ -1,7 +1,7 @@ /* * relay-config.c - relay configuration options (file relay.conf) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -68,6 +68,7 @@ struct t_config_option *relay_config_network_websocket_allowed_origins; struct t_config_option *relay_config_irc_backlog_max_minutes; struct t_config_option *relay_config_irc_backlog_max_number; struct t_config_option *relay_config_irc_backlog_since_last_disconnect; +struct t_config_option *relay_config_irc_backlog_since_last_message; struct t_config_option *relay_config_irc_backlog_tags; struct t_config_option *relay_config_irc_backlog_time_format; @@ -816,6 +817,11 @@ relay_config_init () "backlog_since_last_disconnect", "boolean", N_("display backlog starting from last client disconnect"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + relay_config_irc_backlog_since_last_message = weechat_config_new_option ( + relay_config_file, ptr_section, + "backlog_since_last_message", "boolean", + N_("display backlog starting from your last message"), + NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); relay_config_irc_backlog_tags = weechat_config_new_option ( relay_config_file, ptr_section, "backlog_tags", "string", diff --git a/src/plugins/relay/relay-config.h b/src/plugins/relay/relay-config.h index 09c1851c8..08597900c 100644 --- a/src/plugins/relay/relay-config.h +++ b/src/plugins/relay/relay-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -50,6 +50,7 @@ extern struct t_config_option *relay_config_network_websocket_allowed_origins; extern struct t_config_option *relay_config_irc_backlog_max_minutes; extern struct t_config_option *relay_config_irc_backlog_max_number; extern struct t_config_option *relay_config_irc_backlog_since_last_disconnect; +extern struct t_config_option *relay_config_irc_backlog_since_last_message; extern struct t_config_option *relay_config_irc_backlog_tags; extern struct t_config_option *relay_config_irc_backlog_time_format; diff --git a/src/plugins/relay/relay-info.c b/src/plugins/relay/relay-info.c index 05a0bbaa2..123243fe7 100644 --- a/src/plugins/relay/relay-info.c +++ b/src/plugins/relay/relay-info.c @@ -1,7 +1,7 @@ /* * relay-info.c - info and infolist hooks for relay plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-info.h b/src/plugins/relay/relay-info.h index 376fa494f..6d0fbe04e 100644 --- a/src/plugins/relay/relay-info.h +++ b/src/plugins/relay/relay-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-network.c b/src/plugins/relay/relay-network.c index 88c6125a3..07496051e 100644 --- a/src/plugins/relay/relay-network.c +++ b/src/plugins/relay/relay-network.c @@ -1,7 +1,7 @@ /* * relay-network.c - network functions for relay plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-network.h b/src/plugins/relay/relay-network.h index c881c3ab9..7e2fc43fa 100644 --- a/src/plugins/relay/relay-network.h +++ b/src/plugins/relay/relay-network.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-raw.c b/src/plugins/relay/relay-raw.c index 465cac7a6..28a1b55b6 100644 --- a/src/plugins/relay/relay-raw.c +++ b/src/plugins/relay/relay-raw.c @@ -1,7 +1,7 @@ /* * relay-raw.c - functions for Relay raw data messages * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-raw.h b/src/plugins/relay/relay-raw.h index ef0f8a1b3..a4d8d4f02 100644 --- a/src/plugins/relay/relay-raw.h +++ b/src/plugins/relay/relay-raw.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c index adfe662d1..56fd8da12 100644 --- a/src/plugins/relay/relay-server.c +++ b/src/plugins/relay/relay-server.c @@ -1,7 +1,7 @@ /* * relay-server.c - server functions for relay plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-server.h b/src/plugins/relay/relay-server.h index 2323d21ea..64212bad5 100644 --- a/src/plugins/relay/relay-server.h +++ b/src/plugins/relay/relay-server.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-upgrade.c b/src/plugins/relay/relay-upgrade.c index bfdcaa358..773fabed7 100644 --- a/src/plugins/relay/relay-upgrade.c +++ b/src/plugins/relay/relay-upgrade.c @@ -1,7 +1,7 @@ /* * relay-upgrade.c - save/restore relay plugin data when upgrading WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-upgrade.h b/src/plugins/relay/relay-upgrade.h index ba842f4a3..995d81bc3 100644 --- a/src/plugins/relay/relay-upgrade.h +++ b/src/plugins/relay/relay-upgrade.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-websocket.c b/src/plugins/relay/relay-websocket.c index 91862d65a..95a59f4b4 100644 --- a/src/plugins/relay/relay-websocket.c +++ b/src/plugins/relay/relay-websocket.c @@ -1,7 +1,7 @@ /* * relay-websocket.c - websocket server functions for relay plugin (RFC 6455) * - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay-websocket.h b/src/plugins/relay/relay-websocket.h index a88a8fad0..8d6e565b9 100644 --- a/src/plugins/relay/relay-websocket.h +++ b/src/plugins/relay/relay-websocket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2013-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay.c b/src/plugins/relay/relay.c index ead40834c..e5b2e0482 100644 --- a/src/plugins/relay/relay.c +++ b/src/plugins/relay/relay.c @@ -1,7 +1,7 @@ /* * relay.c - network communication between WeeChat and remote client * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/relay.h b/src/plugins/relay/relay.h index 8c1c9219d..f802fdec6 100644 --- a/src/plugins/relay/relay.h +++ b/src/plugins/relay/relay.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/weechat/relay-weechat-msg.c b/src/plugins/relay/weechat/relay-weechat-msg.c index ff7a19dfb..8ddc1fc1f 100644 --- a/src/plugins/relay/weechat/relay-weechat-msg.c +++ b/src/plugins/relay/weechat/relay-weechat-msg.c @@ -1,7 +1,7 @@ /* * relay-weechat-msg.c - build binary messages for WeeChat protocol * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/weechat/relay-weechat-msg.h b/src/plugins/relay/weechat/relay-weechat-msg.h index 4cf988109..8c55ab455 100644 --- a/src/plugins/relay/weechat/relay-weechat-msg.h +++ b/src/plugins/relay/weechat/relay-weechat-msg.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/weechat/relay-weechat-nicklist.c b/src/plugins/relay/weechat/relay-weechat-nicklist.c index be719b54d..73f997808 100644 --- a/src/plugins/relay/weechat/relay-weechat-nicklist.c +++ b/src/plugins/relay/weechat/relay-weechat-nicklist.c @@ -1,7 +1,7 @@ /* * relay-weechat-nicklist.c - nicklist functions for WeeChat protocol * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/weechat/relay-weechat-nicklist.h b/src/plugins/relay/weechat/relay-weechat-nicklist.h index 5ba846470..2aebfaf72 100644 --- a/src/plugins/relay/weechat/relay-weechat-nicklist.h +++ b/src/plugins/relay/weechat/relay-weechat-nicklist.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c index 6227a4987..f216cb56f 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.c +++ b/src/plugins/relay/weechat/relay-weechat-protocol.c @@ -1,7 +1,7 @@ /* * relay-weechat-protocol.c - WeeChat protocol for relay to client * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -405,7 +405,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(input) struct t_gui_buffer *ptr_buffer; char *pos, **timer_args; - RELAY_WEECHAT_PROTOCOL_MIN_ARGS(2); + RELAY_WEECHAT_PROTOCOL_MIN_ARGS(1); ptr_buffer = relay_weechat_protocol_get_buffer (argv[0]); if (!ptr_buffer) @@ -417,7 +417,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(input) "\"%s %s\""), RELAY_PLUGIN_NAME, command, - argv_eol[0]); + argv[0]); } return WEECHAT_RC_OK; } @@ -1351,7 +1351,7 @@ relay_weechat_protocol_recv (struct t_relay_client *client, const char *data) pos++; } argv = weechat_string_split (pos, " ", 0, 0, &argc); - argv_eol = weechat_string_split (pos, " ", 1, 0, NULL); + argv_eol = weechat_string_split (pos, " ", 2, 0, NULL); } for (i = 0; protocol_cb[i].name; i++) diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.h b/src/plugins/relay/weechat/relay-weechat-protocol.h index c69bd9662..4de3aecb3 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.h +++ b/src/plugins/relay/weechat/relay-weechat-protocol.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/weechat/relay-weechat.c b/src/plugins/relay/weechat/relay-weechat.c index 10b7b84ac..be0ac4400 100644 --- a/src/plugins/relay/weechat/relay-weechat.c +++ b/src/plugins/relay/weechat/relay-weechat.c @@ -1,7 +1,7 @@ /* * relay-weechat.c - WeeChat protocol for relay to client * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/relay/weechat/relay-weechat.h b/src/plugins/relay/weechat/relay-weechat.h index b07a0c2a7..678845b91 100644 --- a/src/plugins/relay/weechat/relay-weechat.h +++ b/src/plugins/relay/weechat/relay-weechat.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/ruby/CMakeLists.txt b/src/plugins/ruby/CMakeLists.txt index eb513f78d..2d03858c5 100644 --- a/src/plugins/ruby/CMakeLists.txt +++ b/src/plugins/ruby/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/ruby/Makefile.am b/src/plugins/ruby/Makefile.am index c03eca335..01c3e932d 100644 --- a/src/plugins/ruby/Makefile.am +++ b/src/plugins/ruby/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c index a8bb43612..573757375 100644 --- a/src/plugins/ruby/weechat-ruby-api.c +++ b/src/plugins/ruby/weechat-ruby-api.c @@ -1,7 +1,7 @@ /* * weechat-ruby-api.c - ruby API functions * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * Copyright (C) 2012 Simon Arlott * diff --git a/src/plugins/ruby/weechat-ruby-api.h b/src/plugins/ruby/weechat-ruby-api.h index 3275892ee..d6676bb03 100644 --- a/src/plugins/ruby/weechat-ruby-api.h +++ b/src/plugins/ruby/weechat-ruby-api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c index 409806ba5..d55e1d7c4 100644 --- a/src/plugins/ruby/weechat-ruby.c +++ b/src/plugins/ruby/weechat-ruby.c @@ -1,7 +1,7 @@ /* * weechat-ruby.c - ruby plugin for WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. @@ -1093,9 +1093,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) " if RUBY_VERSION.split('.')[0] == '1' and RUBY_VERSION.split('.')[1] <= '8'\n" " require 'rubygems'\n" " else\n" - " require 'enc/encdb.so'\n" - " require 'enc/trans/transdb.so'\n" - "\n" " require 'thread'\n" " class ::Mutex\n" " def synchronize(*args)\n" @@ -1118,6 +1115,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) " end\n" "\n" " begin\n" + " require 'enc/encdb.so'\n" + " require 'enc/trans/transdb.so'\n" " module_eval(lines)\n" " rescue Exception => e\n" " @load_eval_file_error = e\n" diff --git a/src/plugins/ruby/weechat-ruby.h b/src/plugins/ruby/weechat-ruby.h index f2c8a70bb..cde73fb85 100644 --- a/src/plugins/ruby/weechat-ruby.h +++ b/src/plugins/ruby/weechat-ruby.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org> * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/script/CMakeLists.txt b/src/plugins/script/CMakeLists.txt index eade5489a..cb7af6d79 100644 --- a/src/plugins/script/CMakeLists.txt +++ b/src/plugins/script/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/script/Makefile.am b/src/plugins/script/Makefile.am index 680d103c2..b5f0c7c90 100644 --- a/src/plugins/script/Makefile.am +++ b/src/plugins/script/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c index 753be0531..2dab05f53 100644 --- a/src/plugins/script/script-action.c +++ b/src/plugins/script/script-action.c @@ -1,7 +1,7 @@ /* * script-action.c - actions on scripts * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-action.h b/src/plugins/script/script-action.h index 25f6b145c..c11a9fe56 100644 --- a/src/plugins/script/script-action.h +++ b/src/plugins/script/script-action.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-buffer.c b/src/plugins/script/script-buffer.c index 08daebc42..0bf1ec642 100644 --- a/src/plugins/script/script-buffer.c +++ b/src/plugins/script/script-buffer.c @@ -1,7 +1,7 @@ /* * script-buffer.c - display scripts on script buffer * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-buffer.h b/src/plugins/script/script-buffer.h index d717dff9b..63b5f6af6 100644 --- a/src/plugins/script/script-buffer.h +++ b/src/plugins/script/script-buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-command.c b/src/plugins/script/script-command.c index d7e0cb576..20916368e 100644 --- a/src/plugins/script/script-command.c +++ b/src/plugins/script/script-command.c @@ -1,7 +1,7 @@ /* * script-command.c - script command * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -279,7 +279,7 @@ script_command_script (void *data, struct t_gui_buffer *buffer, int argc, } /* - * Hook command. + * Hooks script command. */ void @@ -300,8 +300,9 @@ script_command_init () " -o: send list of loaded scripts to buffer\n" " -i: copy list of loaded scripts in command line (for " "sending to buffer)\n" - " search: search scripts by tags or text and display result " - "on scripts buffer\n" + " search: search scripts by tags, language (python, " + "perl, ...), filename extension (py, pl, ...) or text; result is " + "displayed on scripts buffer\n" " show: show detailed info about a script\n" " load: load script(s)\n" " unload: unload script(s)\n" @@ -366,7 +367,7 @@ script_command_init () " /script reload urlserver\n" " /script upgrade"), "list -o|-i" - " || search %(script_tags)" + " || search %(script_tags)|%(script_languages)|%(script_extensions)" " || show %(script_scripts)" " || load %(script_files)|%*" " || unload %(python_script)|%(perl_script)|%(ruby_script)|" diff --git a/src/plugins/script/script-command.h b/src/plugins/script/script-command.h index c29e82a5a..8ed1ed137 100644 --- a/src/plugins/script/script-command.h +++ b/src/plugins/script/script-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-completion.c b/src/plugins/script/script-completion.c index 16749c56e..781fd4877 100644 --- a/src/plugins/script/script-completion.c +++ b/src/plugins/script/script-completion.c @@ -1,7 +1,7 @@ /* * script-completion.c - completions for script command * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -30,6 +30,58 @@ /* + * Adds script languages (python, perl, ruby, ...) to completion list. + */ + +int +script_completion_languages_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; i < SCRIPT_NUM_LANGUAGES; i++) + { + weechat_hook_completion_list_add (completion, + script_language[i], + 0, WEECHAT_LIST_POS_SORT); + } + + return WEECHAT_RC_OK; +} + +/* + * Adds script extensions (py, pl, rb, ...) to completion list. + */ + +int +script_completion_extensions_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; i < SCRIPT_NUM_LANGUAGES; i++) + { + weechat_hook_completion_list_add (completion, + script_extension[i], + 0, WEECHAT_LIST_POS_SORT); + } + + return WEECHAT_RC_OK; +} + +/* * Adds scripts to completion list. */ @@ -215,6 +267,12 @@ script_completion_tags_cb (void *data, const char *completion_item, void script_completion_init () { + weechat_hook_completion ("script_languages", + N_("list of script languages"), + &script_completion_languages_cb, NULL); + weechat_hook_completion ("script_extensions", + N_("list of script extensions"), + &script_completion_extensions_cb, NULL); weechat_hook_completion ("script_scripts", N_("list of scripts in repository"), &script_completion_scripts_cb, NULL); diff --git a/src/plugins/script/script-completion.h b/src/plugins/script/script-completion.h index 64a3d844d..830be0e12 100644 --- a/src/plugins/script/script-completion.h +++ b/src/plugins/script/script-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-config.c b/src/plugins/script/script-config.c index 69aec5d8f..ac5363190 100644 --- a/src/plugins/script/script-config.c +++ b/src/plugins/script/script-config.c @@ -1,7 +1,7 @@ /* * script-config.c - script configuration options (file script.conf) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-config.h b/src/plugins/script/script-config.h index 2917e7da4..381a94eb3 100644 --- a/src/plugins/script/script-config.h +++ b/src/plugins/script/script-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-info.c b/src/plugins/script/script-info.c index c5eb83832..e9df673cb 100644 --- a/src/plugins/script/script-info.c +++ b/src/plugins/script/script-info.c @@ -1,7 +1,7 @@ /* * script-info.c - info, infolist and hdata hooks for script plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-info.h b/src/plugins/script/script-info.h index 797ffe205..b506c4cb2 100644 --- a/src/plugins/script/script-info.h +++ b/src/plugins/script/script-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index bef5fad17..10f79ed16 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -1,7 +1,7 @@ /* * script-repo.c - download and read repository file (plugins.xml.gz) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -948,13 +948,33 @@ script_repo_match_filter (struct t_script_repo *script) if (!has_tag) { match = 0; + if (script->name_with_extension - && weechat_strcasestr (script->name_with_extension, words[i])) + && weechat_strcasestr (script->name_with_extension, + words[i])) + { match = 1; + } + + if (!match + && (weechat_strcasecmp (script_language[script->language], + words[i]) == 0)) + { + match = 1; + } + + if (!match + && (weechat_strcasecmp (script_extension[script->language], + words[i]) == 0)) + { + match = 1; + } if (!match && script->description && weechat_strcasestr (script->description, words[i])) + { match = 1; + } if (!match) { diff --git a/src/plugins/script/script-repo.h b/src/plugins/script/script-repo.h index 6d6f05f72..8d14b0300 100644 --- a/src/plugins/script/script-repo.h +++ b/src/plugins/script/script-repo.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script.c b/src/plugins/script/script.c index 75c4744bd..f5dfe4294 100644 --- a/src/plugins/script/script.c +++ b/src/plugins/script/script.c @@ -1,7 +1,7 @@ /* * script.c - scripts manager for WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/script/script.h b/src/plugins/script/script.h index 0c93a7863..0fd7eb9e7 100644 --- a/src/plugins/script/script.h +++ b/src/plugins/script/script.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/tcl/CMakeLists.txt b/src/plugins/tcl/CMakeLists.txt index ed10bad5b..10a89995d 100644 --- a/src/plugins/tcl/CMakeLists.txt +++ b/src/plugins/tcl/CMakeLists.txt @@ -1,7 +1,7 @@ # # Copyright (C) 2008-2010 Dmitry Kobylin <fnfal@academ.tsc.ru> # Copyright (C) 2008 Julien Louis <ptitlouis@sysif.net> -# Copyright (C) 2008-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2008-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/tcl/Makefile.am b/src/plugins/tcl/Makefile.am index 479e23b8b..344959de3 100644 --- a/src/plugins/tcl/Makefile.am +++ b/src/plugins/tcl/Makefile.am @@ -1,6 +1,6 @@ # # Copyright (C) 2008-2010 Dmitry Kobylin <fnfal@academ.tsc.ru> -# Copyright (C) 2008-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2008-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index d75436878..8930927e5 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -3,7 +3,7 @@ * * Copyright (C) 2008-2010 Dmitry Kobylin <fnfal@academ.tsc.ru> * Copyright (C) 2008 Julien Louis <ptitlouis@sysif.net> - * Copyright (C) 2008-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2008-2016 Sébastien Helleu <flashcode@flashtux.org> * Copyright (C) 2012 Simon Arlott * * This file is part of WeeChat, the extensible chat client. diff --git a/src/plugins/tcl/weechat-tcl-api.h b/src/plugins/tcl/weechat-tcl-api.h index 22675d4b2..5fd7d7ab4 100644 --- a/src/plugins/tcl/weechat-tcl-api.h +++ b/src/plugins/tcl/weechat-tcl-api.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2008-2010 Dmitry Kobylin <fnfal@academ.tsc.ru> - * Copyright (C) 2008-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2008-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c index e2c32187c..eed63715a 100644 --- a/src/plugins/tcl/weechat-tcl.c +++ b/src/plugins/tcl/weechat-tcl.c @@ -2,7 +2,7 @@ * weechat-tcl.c - tcl plugin for WeeChat * * Copyright (C) 2008-2010 Dmitry Kobylin <fnfal@academ.tsc.ru> - * Copyright (C) 2008-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2008-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/tcl/weechat-tcl.h b/src/plugins/tcl/weechat-tcl.h index 3bbf6580a..b2d59277b 100644 --- a/src/plugins/tcl/weechat-tcl.h +++ b/src/plugins/tcl/weechat-tcl.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2008-2010 Dmitry Kobylin <fnfal@academ.tsc.ru> - * Copyright (C) 2008-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2008-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/CMakeLists.txt b/src/plugins/trigger/CMakeLists.txt index c98ecfb56..c43eb4721 100644 --- a/src/plugins/trigger/CMakeLists.txt +++ b/src/plugins/trigger/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/trigger/Makefile.am b/src/plugins/trigger/Makefile.am index d612840cb..7a08e8173 100644 --- a/src/plugins/trigger/Makefile.am +++ b/src/plugins/trigger/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/trigger/trigger-buffer.c b/src/plugins/trigger/trigger-buffer.c index c8aea8af0..7fd28e9f4 100644 --- a/src/plugins/trigger/trigger-buffer.c +++ b/src/plugins/trigger/trigger-buffer.c @@ -1,7 +1,7 @@ /* * trigger-buffer.c - debug buffer for triggers * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger-buffer.h b/src/plugins/trigger/trigger-buffer.h index 1b30c7951..d61a9144a 100644 --- a/src/plugins/trigger/trigger-buffer.h +++ b/src/plugins/trigger/trigger-buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -22,7 +22,7 @@ #define TRIGGER_BUFFER_NAME "monitor" -struct t_gui_buffer *trigger_buffer; +extern struct t_gui_buffer *trigger_buffer; extern void trigger_buffer_set_callbacks (); extern void trigger_buffer_open (const char *filter, int switch_to_buffer); diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c index cd89f6a2c..78b3636e8 100644 --- a/src/plugins/trigger/trigger-callback.c +++ b/src/plugins/trigger/trigger-callback.c @@ -1,7 +1,7 @@ /* * trigger-callback.c - callbacks for triggers * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger-callback.h b/src/plugins/trigger/trigger-callback.h index e0b8b0663..9e411d763 100644 --- a/src/plugins/trigger/trigger-callback.h +++ b/src/plugins/trigger/trigger-callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger-command.c b/src/plugins/trigger/trigger-command.c index 9faa77507..602b82f5b 100644 --- a/src/plugins/trigger/trigger-command.c +++ b/src/plugins/trigger/trigger-command.c @@ -1,7 +1,7 @@ /* * trigger-command.c - trigger command * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -405,8 +405,9 @@ trigger_command_rename (struct t_trigger *trigger, const char *new_name) if (!trigger_name_valid (name2)) { weechat_printf_tags (NULL, "no_trigger", - _("%s%s: invalid name for trigger"), - weechat_prefix ("error"), TRIGGER_PLUGIN_NAME); + _("%s%s: invalid trigger name: \"%s\""), + weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, + name2); goto end; } /* check that no trigger already exists with the new name */ @@ -496,15 +497,16 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, if (!trigger_name_valid (sargv[0])) { weechat_printf_tags (NULL, "no_trigger", - _("%s%s: invalid name for trigger"), - weechat_prefix ("error"), TRIGGER_PLUGIN_NAME); + _("%s%s: invalid trigger name: \"%s\""), + weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, + sargv[0]); goto end; } type = trigger_search_hook_type (sargv[1]); if (type < 0) { weechat_printf_tags (NULL, "no_trigger", - _("%s%s: invalid hook type \"%s\""), + _("%s%s: invalid hook type: \"%s\""), weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, sargv[1]); goto end; @@ -548,7 +550,7 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, && (trigger_search_return_code (sargv[6]) < 0)) { weechat_printf_tags (NULL, "no_trigger", - _("%s%s: invalid return code \"%s\""), + _("%s%s: invalid return code: \"%s\""), weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, sargv[6]); goto end; @@ -622,7 +624,7 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, if (type < 0) { weechat_printf_tags (NULL, "no_trigger", - _("%s%s: invalid hook type \"%s\""), + _("%s%s: invalid hook type: \"%s\""), weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, argv[2]); goto end; @@ -783,8 +785,9 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc, if (!trigger_name_valid (argv[3])) { weechat_printf_tags (NULL, "no_trigger", - _("%s%s: invalid name for trigger"), - weechat_prefix ("error"), TRIGGER_PLUGIN_NAME); + _("%s%s: invalid trigger name: \"%s\""), + weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, + argv[3]); goto end; } /* check that no trigger already exists with the new name */ diff --git a/src/plugins/trigger/trigger-command.h b/src/plugins/trigger/trigger-command.h index b9720c5d3..88e080518 100644 --- a/src/plugins/trigger/trigger-command.h +++ b/src/plugins/trigger/trigger-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger-completion.c b/src/plugins/trigger/trigger-completion.c index 1fede9bfc..c0f39dba0 100644 --- a/src/plugins/trigger/trigger-completion.c +++ b/src/plugins/trigger/trigger-completion.c @@ -1,7 +1,7 @@ /* * trigger-completion.c - completion for trigger commands * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger-completion.h b/src/plugins/trigger/trigger-completion.h index cbad0a58e..7c72ecbe7 100644 --- a/src/plugins/trigger/trigger-completion.h +++ b/src/plugins/trigger/trigger-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c index e4d2a5827..9db2e797a 100644 --- a/src/plugins/trigger/trigger-config.c +++ b/src/plugins/trigger/trigger-config.c @@ -1,7 +1,7 @@ /* * trigger-config.c - trigger configuration options (file trigger.conf) * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger-config.h b/src/plugins/trigger/trigger-config.h index 8933a00cc..f934b9ddd 100644 --- a/src/plugins/trigger/trigger-config.h +++ b/src/plugins/trigger/trigger-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c index c0e435625..0c4f121d0 100644 --- a/src/plugins/trigger/trigger.c +++ b/src/plugins/trigger/trigger.c @@ -1,7 +1,7 @@ /* * trigger.c - trigger plugin for WeeChat * - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -848,7 +848,7 @@ trigger_new_with_options (const char *name, struct t_config_option **options) &new_trigger->regex) < 0) { weechat_printf (NULL, - _("%s%s: invalid regular expression in trigger " + _("%s%s: invalid regular expression in trigger: " "\"%s\""), weechat_prefix ("error"), TRIGGER_PLUGIN_NAME, name); diff --git a/src/plugins/trigger/trigger.h b/src/plugins/trigger/trigger.h index 990c02f92..fdf3b83c3 100644 --- a/src/plugins/trigger/trigger.h +++ b/src/plugins/trigger/trigger.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2014-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 801ab78e9..0b8c24e8b 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -1,7 +1,7 @@ /* * weechat-plugin.h - header to compile WeeChat plugins * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/CMakeLists.txt b/src/plugins/xfer/CMakeLists.txt index 54412a8c1..9fb1ce651 100644 --- a/src/plugins/xfer/CMakeLists.txt +++ b/src/plugins/xfer/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/xfer/Makefile.am b/src/plugins/xfer/Makefile.am index faa6a1384..bb4fecd22 100644 --- a/src/plugins/xfer/Makefile.am +++ b/src/plugins/xfer/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> +# Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat, the extensible chat client. # diff --git a/src/plugins/xfer/xfer-buffer.c b/src/plugins/xfer/xfer-buffer.c index 48272f77f..c6840a44a 100644 --- a/src/plugins/xfer/xfer-buffer.c +++ b/src/plugins/xfer/xfer-buffer.c @@ -1,7 +1,7 @@ /* * xfer-buffer.c - display xfer list on xfer buffer * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-buffer.h b/src/plugins/xfer/xfer-buffer.h index b1cc5f3df..a855f0939 100644 --- a/src/plugins/xfer/xfer-buffer.h +++ b/src/plugins/xfer/xfer-buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-chat.c b/src/plugins/xfer/xfer-chat.c index 94af315b1..5ac687da0 100644 --- a/src/plugins/xfer/xfer-chat.c +++ b/src/plugins/xfer/xfer-chat.c @@ -1,7 +1,7 @@ /* * xfer-chat.c - chat with direct connection to remote host * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-chat.h b/src/plugins/xfer/xfer-chat.h index bea5ca581..f2ecca818 100644 --- a/src/plugins/xfer/xfer-chat.h +++ b/src/plugins/xfer/xfer-chat.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-command.c b/src/plugins/xfer/xfer-command.c index ff5f18f01..21790fa09 100644 --- a/src/plugins/xfer/xfer-command.c +++ b/src/plugins/xfer/xfer-command.c @@ -1,7 +1,7 @@ /* * xfer-command.c - xfer command * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-command.h b/src/plugins/xfer/xfer-command.h index 81c3173ed..1b9e79994 100644 --- a/src/plugins/xfer/xfer-command.h +++ b/src/plugins/xfer/xfer-command.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-completion.c b/src/plugins/xfer/xfer-completion.c index f1a0e3744..a65e34aeb 100644 --- a/src/plugins/xfer/xfer-completion.c +++ b/src/plugins/xfer/xfer-completion.c @@ -1,7 +1,7 @@ /* * xfer-completion.c - nick completion for xfer chats * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-completion.h b/src/plugins/xfer/xfer-completion.h index 32aece32c..88e06d324 100644 --- a/src/plugins/xfer/xfer-completion.h +++ b/src/plugins/xfer/xfer-completion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c index e2aba74a6..e6d374a30 100644 --- a/src/plugins/xfer/xfer-config.c +++ b/src/plugins/xfer/xfer-config.c @@ -1,7 +1,7 @@ /* * xfer-config.c - xfer configuration options (file xfer.conf) * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-config.h b/src/plugins/xfer/xfer-config.h index 1996fc89c..500f2322e 100644 --- a/src/plugins/xfer/xfer-config.h +++ b/src/plugins/xfer/xfer-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * @@ -42,9 +42,9 @@ extern struct t_config_option *xfer_config_network_port_range; extern struct t_config_option *xfer_config_network_speed_limit; extern struct t_config_option *xfer_config_network_timeout; -struct t_config_option *xfer_config_file_auto_accept_chats; -struct t_config_option *xfer_config_file_auto_accept_files; -struct t_config_option *xfer_config_file_auto_accept_nicks; +extern struct t_config_option *xfer_config_file_auto_accept_chats; +extern struct t_config_option *xfer_config_file_auto_accept_files; +extern struct t_config_option *xfer_config_file_auto_accept_nicks; extern struct t_config_option *xfer_config_file_auto_rename; extern struct t_config_option *xfer_config_file_auto_resume; extern struct t_config_option *xfer_config_file_auto_check_crc32; diff --git a/src/plugins/xfer/xfer-dcc.c b/src/plugins/xfer/xfer-dcc.c index 850585311..4ea5e43bf 100644 --- a/src/plugins/xfer/xfer-dcc.c +++ b/src/plugins/xfer/xfer-dcc.c @@ -1,7 +1,7 @@ /* * xfer-dcc.c - file transfer via DCC protocol * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-dcc.h b/src/plugins/xfer/xfer-dcc.h index c74a6fddc..1a1ab598c 100644 --- a/src/plugins/xfer/xfer-dcc.h +++ b/src/plugins/xfer/xfer-dcc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-file.c b/src/plugins/xfer/xfer-file.c index 65f2cd42c..83b07ec09 100644 --- a/src/plugins/xfer/xfer-file.c +++ b/src/plugins/xfer/xfer-file.c @@ -1,7 +1,7 @@ /* * xfer-file.c - file functions for xfer plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-file.h b/src/plugins/xfer/xfer-file.h index 84ab7012a..65e52e8c4 100644 --- a/src/plugins/xfer/xfer-file.h +++ b/src/plugins/xfer/xfer-file.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-info.c b/src/plugins/xfer/xfer-info.c index 98719607a..d4a5b5c69 100644 --- a/src/plugins/xfer/xfer-info.c +++ b/src/plugins/xfer/xfer-info.c @@ -1,7 +1,7 @@ /* * xfer-info.c - info and infolist hooks for xfer plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-info.h b/src/plugins/xfer/xfer-info.h index ed23010db..7f20b9c6b 100644 --- a/src/plugins/xfer/xfer-info.h +++ b/src/plugins/xfer/xfer-info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c index 9200298a1..d536b4fb4 100644 --- a/src/plugins/xfer/xfer-network.c +++ b/src/plugins/xfer/xfer-network.c @@ -1,7 +1,7 @@ /* * xfer-network.c - network functions for xfer plugin * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-network.h b/src/plugins/xfer/xfer-network.h index cacf10619..67b41a56a 100644 --- a/src/plugins/xfer/xfer-network.h +++ b/src/plugins/xfer/xfer-network.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-upgrade.c b/src/plugins/xfer/xfer-upgrade.c index 52f154c77..65b3bbcab 100644 --- a/src/plugins/xfer/xfer-upgrade.c +++ b/src/plugins/xfer/xfer-upgrade.c @@ -1,7 +1,7 @@ /* * xfer-upgrade.c - save/restore xfer plugin data when upgrading WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer-upgrade.h b/src/plugins/xfer/xfer-upgrade.h index 9c2b290fd..a44563523 100644 --- a/src/plugins/xfer/xfer-upgrade.h +++ b/src/plugins/xfer/xfer-upgrade.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index 84d43aade..5af0fc7cf 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -1,7 +1,7 @@ /* * xfer.c - file transfer and direct chat plugin for WeeChat * - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * diff --git a/src/plugins/xfer/xfer.h b/src/plugins/xfer/xfer.h index 0638151dc..f099abbe2 100644 --- a/src/plugins/xfer/xfer.h +++ b/src/plugins/xfer/xfer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org> + * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * |