feat(#2479): add from/until event-id cursors to read_room

This commit is contained in:
damocles 2026-07-15 18:26:31 +02:00 committed by mara
commit 001b1dae37
4 changed files with 189 additions and 46 deletions

View file

@ -114,11 +114,21 @@ pub enum DaemonOp {
#[serde(rename = "list_room_members")]
ListRoomMembers { room: String },
/// Read the last `limit` events from a room's timeline. Caller
/// gets each event's id, sender, `server_ts`, type, and body (best-
/// effort plain-text extraction from `m.text` / `m.notice` etc.).
/// Read events from a room's timeline. Caller gets each event's id,
/// sender, `server_ts`, type, and body (best-effort plain-text extraction
/// from `m.text` / `m.notice` etc.). With neither cursor, returns the last
/// `limit` events (newest-first). `from` / `until` anchor at an event id
/// (mutually exclusive): `until` reads the anchor + `limit-1` events before
/// it (into the past); `from` reads the anchor + `limit-1` events after it.
#[serde(rename = "read_room")]
ReadRoom { room: String, limit: Option<usize> },
ReadRoom {
room: String,
limit: Option<usize>,
#[serde(default)]
from: Option<String>,
#[serde(default)]
until: Option<String>,
},
/// Download the media attachment carried by `event_id` in `room`
/// and write it to a local file (`dest_path`, or a temp file named