From 4ef9350ce7b2b71f044d6668b9099781b56e2b2a Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 2 May 2022 23:45:06 +0900 Subject: [PATCH] Remove unused Mention::to_activity() --- plume-models/src/mentions.rs | 39 ------------------------------------ 1 file changed, 39 deletions(-) diff --git a/plume-models/src/mentions.rs b/plume-models/src/mentions.rs index 7a3d0a87..691b92d5 100644 --- a/plume-models/src/mentions.rs +++ b/plume-models/src/mentions.rs @@ -69,16 +69,6 @@ impl Mention { Ok(mention) } - pub fn to_activity(&self, conn: &Connection) -> Result { - let user = self.get_mentioned(conn)?; - let mut mention = link::Mention::default(); - mention.link_props.set_href_string(user.ap_url.clone())?; - mention - .link_props - .set_name_string(format!("@{}", user.fqn))?; - Ok(mention) - } - pub fn to_activity07(&self, conn: &Connection) -> Result { let user = self.get_mentioned(conn)?; let mut mention = link07::Mention::new(); @@ -231,35 +221,6 @@ mod tests { }); } - #[test] - fn to_activity() { - let conn = db(); - conn.test_transaction::<_, Error, _>(|| { - let (posts, users, _blogs) = fill_database(&conn); - let post = &posts[0]; - let user = &users[0]; - let mention = Mention::insert( - &conn, - NewMention { - mentioned_id: user.id, - post_id: Some(post.id), - comment_id: None, - }, - )?; - let act = mention.to_activity(&conn)?; - - let expected = json!({ - "href": "https://plu.me/@/admin/", - "name": "@admin", - "type": "Mention", - }); - - assert_json_eq!(to_value(act)?, expected); - - Ok(()) - }); - } - #[test] fn to_activity07() { let conn = db();