aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wee_slack.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 939722a..977470b 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3175,6 +3175,23 @@ def label_command_cb(data, current_buffer, args):
w.buffer_set(channel.channel_buffer, "short_name", new_name)
+def set_unread_cb(data, current_buffer, command):
+ data = decode_from_utf8(data)
+ command = decode_from_utf8(command)
+ for channel in EVENTROUTER.weechat_controller.buffers.values():
+ channel.mark_read()
+ return w.WEECHAT_RC_OK
+
+
+@slack_buffer_or_ignore
+def set_unread_current_buffer_cb(data, current_buffer, command):
+ data = decode_from_utf8(data)
+ command = decode_from_utf8(command)
+ channel = EVENTROUTER.weechat_controller.buffers.get(current_buffer)
+ channel.mark_read()
+ return w.WEECHAT_RC_OK
+
+
def command_p(data, current_buffer, args):
args = args.split(' ', 1)[1]
w.prnt("", "{}".format(eval(args)))
@@ -3276,6 +3293,8 @@ def setup_hooks():
w.hook_command_run('/msg', 'msg_command_cb', '')
w.hook_command_run('/label', 'label_command_cb', '')
w.hook_command_run("/input complete_next", "complete_next_cb", "")
+ w.hook_command_run("/input set_unread", "set_unread_cb", "")
+ w.hook_command_run("/input set_unread_current_buffer", "set_unread_current_buffer_cb", "")
w.hook_command_run('/away', 'away_command_cb', '')
w.hook_completion("nicks", "complete @-nicks for slack", "nick_completion_cb", "")