Skip to main content

visible_upper_bound

Function visible_upper_bound 

Source
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_visibility value (shared, and this server’s simplified handling of invited/joined — v1 does not implement their finer per-event lower bound, see the module doc): a currently joined member sees the whole timeline (HistoryWindow::All); a member whose CURRENT membership is leave/ban sees only up to the stream position of that leave/ban event itself (HistoryWindow::UpTo, read off the m.room.member state event’s own stream_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 merely invited without ever having joined) sees HistoryWindow::Nothing.