From 8a89b8038cc0d0e2c88d4ac77aafdd14470dca4a Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 29 Oct 2022 17:50:29 +0200 Subject: Fix link previews from apps not being recognized If a link preview was added by an app, like GitHub, instead of directly by Slack, it was not detected by wee-slack as a link preview, so it would be shown even if link_previews was set to false. Fixes #834 --- wee_slack.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wee_slack.py b/wee_slack.py index ed55ef0..006cfaf 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -4665,7 +4665,9 @@ def unwrap_attachments(message_json, text_before): # $author: (if rest of line is non-empty) $title ($title_link) OR $from_url # $author: (if no $author on previous line) $text # $fields - if "original_url" in attachment and not config.link_previews: + if not config.link_previews and ( + "original_url" in attachment or attachment.get("is_app_unfurl") + ): continue t = [] prepend_title_text = "" -- cgit