From c2ae5f6188cd869868b247a31da87f4635784faf Mon Sep 17 00:00:00 2001 From: Ryan Huber Date: Wed, 16 Jul 2014 10:17:26 -0700 Subject: don't try to sync hotlist in old versions --- wee_slack.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wee_slack.py b/wee_slack.py index b8aaa84..ff424eb 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -144,7 +144,8 @@ def process_channel_marked(message_json): buf_ptr = w.buffer_search("",buffer_name) w.buffer_set(buf_ptr, "unread", "") #NOTE: only works with latest - w.buffer_set(buf_ptr, "hotlist", "-1") + if not legacy_mode: + w.buffer_set(buf_ptr, "hotlist", "-1") def process_im_marked(message_json): channel = message_json["channel"] @@ -153,7 +154,8 @@ def process_im_marked(message_json): buf_ptr = w.buffer_search("",buffer_name) w.buffer_set(buf_ptr, "unread", "") #NOTE: only works with latest - w.buffer_set(buf_ptr, "hotlist", "-1") + if not legacy_mode: + w.buffer_set(buf_ptr, "hotlist", "-1") def process_message(message_json): chan_and_user = message_json["channel"] + ":" + message_json["user"] @@ -466,6 +468,12 @@ if __name__ == "__main__": if not w.config_get_plugin('timeout'): w.config_set_plugin('timeout', "4") + version = w.info_get("version_number", "") or 0 + if int(version) >= 0x00040400: + legacy_mode = False + else: + legacy_mode = True + ### Global var section email = w.config_get_plugin("email") password = w.config_get_plugin("password") -- cgit