feat: implement /claim, handle to-device events
This commit is contained in:
parent
953f2b005f
commit
5b5cc0574e
8 changed files with 409 additions and 64 deletions
|
@ -1,5 +1,6 @@
|
|||
use super::State;
|
||||
use crate::{ConduitResult, Database, Error, Ruma};
|
||||
use log::error;
|
||||
use ruma::{
|
||||
api::client::r0::sync::sync_events,
|
||||
events::{room::member::MembershipState, AnySyncEphemeralRoomEvent, EventType},
|
||||
|
@ -71,7 +72,12 @@ pub async fn sync_events_route(
|
|||
let mut non_timeline_pdus = db
|
||||
.rooms
|
||||
.pdus_since(&sender_user, &room_id, since)?
|
||||
.filter_map(|r| r.ok()); // Filter out buggy events
|
||||
.filter_map(|r| {
|
||||
if r.is_err() {
|
||||
error!("Bad pdu in pdus_since: {:?}", r);
|
||||
}
|
||||
r.ok()
|
||||
}); // Filter out buggy events
|
||||
|
||||
// Take the last 10 events for the timeline
|
||||
let timeline_pdus = non_timeline_pdus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue