diff --git a/appservice.py b/appservice.py index 293a4b2..7dc9049 100644 --- a/appservice.py +++ b/appservice.py @@ -44,6 +44,7 @@ def on_receive_events(transaction): text = "* " + get_displayname(event["user_id"]) + " " + event['content']['body'] elif event['content']['msgtype'] == 'm.image': imgurl = app.config['MATRIX_HOST'] + '/_matrix/media/r0/download/' + event['content']['url'][6:] + thmburl = app.config['MATRIX_HOST'] + '/_matrix/media/r0/download/' + event['content']['info']['thumbnail_url'][6:] value = {"type": "photo", "version": "1.0"} value["title"] = event['content']['body'] value["url"] = imgurl @@ -51,7 +52,7 @@ def on_receive_events(transaction): value["height"] = event['content']['info']['h'] value["thumbnail_width"] = event['content']['info']['thumbnail_info']['w'] value["thumbnail_height"] = event['content']['info']['thumbnail_info']['h'] - value["thumbnail_url"] = self.api.get_download_url(event['content']['info']['thumbnail_url']) + value["thumbnail_url"] = thmburl rawitem = {"type": "io.pnut.core.oembed", "value": value} embed = [rawitem] if user: