diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-06-23 12:56:31 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2023-06-23 12:59:49 +0200 |
commit | 6dede46eadde47e7141e11f7134844f93012595a (patch) | |
tree | d2a7092f7a3326c2cb19de7ada05cc046130c5e4 | |
parent | 6ae3ad443106388e47320ac69d7a959faa194477 (diff) | |
download | wee-slack-6dede46eadde47e7141e11f7134844f93012595a.tar.gz |
Support /msg * in thread buffers
Fixes #888
-rw-r--r-- | wee_slack.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/wee_slack.py b/wee_slack.py index 75bc3fe..b402397 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -5428,17 +5428,19 @@ def add_token(token, team_name=None): def msg_command_cb(data, current_buffer, args): aargs = args.split(None, 2) who = aargs[1].lstrip("@") - if who == "*": - who = EVENTROUTER.weechat_controller.buffers[current_buffer].name - else: + if who != "*": join_query_command_cb(data, current_buffer, "/query " + who) if len(aargs) > 2: message = aargs[2] - team = EVENTROUTER.weechat_controller.buffers[current_buffer].team - cmap = team.get_channel_map() - if who in cmap: - channel = team.channels[cmap[who]] + buffer_pointer = EVENTROUTER.weechat_controller.buffers[current_buffer] + team = buffer_pointer.team + if who == "*": + channel = buffer_pointer + else: + cmap = team.get_channel_map() + channel = team.channels.get(cmap.get(who)) + if channel: channel.send_message(message) return w.WEECHAT_RC_OK_EAT |