From f3ca3a12016be616c51328c8b243673d0b4c97d2 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Wed, 3 May 2017 07:27:39 -0700 Subject: [PATCH] fix thumbnail url --- appservice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: