Fix uploading portal avatars

This commit is contained in:
Andrew Ferrazzutti 2022-04-04 20:13:20 -04:00
parent a9633118c5
commit cc5f3f13c3
1 changed files with 3 additions and 2 deletions

View File

@ -204,8 +204,9 @@ class Puppet(DBPuppet, BasePuppet):
return True return True
return False return False
@classmethod
async def reupload_avatar( async def reupload_avatar(
self, cls,
source: u.User, source: u.User,
intent: IntentAPI, intent: IntentAPI,
url: str, url: str,
@ -215,7 +216,7 @@ class Puppet(DBPuppet, BasePuppet):
data = await resp.read() data = await resp.read()
mime = magic.mimetype(data) mime = magic.mimetype(data)
return await intent.upload_media( return await intent.upload_media(
data, mime_type=mime, async_upload=self.config["homeserver.async_media"] data, mime_type=mime, async_upload=cls.config["homeserver.async_media"]
) )
async def _update_photo(self, source: u.User, photo_id: str) -> bool: async def _update_photo(self, source: u.User, photo_id: str) -> bool: