Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit e38026f

Browse files
committed
Rename from ?prev_event to more obvious usage with ?prev_event_id
As mentioned in matrix-org/matrix-spec-proposals#2716 (comment) and #10737
1 parent bfb4b85 commit e38026f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

synapse/rest/client/room_batch.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class RoomBatchSendEventRestServlet(RestServlet):
6161
some messages, you can only insert older ones after that.
6262
tldr; Insert chunks from your most recent history -> oldest history.
6363
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>
6565
{
6666
"events": [ ... ],
6767
"state_events_at_start": [ ... ]
@@ -188,24 +188,24 @@ async def on_POST(
188188
assert_params_in_dict(body, ["state_events_at_start", "events"])
189189

190190
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(request.args, "prev_event_id")
192192
chunk_id_from_query = parse_string(request, "chunk_id")
193193

194-
if prev_events_from_query is None:
194+
if prev_event_ids_from_query is None:
195195
raise SynapseError(
196196
HTTPStatus.BAD_REQUEST,
197197
"prev_event query parameter is required when inserting historical messages back in time",
198198
errcode=Codes.MISSING_PARAM,
199199
)
200200

201-
# For the event we are inserting next to (`prev_events_from_query`),
201+
# For the event we are inserting next to (`prev_event_ids_from_query`),
202202
# find the most recent auth events (derived from state events) that
203203
# allowed that message to be sent. We will use that as a base
204204
# to auth our historical messages against.
205205
(
206206
most_recent_prev_event_id,
207207
_,
208-
) = await self.store.get_max_depth_of(prev_events_from_query)
208+
) = await self.store.get_max_depth_of(prev_event_ids_from_query)
209209
# mapping from (type, state_key) -> state_event_id
210210
prev_state_map = await self.state_store.get_state_ids_for_event(
211211
most_recent_prev_event_id
@@ -286,7 +286,7 @@ async def on_POST(
286286
events_to_create = body["events"]
287287

288288
inherited_depth = await self._inherit_depth_from_prev_ids(
289-
prev_events_from_query
289+
prev_event_ids_from_query
290290
)
291291

292292
# Figure out which chunk to connect to. If they passed in
@@ -321,7 +321,7 @@ async def on_POST(
321321
# an insertion event), in which case we just create a new insertion event
322322
# that can then get pointed to by a "marker" event later.
323323
else:
324-
prev_event_ids = prev_events_from_query
324+
prev_event_ids = prev_event_ids_from_query
325325

326326
base_insertion_event_dict = self._create_insertion_event_dict(
327327
sender=requester.user.to_string(),

0 commit comments

Comments
 (0)