1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Add post with PDF support

This commit is contained in:
2020-07-03 10:27:09 +02:00
parent 689cf07ee4
commit b858eac3c4
3 changed files with 6 additions and 5 deletions

View File

@ -5,7 +5,7 @@
use crate::constants::database_tables_names::POSTS_TABLE;
use crate::data::error::{ExecError, ResultBoxError};
use crate::data::post::{Post, PostFile, PostKind, PostPageKind, PostVisibilityLevel, PostWebLink};
use crate::data::post::PostKind::{POST_KIND_IMAGE, POST_KIND_WEBLINK};
use crate::data::post::PostKind::{POST_KIND_IMAGE, POST_KIND_PDF, POST_KIND_WEBLINK};
use crate::data::user::UserID;
use crate::helpers::{database, friends_helper};
use crate::utils::date_utils::time;
@ -168,6 +168,8 @@ fn db_to_post(res: &database::RowResult) -> ResultBoxError<Post> {
image: res.get_optional_str("image_page")?,
}),
"pdf" => post.kind = POST_KIND_PDF(file?),
_ => {}
}