Fix uploading portal avatars
This commit is contained in:
parent
a9633118c5
commit
cc5f3f13c3
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user