From 99bdc4f2514bda980fcf9cd8f4a122b2fbee1cf0 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 10 Mar 2017 15:42:46 +0800 Subject: [PATCH 1/9] Fix email address pattern, it can starts with digit --- src/common/url.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/url.c b/src/common/url.c index b9e0f675..a741fb04 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -601,7 +601,7 @@ re_url (void) } /* EMAIL description --- */ -#define EMAIL "[a-z][._%+-a-z0-9]+@" "(" HOST_URL ")" +#define EMAIL "[a-z0-9][._%+-a-z0-9]+@" "(" HOST_URL ")" static const GRegex * re_email (void) From 2f0239eb1891ff84e29a24513b832d1278eddd93 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 23 Mar 2017 15:15:22 +0100 Subject: [PATCH 2/9] Fix bashism From tnn@ of NetBSD. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d4357893..fc4f8e77 100644 --- a/configure.ac +++ b/configure.ac @@ -605,7 +605,7 @@ AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes") AM_CONDITIONAL(HAVE_ISO_CODES, test "x$isocodes" = "xyes") AM_CONDITIONAL(HAVE_GTK_MAC, test "x$_gdk_tgt" = xquartz) AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno") -AM_CONDITIONAL(PLATFORM_OSX, test "x$platform_osx" == "xyes") +AM_CONDITIONAL(PLATFORM_OSX, test "x$platform_osx" = "xyes") dnl ********************************************************************* dnl ** CFLAGS *********************************************************** From dd64be01748d4c6942d119e6aa94ba0ff8bbf6a9 Mon Sep 17 00:00:00 2001 From: Jesse Date: Wed, 25 Jan 2017 12:09:11 -0500 Subject: [PATCH 3/9] Add a method to the plugin API Add a method to the plugin API to directly send to a server. --- src/common/hexchat-plugin.h | 5 +++++ src/common/plugin.c | 17 +++++++++++++++++ src/common/plugin.h | 1 + 3 files changed, 23 insertions(+) diff --git a/src/common/hexchat-plugin.h b/src/common/hexchat-plugin.h index 002c0c49..77a1e8ed 100644 --- a/src/common/hexchat-plugin.h +++ b/src/common/hexchat-plugin.h @@ -193,6 +193,7 @@ struct _hexchat_plugin hexchat_event_attrs *(*hexchat_event_attrs_create) (hexchat_plugin *ph); void (*hexchat_event_attrs_free) (hexchat_plugin *ph, hexchat_event_attrs *attrs); + void(*hexchat_send_raw) (hexchat_plugin *ph, const char * const text); }; #endif @@ -406,6 +407,9 @@ int hexchat_pluginpref_list (hexchat_plugin *ph, char *dest); +void +hexchat_send_raw(hexchat_plugin *ph, const char * const text); + #if !defined(PLUGIN_C) && defined(WIN32) #ifndef HEXCHAT_PLUGIN_HANDLE #define HEXCHAT_PLUGIN_HANDLE (ph) @@ -451,6 +455,7 @@ hexchat_pluginpref_list (hexchat_plugin *ph, #define hexchat_pluginpref_get_int ((HEXCHAT_PLUGIN_HANDLE)->hexchat_pluginpref_get_int) #define hexchat_pluginpref_delete ((HEXCHAT_PLUGIN_HANDLE)->hexchat_pluginpref_delete) #define hexchat_pluginpref_list ((HEXCHAT_PLUGIN_HANDLE)->hexchat_pluginpref_list) +#define hexchat_send_raw ((HEXCHAT_PLUGIN_HANDLE)->hexchat_send_raw) #endif #ifdef __cplusplus diff --git a/src/common/plugin.c b/src/common/plugin.c index b49afd96..53698c64 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -289,6 +289,7 @@ plugin_add (session *sess, char *filename, void *handle, void *init_func, pl->hexchat_emit_print_attrs = hexchat_emit_print_attrs; pl->hexchat_event_attrs_create = hexchat_event_attrs_create; pl->hexchat_event_attrs_free = hexchat_event_attrs_free; + pl->hexchat_send_raw = hexchat_send_raw; /* run hexchat_plugin_init, if it returns 0, close the plugin */ if (((hexchat_init_func *)init_func) (pl, &pl->name, &pl->desc, &pl->version, arg) == 0) @@ -2021,3 +2022,19 @@ hexchat_pluginpref_list (hexchat_plugin *pl, char* dest) return 1; } + +/* Send directly to the server + * Useful for bypassing all checks before sending that hexchat_command does + * Using this method also allows sending to the server during the connecting process + */ +void +hexchat_send_raw(hexchat_plugin *ph, const char * const text) +{ + if (!is_session(ph->context)) + { + DEBUG(PrintTextf(0, "%s\thexchat_send_raw called without a valid context.\n", ph->name)); + return; + } + + ((session *)ph->context)->server->p_raw(ph->context->server, text); +} diff --git a/src/common/plugin.h b/src/common/plugin.h index 76ce97a3..3df651d2 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -149,6 +149,7 @@ struct _hexchat_plugin hexchat_event_attrs *(*hexchat_event_attrs_create) (hexchat_plugin *ph); void (*hexchat_event_attrs_free) (hexchat_plugin *ph, hexchat_event_attrs *attrs); + void(*hexchat_send_raw) (hexchat_plugin *ph, const char * const text); /* PRIVATE FIELDS! */ void *handle; /* from dlopen */ From 006929d0c5ebdf48f55ffb32e3345e4ff785dca2 Mon Sep 17 00:00:00 2001 From: Jesse Date: Wed, 25 Jan 2017 12:11:57 -0500 Subject: [PATCH 4/9] Add hexchat_send_raw to the Lua plugin Add the hexchat_send_raw method to the Lua plugin. This refers to commit 3be5c45. --- plugins/lua/lua.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c index 0dc7aeda..66410825 100644 --- a/plugins/lua/lua.c +++ b/plugins/lua/lua.c @@ -776,6 +776,13 @@ static int api_hexchat_iterate(lua_State *L) return luaL_argerror(L, 1, "invalid list name"); } +static int api_hexchat_send_raw(lua_State *L) +{ + //hexchat_print(ph, lua_tostring(L, -1)); + hexchat_send_raw(ph, lua_tostring(L, -1)); + return 0; +} + static int api_hexchat_prefs_meta_index(lua_State *L) { char const *key = luaL_checkstring(L, 2); @@ -1045,6 +1052,7 @@ static luaL_Reg api_hexchat[] = { {"set_context", api_hexchat_set_context}, {"attrs", api_hexchat_attrs}, {"iterate", api_hexchat_iterate}, + {"send_raw", api_hexchat_send_raw }, {NULL, NULL} }; @@ -1137,6 +1145,7 @@ static int luaopen_hexchat(lua_State *L) wrap_context(L, "nickcmp", api_hexchat_nickcmp); wrap_context(L, "get_info", api_hexchat_get_info); wrap_context(L, "iterate", api_hexchat_iterate); + wrap_context(L, "send_raw", api_hexchat_send_raw); lua_setfield(L, -2, "__index"); lua_pushcfunction(L, api_hexchat_context_meta_eq); lua_setfield(L, -2, "__eq"); From 95913d747dfdd7e16059c081ea8861e6ddd9b869 Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 30 Jan 2017 16:06:52 -0500 Subject: [PATCH 5/9] Add plugin_pref_del to the Perl export list The documentation lists "HexChat::plugin_pref_del( $setting )" as the method to delete preferences but only plugin_pref_delete is exported. --- plugins/perl/lib/HexChat.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/perl/lib/HexChat.pm b/plugins/perl/lib/HexChat.pm index ebbed4fb..1b354de9 100644 --- a/plugins/perl/lib/HexChat.pm +++ b/plugins/perl/lib/HexChat.pm @@ -72,7 +72,7 @@ our %EXPORT_TAGS = ( qw(print prnt printf prntf command commandf emit_print), # output qw(find_context get_context set_context), # context qw(get_info get_prefs get_list context_info user_info), # input - qw(plugin_pref_set plugin_pref_get plugin_pref_delete plugin_pref_list), #settings + qw(plugin_pref_set plugin_pref_get plugin_pref_delete plugin_pref_del plugin_pref_list), #settings ], ); @@ -448,6 +448,10 @@ sub plugin_pref_delete { return HexChat::Internal::plugin_pref_delete($setting); } +sub plugin_pref_del { + goto &HexChat::plugin_pref_delete; +} + sub plugin_pref_list { my %list = HexChat::Internal::plugin_pref_list(); From 5c8f501c2cd3a27df4de49f59e13930364c7627e Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 30 Jan 2017 16:35:18 -0500 Subject: [PATCH 6/9] Revert "Add a method to the plugin API" This reverts commit 3be5c45d31bfc70c50b3aea54c05563247404845. --- src/common/hexchat-plugin.h | 5 ----- src/common/plugin.c | 17 ----------------- src/common/plugin.h | 1 - 3 files changed, 23 deletions(-) diff --git a/src/common/hexchat-plugin.h b/src/common/hexchat-plugin.h index 77a1e8ed..002c0c49 100644 --- a/src/common/hexchat-plugin.h +++ b/src/common/hexchat-plugin.h @@ -193,7 +193,6 @@ struct _hexchat_plugin hexchat_event_attrs *(*hexchat_event_attrs_create) (hexchat_plugin *ph); void (*hexchat_event_attrs_free) (hexchat_plugin *ph, hexchat_event_attrs *attrs); - void(*hexchat_send_raw) (hexchat_plugin *ph, const char * const text); }; #endif @@ -407,9 +406,6 @@ int hexchat_pluginpref_list (hexchat_plugin *ph, char *dest); -void -hexchat_send_raw(hexchat_plugin *ph, const char * const text); - #if !defined(PLUGIN_C) && defined(WIN32) #ifndef HEXCHAT_PLUGIN_HANDLE #define HEXCHAT_PLUGIN_HANDLE (ph) @@ -455,7 +451,6 @@ hexchat_send_raw(hexchat_plugin *ph, const char * const text); #define hexchat_pluginpref_get_int ((HEXCHAT_PLUGIN_HANDLE)->hexchat_pluginpref_get_int) #define hexchat_pluginpref_delete ((HEXCHAT_PLUGIN_HANDLE)->hexchat_pluginpref_delete) #define hexchat_pluginpref_list ((HEXCHAT_PLUGIN_HANDLE)->hexchat_pluginpref_list) -#define hexchat_send_raw ((HEXCHAT_PLUGIN_HANDLE)->hexchat_send_raw) #endif #ifdef __cplusplus diff --git a/src/common/plugin.c b/src/common/plugin.c index 53698c64..b49afd96 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -289,7 +289,6 @@ plugin_add (session *sess, char *filename, void *handle, void *init_func, pl->hexchat_emit_print_attrs = hexchat_emit_print_attrs; pl->hexchat_event_attrs_create = hexchat_event_attrs_create; pl->hexchat_event_attrs_free = hexchat_event_attrs_free; - pl->hexchat_send_raw = hexchat_send_raw; /* run hexchat_plugin_init, if it returns 0, close the plugin */ if (((hexchat_init_func *)init_func) (pl, &pl->name, &pl->desc, &pl->version, arg) == 0) @@ -2022,19 +2021,3 @@ hexchat_pluginpref_list (hexchat_plugin *pl, char* dest) return 1; } - -/* Send directly to the server - * Useful for bypassing all checks before sending that hexchat_command does - * Using this method also allows sending to the server during the connecting process - */ -void -hexchat_send_raw(hexchat_plugin *ph, const char * const text) -{ - if (!is_session(ph->context)) - { - DEBUG(PrintTextf(0, "%s\thexchat_send_raw called without a valid context.\n", ph->name)); - return; - } - - ((session *)ph->context)->server->p_raw(ph->context->server, text); -} diff --git a/src/common/plugin.h b/src/common/plugin.h index 3df651d2..76ce97a3 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -149,7 +149,6 @@ struct _hexchat_plugin hexchat_event_attrs *(*hexchat_event_attrs_create) (hexchat_plugin *ph); void (*hexchat_event_attrs_free) (hexchat_plugin *ph, hexchat_event_attrs *attrs); - void(*hexchat_send_raw) (hexchat_plugin *ph, const char * const text); /* PRIVATE FIELDS! */ void *handle; /* from dlopen */ From 2391c64e46ae613866e7c0070ddef01cbe638169 Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 30 Jan 2017 16:35:30 -0500 Subject: [PATCH 7/9] Revert "Add hexchat_send_raw to the Lua plugin" This reverts commit f7412d513a64f03b522a804ebf9a2d9db1011e92. --- plugins/lua/lua.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c index 66410825..0dc7aeda 100644 --- a/plugins/lua/lua.c +++ b/plugins/lua/lua.c @@ -776,13 +776,6 @@ static int api_hexchat_iterate(lua_State *L) return luaL_argerror(L, 1, "invalid list name"); } -static int api_hexchat_send_raw(lua_State *L) -{ - //hexchat_print(ph, lua_tostring(L, -1)); - hexchat_send_raw(ph, lua_tostring(L, -1)); - return 0; -} - static int api_hexchat_prefs_meta_index(lua_State *L) { char const *key = luaL_checkstring(L, 2); @@ -1052,7 +1045,6 @@ static luaL_Reg api_hexchat[] = { {"set_context", api_hexchat_set_context}, {"attrs", api_hexchat_attrs}, {"iterate", api_hexchat_iterate}, - {"send_raw", api_hexchat_send_raw }, {NULL, NULL} }; @@ -1145,7 +1137,6 @@ static int luaopen_hexchat(lua_State *L) wrap_context(L, "nickcmp", api_hexchat_nickcmp); wrap_context(L, "get_info", api_hexchat_get_info); wrap_context(L, "iterate", api_hexchat_iterate); - wrap_context(L, "send_raw", api_hexchat_send_raw); lua_setfield(L, -2, "__index"); lua_pushcfunction(L, api_hexchat_context_meta_eq); lua_setfield(L, -2, "__eq"); From 89686f6f48c00a6606f2e092d91fbfd8e923d268 Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 20 Feb 2017 20:27:10 -0500 Subject: [PATCH 8/9] User list hostnames text color change Allow the text in the user list hostname column to be changed --- src/fe-gtk/userlistgui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-gtk/userlistgui.c b/src/fe-gtk/userlistgui.c index d06975ca..7618575d 100644 --- a/src/fe-gtk/userlistgui.c +++ b/src/fe-gtk/userlistgui.c @@ -539,7 +539,7 @@ userlist_add_columns (GtkTreeView * treeview) gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, NULL, renderer, - "text", 2, NULL); + "text", 2, "foreground-gdk", 4, NULL); } } From 0e7f264c7192b2f1125d23d075135b2a7513cde2 Mon Sep 17 00:00:00 2001 From: culb Date: Mon, 27 Mar 2017 11:16:10 -0400 Subject: [PATCH 9/9] Fix Perl script registration version Perl knows "0" as false so if "0" is used as a version, it doesn't recognize it as being defined --- plugins/perl/lib/HexChat.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/perl/lib/HexChat.pm b/plugins/perl/lib/HexChat.pm index 1b354de9..e9e294ee 100644 --- a/plugins/perl/lib/HexChat.pm +++ b/plugins/perl/lib/HexChat.pm @@ -102,7 +102,7 @@ sub register { unless( $name && $name =~ /[[:print:]\w]/ ) { $name = "Not supplied"; } - unless( $version && $version =~ /\d+(?:\.\d+)?/ ) { + unless( defined $version && $version =~ /\d+(?:\.\d+)?/ ) { $version = "NaN"; } $pkg_info->{gui_entry} =