Add EventMediaLoader

Handles loading of URL previews and will handle all
matrix media messages types.
This commit is contained in:
miruka
2019-09-14 00:36:19 -04:00
parent 8ad13b033d
commit 0db34cc3c8
6 changed files with 79 additions and 15 deletions

View File

@@ -166,7 +166,7 @@ class Event(ModelItem):
return []
if isinstance(self.source, nio.RoomMessageMedia):
return [self.thumbnail_url or self.content]
return [self.media_url]
return [link[2] for link in lxml.html.iterlinks(self.content)]