pub fn visible_upper_bound(
conn: &Connection,
room: &Room,
caller_user_id: i64,
) -> Result<HistoryWindow, MatrixStoreError>Expand description
The history-visibility rule every timeline-reading route enforces
(routes::matrix::messaging’s /messages, /event, /relations; P10’s
/sync reuses this too):
world_readable: ANY signed-in caller sees the WHOLE timeline (HistoryWindow::All), regardless of their own membership — this is the one case where a caller who was never a member of the room at all still reads it.- Every other
history_visibilityvalue (shared, and this server’s simplified handling ofinvited/joined— v1 does not implement their finer per-event lower bound, see the module doc): a currentlyjoined member sees the whole timeline (HistoryWindow::All); a member whose CURRENT membership isleave/bansees only up to the stream position of that leave/ban event itself (HistoryWindow::UpTo, read off them.room.memberstate event’s ownstream_id— it is, by definition, the LATEST such event for that member, since that is what “current membership” means); anyone else (never touched this room’s membership at all, or is merelyinvited without ever having joined) seesHistoryWindow::Nothing.