From 669240b87f5de7f20542b95fab1b7cd8f7af240a Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 22 Jun 2024 06:13:15 +0200 Subject: [PATCH] fix: show updated only if different from published --- upub/core/src/model/actor.rs | 1 + upub/core/src/model/object.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/upub/core/src/model/actor.rs b/upub/core/src/model/actor.rs index 4628b7b2..36df4da8 100644 --- a/upub/core/src/model/actor.rs +++ b/upub/core/src/model/actor.rs @@ -168,6 +168,7 @@ impl Model { .set_url(apb::Node::link(i.clone())) ))) .set_published(Some(self.published)) + .set_updated(if self.updated != self.published { Some(self.updated) } else { None }) .set_preferred_username(Some(&self.preferred_username)) .set_statuses_count(Some(self.statuses_count as u64)) .set_followers_count(Some(self.followers_count as u64)) diff --git a/upub/core/src/model/object.rs b/upub/core/src/model/object.rs index d44f4674..e26b9ee7 100644 --- a/upub/core/src/model/object.rs +++ b/upub/core/src/model/object.rs @@ -155,7 +155,7 @@ impl Model { .set_conversation(apb::Node::maybe_link(self.context.clone())) // duplicate context for mastodon .set_in_reply_to(apb::Node::maybe_link(self.in_reply_to.clone())) .set_published(Some(self.published)) - .set_updated(Some(self.updated)) + .set_updated(if self.updated != self.published { Some(self.updated) } else { None }) .set_audience(apb::Node::maybe_link(self.audience)) .set_to(apb::Node::links(self.to.0.clone())) .set_bto(apb::Node::Empty)