Send gif stickers as-is rather than converting to webp. Fixes #132

This commit is contained in:
Tulir Asokan
2018-04-29 23:07:37 +03:00
parent db5441c3eb
commit 8354bf6bb5
+8 -3
View File
@@ -716,12 +716,17 @@ class Portal:
info = message.get("info", {})
mime = info.get("mimetype", None)
w, h = None, None
if type == "m.sticker":
mime, file, w, h = util.convert_image(file, source_mime=mime, target_type="webp")
if mime != "image/gif":
mime, file, w, h = util.convert_image(file, source_mime=mime, target_type="webp")
else:
# Remove sticker description
message["mxtg_filename"] = "sticker.gif"
message["body"] = ""
elif "w" in info and "h" in info:
w, h = info["w"], info["h"]
else:
w, h = None, None
file_name = self._get_file_meta(message["mxtg_filename"], mime)