From 2316d36e033771d85f262bfce1069f265a79e5b1 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 6 Mar 2022 21:19:56 +0900 Subject: [PATCH] Add test for Tag::from_activity07() --- plume-models/src/tags.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plume-models/src/tags.rs b/plume-models/src/tags.rs index 18072929..7631358b 100644 --- a/plume-models/src/tags.rs +++ b/plume-models/src/tags.rs @@ -66,6 +66,22 @@ impl Tag { ) } + pub fn from_activity07( + conn: &Connection, + tag: &Hashtag07, + post: i32, + is_hashtag: bool, + ) -> Result { + Tag::insert( + conn, + NewTag { + tag: tag.name().ok_or(Error::MissingApProperty)?.as_str().into(), + is_hashtag, + post_id: post, + }, + ) + } + pub fn build_activity(tag: String) -> Result { let mut ht = Hashtag::default(); ht.set_href_string(ap_url(&format!(