From 5ba1fb66ca6c8731512db196b578688af30bc9b5 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 21 Apr 2024 23:36:13 +0200 Subject: [PATCH] fix(apb): camel case name for mediaType --- apb/src/types/object/mod.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/apb/src/types/object/mod.rs b/apb/src/types/object/mod.rs index 840d7ab5..6af39ad1 100644 --- a/apb/src/types/object/mod.rs +++ b/apb/src/types/object/mod.rs @@ -135,7 +135,7 @@ impl Object for serde_json::Value { crate::getter! { bto -> node Self::Link } crate::getter! { cc -> node Self::Link } crate::getter! { bcc -> node Self::Link } - crate::getter! { media_type -> &str } + crate::getter! { media_type::mediaType -> &str } crate::getter! { duration -> &str } crate::getter! { url -> node Self::Link } @@ -182,21 +182,8 @@ impl ObjectMut for serde_json::Value { crate::setter! { bto -> node Self::Link} crate::setter! { cc -> node Self::Link } crate::setter! { bcc -> node Self::Link } - crate::setter! { media_type -> &str } + crate::setter! { media_type::mediaType -> &str } crate::setter! { duration -> &str } crate::setter! { url -> node Self::Link } - - // TODO Mastodon doesn't use a "context" field on the object but makes up a new one!! - fn set_context(mut self, ctx: Node<::Object>) -> Self { - if let Some(conversation) = ctx.id() { - crate::macros::set_maybe_value( - &mut self, "conversation", Some(serde_json::Value::String(conversation)), - ); - } - crate::macros::set_maybe_node( - &mut self, "context", ctx - ); - self - } - + crate::setter! { context -> node ::Object } }