aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2017-09-20 23:49:00 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2017-09-20 23:53:09 +0200
commit4556187df35b6bcbbff310ae68ac2ec4bfd9d8ad (patch)
treef818fdc3a67cba2f536f969a2daae05f7d165bf1 /wee_slack.py
parentdeb9f11ad36cfebbee5b4f0783108433f67f6b56 (diff)
downloadwee-slack-4556187df35b6bcbbff310ae68ac2ec4bfd9d8ad.tar.gz
Don't render equal title_link and from_url in attachments twice
This is a follow-up of commit 0345ba1. That prevented rendering the link if it already was in the text. This prevents rendering both the title_link and from_url if they are equal, but not in the text. In this case it only renders the title_link.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 90b56ac..950117c 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2629,7 +2629,7 @@ def unwrap_attachments(message_json, text_before):
t.append('%s%s' % (prepend_title_text, title,))
prepend_title_text = ''
from_url = attachment.get('from_url', '')
- if from_url not in text_before:
+ if from_url not in text_before and from_url != title_link:
t.append(from_url)
atext = attachment.get("text", None)