aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2014-07-16 10:17:26 -0700
committerRyan Huber <rhuber@gmail.com>2014-07-16 10:17:26 -0700
commitc2ae5f6188cd869868b247a31da87f4635784faf (patch)
tree089b0367bb65edd37aac504e0ac7caed941f0697
parentee5010b22dad250831e05b437863a27d355d8bc4 (diff)
downloadwee-slack-c2ae5f6188cd869868b247a31da87f4635784faf.tar.gz
don't try to sync hotlist in old versions
-rw-r--r--wee_slack.py12
1 files 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")