Skip to content
Snippets Groups Projects
Commit ffdf47d1 authored by 🥺's avatar 🥺 :transgender_flag:
Browse files

add `latest_pdu_in_room` timeline function

parent 1af65e69
No related branches found
No related tags found
1 merge request!419Mixed stuff
......@@ -82,6 +82,14 @@ pub fn first_pdu_in_room(&self, room_id: &RoomId) -> Result<Option<Arc<PduEvent>
.transpose()
}
#[tracing::instrument(skip(self))]
pub fn latest_pdu_in_room(&self, room_id: &RoomId) -> Result<Option<Arc<PduEvent>>> {
self.all_pdus(user_id!("@placeholder:conduwuit.placeholder"), room_id)?
.last()
.map(|o| o.map(|(_, p)| Arc::new(p)))
.transpose()
}
#[tracing::instrument(skip(self))]
pub fn last_timeline_count(&self, sender_user: &UserId, room_id: &RoomId) -> Result<PduCount> {
self.db.last_timeline_count(sender_user, room_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment