import { MatrixEvent } from "../models/event.ts"; import { type Room } from "./room.ts"; import type { RetentionPolicyService } from "../retentionPolicy.ts"; import type { IStore } from "../store/index.ts"; /** * Applies https://github.com/matrix-org/matrix-spec-proposals/pull/1763 by checking the current * state of the room and applying the *latest* retention policy to all preceeding events. * Currently does not: * - Apply global server policies (requires Synapse work) * - React at all to `min_retention` configs. * - Loop */ export declare class RoomRetentionPolicy { private readonly room; private readonly retentionService; private readonly store; private maxRetention; private retentionTimeout?; private disposed; private readonly logger; constructor(room: Room, retentionService: RetentionPolicyService, store: IStore); /** * Stop applying the retention policy: cancels any pending expiry check and removes all listeners. * The instance must not be used after this is called. */ dispose(): void; private readonly onRoomStateEvent; private readonly onRetentionServiceUpdate; /** * Whether the room's current retention policy keeps an event. State events and redactions are * always kept: only messages expire. */ shouldEventBeRetained(ev: MatrixEvent): boolean; private readonly handleRetentionUpdate; /** * The retention policy set in the room state, preferring `m.room.retention` over the unstable type. */ private getRoomStatePolicy; /** * Work out the effective maximum lifetime of messages in the room, in milliseconds, or `null` when * messages are kept forever. * * @param roomStatePolicy - The policy set in the room state, if any. * @throws If the policy's `max_lifetime` is not a non-negative integer. */ private computeMaxRetention; private readonly timelineUpdated; private readonly scheduleTimelineCheck; /** * Every event the room has loaded: all timelines of every timeline set, including the ones * left behind by a permalink jump, and every thread's timelines. Thread replies only live in * their thread's timelines, so looking at the live timeline alone would never expire them. */ private getLoadedEvents; private processTimeline; } //# sourceMappingURL=room-retention.d.ts.map