@@ -788,16 +788,26 @@ impl Timeline {
788788 Ok ( ( ) )
789789 }
790790
791- /// Mark the room as read by sending an unthreaded read receipt on the
792- /// latest event, be it visible or not .
791+ /// Mark the timeline as read by attempting to send a read receipt on the
792+ /// latest visible event .
793793 ///
794- /// This works even if the latest event belongs to a thread, as a threaded
795- /// reply also belongs to the unthreaded timeline. No threaded receipt
796- /// will be sent here (see also #3123).
794+ /// The latest visible event is determined from the timeline's focus kind
795+ /// and whether or not it hides threaded events. If no latest event can
796+ /// be determined and the timeline is live, the room's unread marker is
797+ /// unset instead.
797798 ///
798- /// This also unsets the unread marker of the room if necessary.
799+ /// # Arguments
799800 ///
800- /// Returns a boolean indicating if it sent the receipt or not.
801+ /// * `receipt_type` - The type of receipt to send. When using
802+ /// [`ReceiptType::FullyRead`], an unthreaded receipt will be sent. This
803+ /// works even if the latest event belongs to a thread, as a threaded
804+ /// reply also belongs to the unthreaded timeline. Otherwise the
805+ /// [`ReceiptThread`] will be determined based on the timeline's focus
806+ /// kind.
807+ ///
808+ /// # Returns
809+ ///
810+ /// A boolean indicating if the receipt was sent or not.
801811 #[ instrument( skip( self ) , fields( room_id = ?self . room( ) . room_id( ) ) ) ]
802812 pub async fn mark_as_read ( & self , receipt_type : ReceiptType ) -> Result < bool > {
803813 if let Some ( event_id) = self . controller . latest_event_id ( ) . await {
0 commit comments