diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-08-19 10:06:47 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2023-08-19 10:06:47 +0200 |
commit | dd354a6f06cfbd0ff1b099630e1fe61628684158 (patch) | |
tree | 118ac70823ee905868d77e7af51a7becc7db8d68 | |
parent | b4ba7da53bcc79e3b20131abeefd8260686a03e2 (diff) | |
download | wee-slack-dd354a6f06cfbd0ff1b099630e1fe61628684158.tar.gz |
Fix display of message unfurl origin
When a Slack message is linked and unfurled (previewed) the footer
previously contained the channel name for the message, but now it just
says "Slack Conversation" or "Thread in Slack Conversation" instead.
This brings back display of the channel name.
-rw-r--r-- | wee_slack.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index 7c6c0e7..0166652 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -4912,7 +4912,15 @@ def unwrap_attachments(message, text_before): if files: t.append(files) - footer = attachment.get("footer") + if attachment.get("is_msg_unfurl"): + channel_name = resolve_ref("#{}".format(attachment["channel_id"])) + if attachment.get("is_reply_unfurl"): + footer = "From a thread in {}".format(channel_name) + else: + footer = "Posted in {}".format(channel_name) + else: + footer = attachment.get("footer") + if footer: ts = attachment.get("ts") if ts: |