matrix-js-sdk
    Preparing search index...

    The latest receipts we have for a room.

    Index

    Constructors

    Methods

    • Remember the receipt information supplied. For each receipt:

      If we don't have the event for this receipt, store it as "dangling" so we can process it later.

      Otherwise store it per-user in either the threaded store for its thread_id, or the unthreaded store if there is no thread_id.

      Ignores any receipt that is before an existing receipt for the same user (in the same thread, if applicable). "Before" is defined by the unfilteredTimelineSet of the room.

      Parameters

      Returns void

    • Get the event a user has read up to in the main timeline + unthreaded scope. Picks the later of the user's Read / ReadPrivate receipts, preferring ReadPrivate on a tie. Returns null if the chosen receipt points at an event we don't have, or whose thread doesn't match.

      Parameters

      • userId: string
      • ignoreSynthesized: boolean = false

      Returns string | null

    • Get the latest unthreaded receipt for a user, as a raw Receipt. Tracks by ts so that dangling receipts (whose events aren't loaded yet) are still visible to callers — matching the legacy behaviour.

      Parameters

      • userId: string

      Returns Receipt | undefined

    • Find when a client has gained thread capabilities by inspecting the oldest threaded receipt for this user.

      Parameters

      • userId: string

      Returns number

    • Get the latest receipt for a specific user and (optionally) receipt type, scoped to a thread.

      Parameters

      • threadId: string
      • userId: string
      • ignoreSynthesized: boolean = false
      • receiptType: ReceiptType = ReceiptType.Read

      Returns WrappedReceipt | null

    • Get the list of cached receipts for the given event. Returns receipts in the order they were inserted, with at most one entry per (userId, receiptType) pair.

      Parameters

      • eventId: string

      Returns CachedReceipt[]

    • Get the cached receipts for an event, restricted to those scoped to the given thread. Used by Thread to avoid returning receipts from other thread contexts.

      Parameters

      • eventId: string
      • threadId: string

      Returns CachedReceipt[]

    • Get the IDs of users that have read up to the given event. Filters to the receipt types matrix-js-sdk considers as "read up to".

      Parameters

      • eventId: string

      Returns string[]

    • Like getUsersReadUpTo but restricted to receipts scoped to the given thread.

      Parameters

      • eventId: string
      • threadId: string

      Returns string[]