fix webhook username/avatar syncing

This commit is contained in:
git-bruh 2022-01-22 20:33:48 +05:30
parent 53e2ef8e99
commit 79308b6062
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -476,12 +476,12 @@ class DiscordClient(Gateway):
f"{self.app.server_name}"
)
def sync_profile(self, user: discord.User) -> None:
def sync_profile(self, user: discord.User, hashed: str = "") -> None:
"""
Sync the avatar and username for a puppeted user.
"""
mxid = self.matrixify(user.id, user=True)
mxid = self.matrixify(user.id, user=True, hashed=hashed)
profile = self.app.db.fetch_user(mxid)
@ -534,7 +534,7 @@ class DiscordClient(Gateway):
if message.webhook_id:
# Sync webhooks here as they can't be accessed like guild members.
self.sync_profile(message.author)
self.sync_profile(message.author, hashed=hashed)
return mxid, room_id