diff options
author | Ryan Huber <rhuber@gmail.com> | 2014-04-03 11:45:40 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2014-04-03 11:45:40 -0700 |
commit | 5660e21ef82c38d60fd66ce020c48790fb2d3721 (patch) | |
tree | 2ca9baa6d25889f96221da9b6f530d7271200f71 /wee_slack.py | |
parent | 72a848cb9960e13e322d81162411ea2bf5173875 (diff) | |
download | wee-slack-5660e21ef82c38d60fd66ce020c48790fb2d3721.tar.gz |
set read marker on both previous and current buffer
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 850692e..0bf99f7 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -209,10 +209,18 @@ def create_browser_instance(): return browser def buffer_switch_cb(signal, sig_type, data): + #NOTE: we flush both the next and previous buffer so that all read pointer id up to date + global previous_buffer +# w.prnt("",str(previous_buffer)) + if reverse_channel_hash.has_key(previous_buffer): + slack_mark_channel_read(reverse_channel_hash[previous_buffer]) if current_buffer_name().startswith(server): channel_name = current_buffer_name(short=True) if reverse_channel_hash.has_key(channel_name): slack_mark_channel_read(reverse_channel_hash[channel_name]) + previous_buffer = channel_name + else: + previous_buffer = None return w.WEECHAT_RC_OK def keep_channel_read_cb(data, remaining): @@ -314,6 +322,7 @@ if __name__ == "__main__": timeout = w.config_get_plugin("timeout") timer = time.time() + previous_buffer = None browser = create_browser_instance() stuff = connect_to_slack(browser) |