xmpp: Add a temporary fix for avatar retrieval

This commit is contained in:
PapaTutuWawa 2021-09-20 15:44:04 +02:00
parent 7b0e1f7e8c
commit 3d3686c301

View File

@ -20,6 +20,10 @@ class AvatarManager:
self._logger = logging.getLogger("xmpp.avatar") self._logger = logging.getLogger("xmpp.avatar")
def _save_avatar(self, jid, data, type_): 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] filename = hashlib.sha1(data).hexdigest() + "." + type_.split("/")[1]
path = os.path.join(self._path, filename) path = os.path.join(self._path, filename)