diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-03-03 10:43:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-03 10:43:06 -0500 |
commit | 1d11b452b70c768e4919bd9cf6bcaeda2050a3d4 (patch) | |
tree | 772b95de8e7ec9714b9e6334088174abad0a9222 /synapse/appservice/api.py | |
parent | Enable MSC2716 Complement tests in Synapse (#12145) (diff) | |
download | synapse-1d11b452b70c768e4919bd9cf6bcaeda2050a3d4.tar.xz |
Use the proper serialization format when bundling aggregations. (#12090)
This ensures that the `latest_event` field of the bundled aggregation for threads uses the same format as the other events in the response.
Diffstat (limited to 'synapse/appservice/api.py')
-rw-r--r-- | synapse/appservice/api.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py index a0ea958af6..98fe354014 100644 --- a/synapse/appservice/api.py +++ b/synapse/appservice/api.py @@ -25,7 +25,7 @@ from synapse.appservice import ( TransactionUnusedFallbackKeys, ) from synapse.events import EventBase -from synapse.events.utils import serialize_event +from synapse.events.utils import SerializeEventConfig, serialize_event from synapse.http.client import SimpleHttpClient from synapse.types import JsonDict, ThirdPartyInstanceID from synapse.util.caches.response_cache import ResponseCache @@ -321,16 +321,18 @@ class ApplicationServiceApi(SimpleHttpClient): serialize_event( e, time_now, - as_client_event=True, - # If this is an invite or a knock membership event, and we're interested - # in this user, then include any stripped state alongside the event. - include_stripped_room_state=( - e.type == EventTypes.Member - and ( - e.membership == Membership.INVITE - or e.membership == Membership.KNOCK - ) - and service.is_interested_in_user(e.state_key) + config=SerializeEventConfig( + as_client_event=True, + # If this is an invite or a knock membership event, and we're interested + # in this user, then include any stripped state alongside the event. + include_stripped_room_state=( + e.type == EventTypes.Member + and ( + e.membership == Membership.INVITE + or e.membership == Membership.KNOCK + ) + and service.is_interested_in_user(e.state_key) + ), ), ) for e in events |