aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-03-23 17:54:02 +0100
committerTollef Fog Heen <tfheen@err.no>2018-06-07 12:58:21 +0200
commit6df61f330460316db2a72e770214b1ba82c3cb56 (patch)
tree8b646bc1c5845b6fea7c9289126a8646f621ab4c
parentb399be4c03bce309e4f687826e90782202c34a6a (diff)
downloadwee-slack-6df61f330460316db2a72e770214b1ba82c3cb56.tar.gz
Fix typing indicator when having multiple windows
If you have multiple windows in weechat, you get (by default) one typing bar per window. Previously, the bar used the globally active channel (the active channel in the active window) for all the bars, so all the bars would show the same info. This changes it to use the active channel for the window the bar is in. The callback name is changed to include (extra), as that is necessary for getting the active buffer for each window as an argument to the callback function.
-rw-r--r--wee_slack.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 33a5ca5..9262e7f 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -780,13 +780,12 @@ def slack_never_away_cb(data, remaining_calls):
@utf8_decode
-def typing_bar_item_cb(data, current_buffer, args):
+def typing_bar_item_cb(data, item, current_window, current_buffer, extra_info):
"""
Privides a bar item indicating who is typing in the current channel AND
why is typing a DM to you globally.
"""
typers = []
- current_buffer = w.current_buffer()
current_channel = EVENTROUTER.weechat_controller.buffers.get(current_buffer, None)
# first look for people typing in this channel
@@ -3553,7 +3552,7 @@ def load_emoji():
def setup_hooks():
cmds = {k[8:]: v for k, v in globals().items() if k.startswith("command_")}
- w.bar_item_new('slack_typing_notice', 'typing_bar_item_cb', '')
+ w.bar_item_new('slack_typing_notice', '(extra)typing_bar_item_cb', '')
w.hook_timer(1000, 0, 0, "typing_update_cb", "")
w.hook_timer(1000, 0, 0, "buffer_list_update_callback", "EVENTROUTER")