mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-01 09:06:16 -05:00
Fix application service not being able to join remote federated room without a profile set (#13131)
Fix https://github.com/matrix-org/synapse/issues/4778 Complement tests: https://github.com/matrix-org/complement/pull/399
This commit is contained in:
parent
65e675504f
commit
2c2a42cc10
1
changelog.d/13131.bugfix
Normal file
1
changelog.d/13131.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix application service not being able to join remote federated room without a profile set.
|
@ -846,10 +846,17 @@ class RoomMemberHandler(metaclass=abc.ABCMeta):
|
|||||||
|
|
||||||
content["membership"] = Membership.JOIN
|
content["membership"] = Membership.JOIN
|
||||||
|
|
||||||
|
try:
|
||||||
profile = self.profile_handler
|
profile = self.profile_handler
|
||||||
if not content_specified:
|
if not content_specified:
|
||||||
content["displayname"] = await profile.get_displayname(target)
|
content["displayname"] = await profile.get_displayname(target)
|
||||||
content["avatar_url"] = await profile.get_avatar_url(target)
|
content["avatar_url"] = await profile.get_avatar_url(target)
|
||||||
|
except Exception as e:
|
||||||
|
logger.info(
|
||||||
|
"Failed to get profile information while processing remote join for %r: %s",
|
||||||
|
target,
|
||||||
|
e,
|
||||||
|
)
|
||||||
|
|
||||||
if requester.is_guest:
|
if requester.is_guest:
|
||||||
content["kind"] = "guest"
|
content["kind"] = "guest"
|
||||||
@ -926,11 +933,18 @@ class RoomMemberHandler(metaclass=abc.ABCMeta):
|
|||||||
|
|
||||||
content["membership"] = Membership.KNOCK
|
content["membership"] = Membership.KNOCK
|
||||||
|
|
||||||
|
try:
|
||||||
profile = self.profile_handler
|
profile = self.profile_handler
|
||||||
if "displayname" not in content:
|
if "displayname" not in content:
|
||||||
content["displayname"] = await profile.get_displayname(target)
|
content["displayname"] = await profile.get_displayname(target)
|
||||||
if "avatar_url" not in content:
|
if "avatar_url" not in content:
|
||||||
content["avatar_url"] = await profile.get_avatar_url(target)
|
content["avatar_url"] = await profile.get_avatar_url(target)
|
||||||
|
except Exception as e:
|
||||||
|
logger.info(
|
||||||
|
"Failed to get profile information while processing remote knock for %r: %s",
|
||||||
|
target,
|
||||||
|
e,
|
||||||
|
)
|
||||||
|
|
||||||
return await self.remote_knock(
|
return await self.remote_knock(
|
||||||
remote_room_hosts, room_id, target, content
|
remote_room_hosts, room_id, target, content
|
||||||
|
Loading…
Reference in New Issue
Block a user