Fix type of `StatusBuilder::media_ids`

The identifier in the JSON response to a POST to `/media` is a string,
as can be seen in the Attachment entity.

Even though that identifier has always been a string of numbers (at
least in Mastodon's case), it should not be assumed that it will
continue to be so in the future, so keeping it as a String seems more
prudent.

Additionally, this simplifies the process of posting a new status with
an attachment, as it is no longer necessary to parse the resulting
attachment's id to an u64.
master
Ricardo Martins 6 years ago committed by Paul Woolcock
parent 8bb46a378c
commit 2bf2456496
  1. 2
      src/status_builder.rs

@ -26,7 +26,7 @@ pub struct StatusBuilder {
pub in_reply_to_id: Option<u64>,
/// Ids of media attachments being attached to the status.
#[serde(skip_serializing_if = "Option::is_none")]
pub media_ids: Option<Vec<u64>>,
pub media_ids: Option<Vec<String>>,
/// Whether current status is sensitive.
#[serde(skip_serializing_if = "Option::is_none")]
pub sensitive: Option<bool>,

Loading…
Cancel
Save