aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-08-19 10:06:47 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2023-08-19 10:06:47 +0200
commitdd354a6f06cfbd0ff1b099630e1fe61628684158 (patch)
tree118ac70823ee905868d77e7af51a7becc7db8d68
parentb4ba7da53bcc79e3b20131abeefd8260686a03e2 (diff)
downloadwee-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.py10
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: