From 580af506873322fe298071dae49a2da1a4ef5832 Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Wed, 19 Sep 2018 11:36:35 -0400 Subject: [PATCH] Make a couple new masto properties optional This will help prevent deser errors when querying pleroma & older versions of mastodon --- src/entities/relationship.rs | 2 +- src/entities/status.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entities/relationship.rs b/src/entities/relationship.rs index 7e6aced..fd4eeab 100644 --- a/src/entities/relationship.rs +++ b/src/entities/relationship.rs @@ -27,5 +27,5 @@ pub struct Relationship { /// This field is not techincally nullable with mastodon >= 2.5.0, but /// making it `Option` here means we shouldn't get deser errors when /// making calls to pleroma or mastodon<2.5.0 instances - pub endorsed: bool, + pub endorsed: Option, } diff --git a/src/entities/status.rs b/src/entities/status.rs index 0f66a7f..eefdb91 100644 --- a/src/entities/status.rs +++ b/src/entities/status.rs @@ -31,7 +31,7 @@ pub struct Status { /// An array of Emoji pub emojis: Vec, /// The numbef or replies to this status. - pub replies_count: u64, + pub replies_count: Option, /// The number of reblogs for the status. pub reblogs_count: u64, /// The number of favourites for the status.