X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_queries%2Fsrc%2Flib.rs;h=dbd470e4deb98be1b9c7c0d19b510863ffb4df5c;hb=527eefbe92a4796b957fb232831f7e7c80511ed9;hp=e62124b1827b49b3cb2099f605a67bbaba8f9189;hpb=21346eb786dc75efaca19e6de8a514fab3d33da8;p=lemmy.git diff --git a/crates/db_queries/src/lib.rs b/crates/db_queries/src/lib.rs index e62124b1..dbd470e4 100644 --- a/crates/db_queries/src/lib.rs +++ b/crates/db_queries/src/lib.rs @@ -12,6 +12,7 @@ extern crate diesel_migrations; #[cfg(test)] extern crate serial_test; +use chrono::NaiveDateTime; use diesel::{result::Error, *}; use lemmy_db_schema::{CommunityId, DbUrl, PersonId}; use lemmy_utils::ApiError; @@ -145,14 +146,14 @@ pub trait DeleteableOrRemoveable { fn blank_out_deleted_or_removed_info(self) -> Self; } +// TODO: move this to apub lib pub trait ApubObject { - type Form; + /// If this object should be refetched after a certain interval, it should return the last refresh + /// time here. This is mainly used to update remote actors. + fn last_refreshed_at(&self) -> Option; fn read_from_apub_id(conn: &PgConnection, object_id: &DbUrl) -> Result where Self: Sized; - fn upsert(conn: &PgConnection, user_form: &Self::Form) -> Result - where - Self: Sized; } pub trait MaybeOptional {