From 01dca62ce5d455052a830c9d5e0e6316d1cc36d2 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 2 May 2022 23:38:32 +0900 Subject: [PATCH] Rename: Like07 -> LikeAct --- plume-models/src/likes.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plume-models/src/likes.rs b/plume-models/src/likes.rs index 0218c8ee..e7787e57 100644 --- a/plume-models/src/likes.rs +++ b/plume-models/src/likes.rs @@ -3,7 +3,7 @@ use crate::{ users::User, Connection, Error, Result, CONFIG, }; use activitystreams::{ - activity::{ActorAndObjectRef, Like as Like07, Undo}, + activity::{ActorAndObjectRef, Like as LikeAct, Undo}, base::AnyBase, iri_string::types::IriString, prelude::*, @@ -39,8 +39,8 @@ impl Like { find_by!(likes, find_by_ap_url, ap_url as &str); find_by!(likes, find_by_user_on_post, user_id as i32, post_id as i32); - pub fn to_activity07(&self, conn: &Connection) -> Result { - let mut act = Like07::new( + pub fn to_activity07(&self, conn: &Connection) -> Result { + let mut act = LikeAct::new( User::get(conn, self.user_id)?.ap_url.parse::()?, Post::get(conn, self.post_id)?.ap_url.parse::()?, ); @@ -85,7 +85,7 @@ impl Like { } } -impl AsObject for Post { +impl AsObject for Post { type Error = Error; type Output = Like; @@ -107,13 +107,13 @@ impl AsObject for Post { impl FromId for Like { type Error = Error; - type Object = Like07; + type Object = LikeAct; fn from_db07(conn: &DbConn, id: &str) -> Result { Like::find_by_ap_url(conn, id) } - fn from_activity07(conn: &DbConn, act: Like07) -> Result { + fn from_activity07(conn: &DbConn, act: LikeAct) -> Result { let res = Like::insert( conn, NewLike {