mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
fix api/client_server/context events
This commit is contained in:
parent
4b9c6a754c
commit
dacb2ae7dd
1 changed files with 7 additions and 5 deletions
|
|
@ -159,19 +159,21 @@ pub(crate) async fn get_context_route(
|
||||||
|
|
||||||
let mut state = Vec::new();
|
let mut state = Vec::new();
|
||||||
|
|
||||||
for (shortstatekey, id) in state_ids {
|
for (shortstatekey, event_id) in state_ids {
|
||||||
let (event_type, state_key) =
|
let (event_type, state_key) =
|
||||||
services().rooms.short.get_statekey_from_short(shortstatekey)?;
|
services().rooms.short.get_statekey_from_short(shortstatekey)?;
|
||||||
|
|
||||||
if event_type != StateEventType::RoomMember {
|
if event_type != StateEventType::RoomMember {
|
||||||
let Some(pdu) = services().rooms.timeline.get_pdu(&id)? else {
|
let Some(pdu) = services().rooms.timeline.get_pdu(&event_id)?
|
||||||
error!("Pdu in state not found: {}", id);
|
else {
|
||||||
|
error!(%event_id, "Event in state not found");
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
state.push(pdu.to_state_event());
|
state.push(pdu.to_state_event());
|
||||||
} else if !lazy_load_enabled || lazy_loaded.contains(&state_key) {
|
} else if !lazy_load_enabled || lazy_loaded.contains(&state_key) {
|
||||||
let Some(pdu) = services().rooms.timeline.get_pdu(&id)? else {
|
let Some(pdu) = services().rooms.timeline.get_pdu(&event_id)?
|
||||||
error!("Pdu in state not found: {}", id);
|
else {
|
||||||
|
error!(%event_id, "Event in state not found");
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
state.push(pdu.to_state_event());
|
state.push(pdu.to_state_event());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue