@@ -61,7 +61,7 @@ class RoomBatchSendEventRestServlet(RestServlet):
61
61
some messages, you can only insert older ones after that.
62
62
tldr; Insert chunks from your most recent history -> oldest history.
63
63
64
- POST /_matrix/client/unstable/org.matrix.msc2716/rooms/<roomID>/batch_send?prev_event =<eventID>&chunk_id=<chunkID>
64
+ POST /_matrix/client/unstable/org.matrix.msc2716/rooms/<roomID>/batch_send?prev_event_id =<eventID>&chunk_id=<chunkID>
65
65
{
66
66
"events": [ ... ],
67
67
"state_events_at_start": [ ... ]
@@ -188,24 +188,26 @@ async def on_POST(
188
188
assert_params_in_dict (body , ["state_events_at_start" , "events" ])
189
189
190
190
assert request .args is not None
191
- prev_events_from_query = parse_strings_from_args (request .args , "prev_event" )
191
+ prev_event_ids_from_query = parse_strings_from_args (
192
+ request .args , "prev_event_id"
193
+ )
192
194
chunk_id_from_query = parse_string (request , "chunk_id" )
193
195
194
- if prev_events_from_query is None :
196
+ if prev_event_ids_from_query is None :
195
197
raise SynapseError (
196
198
HTTPStatus .BAD_REQUEST ,
197
199
"prev_event query parameter is required when inserting historical messages back in time" ,
198
200
errcode = Codes .MISSING_PARAM ,
199
201
)
200
202
201
- # For the event we are inserting next to (`prev_events_from_query `),
203
+ # For the event we are inserting next to (`prev_event_ids_from_query `),
202
204
# find the most recent auth events (derived from state events) that
203
205
# allowed that message to be sent. We will use that as a base
204
206
# to auth our historical messages against.
205
207
(
206
208
most_recent_prev_event_id ,
207
209
_ ,
208
- ) = await self .store .get_max_depth_of (prev_events_from_query )
210
+ ) = await self .store .get_max_depth_of (prev_event_ids_from_query )
209
211
# mapping from (type, state_key) -> state_event_id
210
212
prev_state_map = await self .state_store .get_state_ids_for_event (
211
213
most_recent_prev_event_id
@@ -286,7 +288,7 @@ async def on_POST(
286
288
events_to_create = body ["events" ]
287
289
288
290
inherited_depth = await self ._inherit_depth_from_prev_ids (
289
- prev_events_from_query
291
+ prev_event_ids_from_query
290
292
)
291
293
292
294
# Figure out which chunk to connect to. If they passed in
@@ -321,7 +323,7 @@ async def on_POST(
321
323
# an insertion event), in which case we just create a new insertion event
322
324
# that can then get pointed to by a "marker" event later.
323
325
else :
324
- prev_event_ids = prev_events_from_query
326
+ prev_event_ids = prev_event_ids_from_query
325
327
326
328
base_insertion_event_dict = self ._create_insertion_event_dict (
327
329
sender = requester .user .to_string (),
0 commit comments