diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-04-21 01:18:54 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2023-06-23 12:30:20 +0200 |
commit | 6ae3ad443106388e47320ac69d7a959faa194477 (patch) | |
tree | 0eb4896d92512f63fa16f424712d814e1e561d8c /wee_slack.py | |
parent | 6e6ed4d291bb054b143c2c361a25b56b5b0c913c (diff) | |
download | wee-slack-6ae3ad443106388e47320ac69d7a959faa194477.tar.gz |
Add info to get contents of a message
Fixes #889
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 79e2dba..75bc3fe 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -6204,6 +6204,17 @@ def line_event_cb(data, signal, hashtable): return w.WEECHAT_RC_OK +@utf8_decode +def info_slack_message_cb(data, info_name, args): + current_channel = EVENTROUTER.weechat_controller.buffers.get(w.current_buffer()) + message = current_channel.message_from_hash_or_index(args) + + if not message: + print_message_not_found_error(args) + return "" + return message.render() + + @slack_buffer_required @utf8_decode def command_back(data, current_buffer, args): @@ -6449,6 +6460,14 @@ def setup_hooks(): w.hook_hsignal("slack_cursor_reply", "line_event_cb", "reply") w.hook_hsignal("slack_cursor_thread", "line_event_cb", "thread") + w.hook_info( + "slack_message", + "get contents of a slack message", + "id or count to the message", + "info_slack_message_cb", + "", + ) + # Hooks to fix/implement # w.hook_signal('buffer_opened', "buffer_opened_cb", "") # w.hook_signal('window_scrolled', "scrolled_cb", "") |