aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--_pytest/test_unwrap_attachments.py16
-rw-r--r--wee_slack.py4
2 files changed, 20 insertions, 0 deletions
diff --git a/_pytest/test_unwrap_attachments.py b/_pytest/test_unwrap_attachments.py
index 5f76e57..2541538 100644
--- a/_pytest/test_unwrap_attachments.py
+++ b/_pytest/test_unwrap_attachments.py
@@ -212,6 +212,22 @@ import pytest
},
{
'input_message': {'attachments': [{
+ 'text': 'Original message',
+ 'files': [
+ {
+ 'title': 'File',
+ 'url_private': 'http://link',
+ }
+ ],
+ }]},
+ 'input_text_before': "",
+ 'output': "\n".join([
+ "Original message",
+ "http://link (File)",
+ ]),
+ },
+ {
+ 'input_message': {'attachments': [{
'title': 'Title',
'fields': [{
'title': 'First field title',
diff --git a/wee_slack.py b/wee_slack.py
index 6e129d4..789e750 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3485,6 +3485,10 @@ def unwrap_attachments(message_json, text_before):
else:
t.append(f['value'])
+ files = unwrap_files(attachment, None)
+ if files:
+ t.append(files)
+
footer = attachment.get("footer")
if footer:
ts = attachment.get("ts")