From 0a98934a7e38beba1a5172551efe21d948820971 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 14 Aug 2024 02:19:36 +0200 Subject: [PATCH] fix: fallback to current time for rich activity --- upub/core/src/selector/rich.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upub/core/src/selector/rich.rs b/upub/core/src/selector/rich.rs index e8fa5b6..aa6e4ca 100644 --- a/upub/core/src/selector/rich.rs +++ b/upub/core/src/selector/rich.rs @@ -44,10 +44,13 @@ impl FromQueryResult for RichActivity { fn from_query_result(res: &QueryResult, _pre: &str) -> Result { Ok(RichActivity { attachments: None, hashtags: None, mentions: None, - discovered: res.try_get(crate::model::addressing::Entity.table_name(), &crate::model::addressing::Column::Published.to_string())?, liked: res.try_get(crate::model::like::Entity.table_name(), &crate::model::like::Column::Actor.to_string()).ok(), object: crate::model::object::Model::from_query_result(res, crate::model::object::Entity.table_name()).ok(), activity: crate::model::activity::Model::from_query_result(res, crate::model::activity::Entity.table_name()).ok(), + discovered: res.try_get( + crate::model::addressing::Entity.table_name(), + &crate::model::addressing::Column::Published.to_string() + ).unwrap_or(chrono::Utc::now()), }) } }