1 use activitystreams::object::kind::TombstoneType;
2 use chrono::{DateTime, FixedOffset, NaiveDateTime};
3 use lemmy_utils::utils::convert_datetime;
4 use serde::{Deserialize, Serialize};
5 use serde_with::skip_serializing_none;
7 #[skip_serializing_none]
8 #[derive(Clone, Debug, Deserialize, Serialize)]
9 #[serde(rename_all = "camelCase")]
10 pub struct Tombstone {
11 #[serde(rename = "type")]
14 deleted: DateTime<FixedOffset>,
18 pub fn new<T: ToString>(former_type: T, updated_time: NaiveDateTime) -> Tombstone {
20 kind: TombstoneType::Tombstone,
21 former_type: former_type.to_string(),
22 deleted: convert_datetime(updated_time),