From 34f17ebcc0910b7b1a0b56493385b39d5e38df14 Mon Sep 17 00:00:00 2001 From: wariuni Date: Mon, 5 Jun 2017 18:55:50 +0900 Subject: [PATCH] Fix the attributes of Attachment (#5) * Fix Attachment.text_url not being nullable * Add missing "unknown" attribute to MediaType, which is not in the documentation by TootSuite https://github.com/tootsuite/mastodon/blob/b97ebaf6202debb8c24d6f726886a594f02a6d3b/app/models/media_attachment.rb#L24 --- src/entities/attachment.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/entities/attachment.rs b/src/entities/attachment.rs index 1fd960b..5a0376f 100644 --- a/src/entities/attachment.rs +++ b/src/entities/attachment.rs @@ -6,7 +6,7 @@ pub struct Attachment { pub url: String, pub remote_url: String, pub preview_url: String, - pub text_url: String, + pub text_url: Option, } #[derive(Debug, Deserialize, Clone, Copy)] @@ -17,4 +17,6 @@ pub enum MediaType { Video, #[serde(rename = "gifv")] Gifv, + #[serde(rename = "unknown")] + Unknown, }