@@ 15,6 15,7 @@ from madcow.conf import settings
class SlackProtocol(Madcow):
+ _slack_link_re = re.compile(r'[<](https?://[^>]{1,})[>]')
def __init__(self, base):
super(SlackProtocol, self).__init__(base)
@@ 43,7 44,7 @@ class SlackProtocol(Madcow):
elif self.online:
if event_type == 'message':
private = False # TODO need to determine if this is in DM
- req = Request(message=event.event['text'])
+ req = Request(message=self._slack_link_re.sub(r'\1', event.event['text']))
req.nick = event.event['user']
req.channel = event.event['channel']
req.private = private