aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-08-10 17:28:27 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2018-08-10 20:44:14 +0200
commite2e42a786953f4079996346ab0bbdfd0d1fb2d10 (patch)
treec681cca80b7c417233ea6ef0ec68c9473f7f2b22 /wee_slack.py
parentcd742e1b8fa9544e7dc960efa47ea0d524763e41 (diff)
downloadwee-slack-e2e42a786953f4079996346ab0bbdfd0d1fb2d10.tar.gz
Remove url replacing for file_share message subtypes
Slack doesn't use the file_share subtype anymore, as file uploads are now sent as normal messages with files attached. The urls we render for files attached to messages are the same as the urls this code previously inserted. The urls this code replaced out are gone from Slack.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py9
1 files changed, 0 insertions, 9 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 6439ba1..d07c853 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2104,15 +2104,6 @@ class SlackMessage(object):
if message_json.get('subtype') == 'me_message' and not message_json['text'].startswith(self.sender):
message_json['text'] = self.sender + ' ' + self.message_json['text']
- # Replace Slack link with direct link to shared file (required if
- # shared by an external user since only the direct link is accessible)
- if message_json.get('subtype') == 'file_share':
- message_json['text'] = re.sub(
- r'<http.+\|',
- r'<{}|'.format(message_json['file']['url_private']),
- message_json['text']
- )
-
def __hash__(self):
return hash(self.ts)