mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-10 18:22:49 +02:00
add get_pdu_owned sans Arc; improve client/room/event handler
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
3ed2c17f98
commit
7450c654ae
7 changed files with 50 additions and 38 deletions
|
@ -123,15 +123,18 @@ impl Data {
|
|||
///
|
||||
/// Checks the `eventid_outlierpdu` Tree if not found in the timeline.
|
||||
pub(super) async fn get_pdu(&self, event_id: &EventId) -> Result<Arc<PduEvent>> {
|
||||
self.get_pdu_owned(event_id).await.map(Arc::new)
|
||||
}
|
||||
|
||||
/// Returns the pdu.
|
||||
///
|
||||
/// Checks the `eventid_outlierpdu` Tree if not found in the timeline.
|
||||
pub(super) async fn get_pdu_owned(&self, event_id: &EventId) -> Result<PduEvent> {
|
||||
if let Ok(pdu) = self.get_non_outlier_pdu(event_id).await {
|
||||
return Ok(Arc::new(pdu));
|
||||
return Ok(pdu);
|
||||
}
|
||||
|
||||
self.eventid_outlierpdu
|
||||
.get(event_id)
|
||||
.await
|
||||
.deserialized()
|
||||
.map(Arc::new)
|
||||
self.eventid_outlierpdu.get(event_id).await.deserialized()
|
||||
}
|
||||
|
||||
/// Like get_non_outlier_pdu(), but without the expense of fetching and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue