about summary refs log tree commit diff
path: root/weechat/.weechat/perl
diff options
context:
space:
mode:
Diffstat (limited to 'weechat/.weechat/perl')
-rw-r--r--weechat/.weechat/perl/colorize_lines.pl25
-rw-r--r--weechat/.weechat/perl/highmon.pl16
2 files changed, 31 insertions, 10 deletions
diff --git a/weechat/.weechat/perl/colorize_lines.pl b/weechat/.weechat/perl/colorize_lines.pl
index d828620..93a4465 100644
--- a/weechat/.weechat/perl/colorize_lines.pl
+++ b/weechat/.weechat/perl/colorize_lines.pl
@@ -19,6 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # history:
+# 3.9: add compatibility with new weechat_print modifier data (WeeChat >= 2.9)
 # 3.8: new option custom_action_text (https://github.com/weechat/scripts/issues/313) (idea by 3v1n0)
 # 3.7: new option "alternate_color" (https://github.com/weechat/scripts/issues/333) (idea by snuffkins)
 # 3.6: new option "own_lines_color" (idea by Linkandzelda)
@@ -86,7 +87,7 @@
 
 use strict;
 my $PRGNAME     = "colorize_lines";
-my $VERSION     = "3.8";
+my $VERSION     = "3.9";
 my $AUTHOR      = "Nils Görs <weechatter\@arcor.de>";
 my $LICENCE     = "GPL3";
 my $DESCR       = "Colorize users' text in chat area with their nick color, including highlights";
@@ -146,9 +147,21 @@ sub colorize_cb
         return $string unless (@tags_found);
     }
 
-# find buffer pointer
-    $modifier_data =~ m/([^;]*);([^;]*);/;
-    my $buf_ptr = weechat::buffer_search($1, $2);
+    # find buffer pointer and tags
+    my $buf_ptr = "";
+    my $tags = "";
+    if ($modifier_data =~ /^0x/)
+    {
+        # WeeChat >= 2.9
+        $modifier_data =~ m/([^;]*);(.*)/;
+        $buf_ptr = $1;
+        $tags = $2;
+    } else {
+        # WeeChat <= 2.8
+        $modifier_data =~ m/([^;]*);([^;]*);(.*)/;
+        $buf_ptr = weechat::buffer_search($1, $2);
+        $tags = $3;
+    }
     return $string if ($buf_ptr eq "");
 
     # find buffer name, server name
@@ -164,8 +177,8 @@ sub colorize_cb
 
     # find nick of the sender
     # find out if we are doing an action
-    my $nick = ($modifier_data =~ m/(^|,)nick_([^,]*)/) ? $2 : weechat::string_remove_color($left, "");
-    my $action = ($modifier_data =~ m/\birc_action\b/) ? 1 : 0;
+    my $nick = ($tags =~ m/(^|,)nick_([^,]*)/) ? $2 : weechat::string_remove_color($left, "");
+    my $action = ($tags =~ m/\birc_action\b/) ? 1 : 0;
 
     ######################################## get color
 
diff --git a/weechat/.weechat/perl/highmon.pl b/weechat/.weechat/perl/highmon.pl
index 066fa43..f843cad 100644
--- a/weechat/.weechat/perl/highmon.pl
+++ b/weechat/.weechat/perl/highmon.pl
@@ -1,6 +1,5 @@
 #
 # highmon.pl - Highlight Monitoring for weechat 0.3.0
-# Version 2.6
 #
 # Add 'Highlight Monitor' buffer/bar to log all highlights in one spot
 #
@@ -73,6 +72,8 @@
 # Bugs and feature requests at: https://github.com/KenjiE20/highmon
 
 # History:
+# 2020-06-21, Sebastien Helleu <flashcode@flashtux.org>:
+#	v2.7: make call to bar_new compatible with WeeChat >= 2.9
 # 2019-05-13, HubbeKing <hubbe128@gmail.com>
 #	v2.6:	-add: send "logger_backlog" signal on buffer open if logging is enabled
 # 2014-08-16, KenjiE20 <longbow@longbowslair.co.uk>:
@@ -266,7 +267,14 @@ sub highmon_bar_open
 	# Make the bar item
 	weechat::bar_item_new("highmon", "highmon_bar_build", "");
 
-	$highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "on", "highmon");
+        if (weechat::info_get("version_number", "") >= 0x02090000)
+        {
+            $highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "default", "on", "highmon");
+        }
+        else
+        {
+            $highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "on", "highmon");
+        }
 
 	return weechat::WEECHAT_RC_OK;
 }
@@ -717,7 +725,7 @@ sub highmon_new_message
 	if ($cb_high == "1" || (weechat::config_get_plugin("merge_private") eq "on" && $cb_tags =~ /notify_private/))
 	{
 		# Pre bug #29618 (0.3.3) away detect
-		if (weechat::info_get("version_number", "") <= 197120)
+		if (weechat::info_get("version_number", "") <= 0x00030200)
 		{
 			$away = '';
 			# Get infolist for this server
@@ -1131,7 +1139,7 @@ sub format_buffer_name
 }
 
 # Check result of register, and attempt to behave in a sane manner
-if (!weechat::register("highmon", "KenjiE20", "2.6", "GPL3", "Highlight Monitor", "", ""))
+if (!weechat::register("highmon", "KenjiE20", "2.7", "GPL3", "Highlight Monitor", "", ""))
 {
 	# Double load
 	weechat::print ("", "\tHighmon is already loaded");