From dd354a6f06cfbd0ff1b099630e1fe61628684158 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 19 Aug 2023 10:06:47 +0200 Subject: 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. --- wee_slack.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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: -- cgit