aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2022-10-29 17:50:29 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2022-10-29 18:07:25 +0200
commit8a89b8038cc0d0e2c88d4ac77aafdd14470dca4a (patch)
tree2c9fd2b6c321f84754f604763e00e460c3e4bc25 /wee_slack.py
parent6da7c8ee4bdfff291536bb7cd0201f1df00005ea (diff)
downloadwee-slack-8a89b8038cc0d0e2c88d4ac77aafdd14470dca4a.tar.gz
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
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py4
1 files changed, 3 insertions, 1 deletions
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 = ""