mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 21:41:04 +00:00
Add test for Tag::from_activity07()
This commit is contained in:
parent
2b1ddc71ac
commit
2316d36e03
1 changed files with 16 additions and 0 deletions
|
@ -66,6 +66,22 @@ impl Tag {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn from_activity07(
|
||||||
|
conn: &Connection,
|
||||||
|
tag: &Hashtag07,
|
||||||
|
post: i32,
|
||||||
|
is_hashtag: bool,
|
||||||
|
) -> Result<Tag> {
|
||||||
|
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<Hashtag> {
|
pub fn build_activity(tag: String) -> Result<Hashtag> {
|
||||||
let mut ht = Hashtag::default();
|
let mut ht = Hashtag::default();
|
||||||
ht.set_href_string(ap_url(&format!(
|
ht.set_href_string(ap_url(&format!(
|
||||||
|
|
Loading…
Reference in a new issue