Summarises the read receipts within a room. Used by the sync accumulator.

Given receipts for users, picks the most recently-received one and provides the results in a new fake receipt event returned from buildAccumulatedReceiptEvent().

Handles unthreaded receipts and receipts in each thread separately, so the returned event contains the most recently received unthreaded receipt, and the most recently received receipt in each thread.

Constructors

Properties

threadedReadReceipts: MapWithDefault<string, Map<string, AccumulatedReceipt>> = ...

thread_id -> user_id -> most-recently-received receipt for this thread

unthreadedReadReceipts: Map<string, AccumulatedReceipt> = ...

user_id -> most-recently-received unthreaded receipt

Methods

  • Build a receipt event that contains all relevant information for this room, taking the most recently received receipt for each user in an unthreaded context, and in each thread.

    Parameters

    • roomId: string

    Returns null | IMinimalEvent

  • Given a list of ephemeral events, find the receipts and store the relevant ones to be returned later from buildAccumulatedReceiptEvent().

    Parameters

    Returns void

  • Provide a receipt for this user in this thread. Overwrites any other receipt we have for this user in this thread.

    Parameters

    Returns void

  • Provide an unthreaded receipt for this user. Overwrites any other unthreaded receipt we have for this user.

    Parameters

    Returns void

Generated using TypeDoc