From e2e42a786953f4079996346ab0bbdfd0d1fb2d10 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Fri, 10 Aug 2018 17:28:27 +0200 Subject: 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. --- wee_slack.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'wee_slack.py') 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'