fix: object links are no longer nulled

This commit is contained in:
əlemi 2024-12-27 01:28:52 +01:00
parent 5c0577b00c
commit b1cf349805
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -112,14 +112,26 @@ impl IntoActivityPub for RichActivity {
(Some(activity), None) => activity.into_activity_pub_json(ctx),
(None, Some(object)) => apb::new()
// TODO RichObject may be Some but actually be empty underneath, so this pretty match is
// more or less useless since we need to match underlying object anyway. can we clear up
// this weirdness somehow? it's confusing too!
(None, Some(object)) => match object.object {
Some(object) => {
apb::new()
.set_activity_type(Some(apb::ActivityType::View))
.set_published(Some(self.discovered))
.set_object(apb::Node::object(object.into_activity_pub_json(ctx))),
.set_object(apb::Node::object(object.into_activity_pub_json(ctx)))
},
None => serde_json::Value::Null, // TODO we shouldn't really reach here?
},
(Some(activity), Some(object)) => activity
(Some(activity), Some(object)) => match object.object {
Some(object) => activity
.into_activity_pub_json(ctx)
.set_object(apb::Node::object(object.into_activity_pub_json(ctx))),
None => activity.into_activity_pub_json(ctx),
},
}
}
}