From 3d3686c3013e5d6a20c5e405eb433b3d84f0aa9f Mon Sep 17 00:00:00 2001 From: Alexander PapaTutuWawa Date: Mon, 20 Sep 2021 15:44:04 +0200 Subject: [PATCH] xmpp: Add a temporary fix for avatar retrieval --- xmpp_discord_bridge/avatar.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xmpp_discord_bridge/avatar.py b/xmpp_discord_bridge/avatar.py index ef95048..a9db00f 100644 --- a/xmpp_discord_bridge/avatar.py +++ b/xmpp_discord_bridge/avatar.py @@ -20,6 +20,10 @@ class AvatarManager: self._logger = logging.getLogger("xmpp.avatar") def _save_avatar(self, jid, data, type_): + self._logger.debug("Got type_ of '%s'", type_) + if len(type_.split("/")) < 2: + self._logger.debug("COMPAT! Just assuming image/png") + type_ = "image/png" filename = hashlib.sha1(data).hexdigest() + "." + type_.split("/")[1] path = os.path.join(self._path, filename)