Make a couple new masto properties optional

This will help prevent deser errors when querying pleroma & older
versions of mastodon
master
Paul Woolcock 6 years ago
parent 8641eff3e3
commit 580af50687
  1. 2
      src/entities/relationship.rs
  2. 2
      src/entities/status.rs

@ -27,5 +27,5 @@ pub struct Relationship {
/// This field is not techincally nullable with mastodon >= 2.5.0, but /// This field is not techincally nullable with mastodon >= 2.5.0, but
/// making it `Option<bool>` here means we shouldn't get deser errors when /// making it `Option<bool>` here means we shouldn't get deser errors when
/// making calls to pleroma or mastodon<2.5.0 instances /// making calls to pleroma or mastodon<2.5.0 instances
pub endorsed: bool, pub endorsed: Option<bool>,
} }

@ -31,7 +31,7 @@ pub struct Status {
/// An array of Emoji /// An array of Emoji
pub emojis: Vec<Emoji>, pub emojis: Vec<Emoji>,
/// The numbef or replies to this status. /// The numbef or replies to this status.
pub replies_count: u64, pub replies_count: Option<u64>,
/// The number of reblogs for the status. /// The number of reblogs for the status.
pub reblogs_count: u64, pub reblogs_count: u64,
/// The number of favourites for the status. /// The number of favourites for the status.

Loading…
Cancel
Save