From 11c029e4b701a5f34f5b12e068d4fee73dfb55b9 Mon Sep 17 00:00:00 2001 From: Samuel Kalbfleisch Date: Tue, 17 Nov 2020 22:48:53 +0100 Subject: [PATCH] Fix config parsing on WeeChat 2.4 --- weechat-remote-notify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weechat-remote-notify.py b/weechat-remote-notify.py index 38f6f24..22818bc 100755 --- a/weechat-remote-notify.py +++ b/weechat-remote-notify.py @@ -86,7 +86,7 @@ def run_notify(mtype,urgency,icon,time,nick,chan,message): host = w.config_get_plugin('host') try: - if command: + if command and command != ('',): p = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, @@ -111,17 +111,17 @@ def on_msg(*a): option = w.config_get("weechat.look.prefix_network") if sender == w.config_string(option): return w.WEECHAT_RC_OK - if data == "private" or highlight == "1": + if data == "private" or highlight == 1: #set buffer buffer = "me" if data == "private" else w.buffer_get_string(buffer, "short_name") #set time - displays message forever on highlight - if highlight == "1" and data == "private": + if highlight == 1 and data == "private": mtype = "private_highlight" icon = w.config_get_plugin('pm-icon') time = w.config_get_plugin('display_time_private_highlight') - elif highlight == "1": + elif highlight == 1: mtype = "highlight" icon = w.config_get_plugin('icon') time = w.config_get_plugin('display_time_highlight')