Skip to main content

ReadReceiptsQueries

Trait ReadReceiptsQueries 

Source
pub trait ReadReceiptsQueries: Database {
    // Provided methods
    async fn fetch_read_receipts(
        &mut self,
        room_id: &RoomId,
        user_id: &UserId,
        only_private_receipts: bool,
    ) -> Result<Vec<ReadReceiptRow>, DatabaseError> { ... }
    async fn insert_read_receipt(
        &mut self,
        room_id: &RoomId,
        user_id: &UserId,
        event_id: &EventId,
        receipt_type: DbReceiptType,
        thread: &ReceiptThread,
        ts: DateTime<Utc>,
    ) -> Result<(), DatabaseError> { ... }
    async fn delete_read_receipts(
        &mut self,
        nids: &[i32],
    ) -> Result<(), DatabaseError> { ... }
    async fn fetch_sync_read_receipts(
        &mut self,
        user_id: &UserId,
        from_stream_id: StreamId,
        filter: Option<&RoomEventFilter>,
    ) -> Result<SyncRoomReceipts, DatabaseError> { ... }
}
Expand description

Trait declaring SQL queries related to the read_receipts table.

Provided Methods§

Source

async fn fetch_read_receipts( &mut self, room_id: &RoomId, user_id: &UserId, only_private_receipts: bool, ) -> Result<Vec<ReadReceiptRow>, DatabaseError>

Fetches all the read receipts of an user in a room. Optionally filter in only private receipts.

Source

async fn insert_read_receipt( &mut self, room_id: &RoomId, user_id: &UserId, event_id: &EventId, receipt_type: DbReceiptType, thread: &ReceiptThread, ts: DateTime<Utc>, ) -> Result<(), DatabaseError>

Inserts a new read receipt in the database.

Source

async fn delete_read_receipts( &mut self, nids: &[i32], ) -> Result<(), DatabaseError>

Deletes all the read receipts given in the nids list.

Source

async fn fetch_sync_read_receipts( &mut self, user_id: &UserId, from_stream_id: StreamId, filter: Option<&RoomEventFilter>, ) -> Result<SyncRoomReceipts, DatabaseError>

Fetches all the new read receipts to sync.

NOTE: This will filter in only read receipts that the given user is allowed to see.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> ReadReceiptsQueries for T
where T: Database,