Accept attachments with type Video
Video attachments are used in PixelFed.
This commit is contained in:
parent
cc728afb7d
commit
64dbd8ff26
2 changed files with 10 additions and 10 deletions
|
@ -7,11 +7,10 @@ use super::vocabulary::HASHTAG;
|
|||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Attachment {
|
||||
pub name: Option<String>,
|
||||
|
||||
#[serde(rename = "type")]
|
||||
pub attachment_type: String,
|
||||
|
||||
pub name: Option<String>,
|
||||
pub media_type: Option<String>,
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
|
|
@ -162,14 +162,15 @@ pub async fn handle_note(
|
|||
.map_err(|_| ValidationError("invalid attachment property"))?;
|
||||
let mut downloaded = vec![];
|
||||
for attachment in list {
|
||||
if attachment.attachment_type != DOCUMENT &&
|
||||
attachment.attachment_type != IMAGE
|
||||
{
|
||||
match attachment.attachment_type.as_str() {
|
||||
DOCUMENT | IMAGE | VIDEO => (),
|
||||
_ => {
|
||||
log::warn!(
|
||||
"skipping attachment of type {}",
|
||||
attachment.attachment_type,
|
||||
);
|
||||
continue;
|
||||
},
|
||||
};
|
||||
let attachment_url = attachment.url
|
||||
.ok_or(ValidationError("attachment URL is missing"))?;
|
||||
|
|
Loading…
Reference in a new issue