From 86bfab30c256c48a86d41d68bce9ba468be81f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D+85CD?= <50108258+kwaa@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:23:41 +0800 Subject: [PATCH] fix(apub/verify_blocked): check actor instead of id --- crates/apub/src/activities/create_or_update/note.rs | 2 +- crates/apub/src/activities/following/follow.rs | 2 +- crates/apub/src/activities/following/undo_follow.rs | 2 +- crates/apub/src/activities/like_or_announce/like_or_announce.rs | 2 +- .../src/activities/like_or_announce/undo_like_or_announce.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/apub/src/activities/create_or_update/note.rs b/crates/apub/src/activities/create_or_update/note.rs index 4a5e5f1b..f4aab39a 100644 --- a/crates/apub/src/activities/create_or_update/note.rs +++ b/crates/apub/src/activities/create_or_update/note.rs @@ -98,7 +98,7 @@ impl ActivityHandler for CreateOrUpdateNote { async fn verify(&self, data: &Data) -> Result<(), Self::Error> { // TODO ApubPost::verify(&self.object, &self.id, data).await?; - verify_blocked(&self.id, data).await?; + verify_blocked(&self.actor(), data).await?; Ok(()) } diff --git a/crates/apub/src/activities/following/follow.rs b/crates/apub/src/activities/following/follow.rs index c0d4d4cd..12071647 100644 --- a/crates/apub/src/activities/following/follow.rs +++ b/crates/apub/src/activities/following/follow.rs @@ -61,7 +61,7 @@ impl ActivityHandler for Follow { async fn verify(&self, data: &Data) -> Result<(), Self::Error> { // TODO - verify_blocked(&self.id, data).await?; + verify_blocked(&self.actor(), data).await?; Ok(()) } diff --git a/crates/apub/src/activities/following/undo_follow.rs b/crates/apub/src/activities/following/undo_follow.rs index 9166b269..92862e1d 100644 --- a/crates/apub/src/activities/following/undo_follow.rs +++ b/crates/apub/src/activities/following/undo_follow.rs @@ -46,7 +46,7 @@ impl ActivityHandler for UndoFollow { async fn verify(&self, data: &Data) -> Result<(), Self::Error> { // TODO - verify_blocked(&self.id, data).await?; + verify_blocked(&self.actor(), data).await?; Ok(()) } diff --git a/crates/apub/src/activities/like_or_announce/like_or_announce.rs b/crates/apub/src/activities/like_or_announce/like_or_announce.rs index a47822aa..b9c833f3 100644 --- a/crates/apub/src/activities/like_or_announce/like_or_announce.rs +++ b/crates/apub/src/activities/like_or_announce/like_or_announce.rs @@ -51,7 +51,7 @@ impl ActivityHandler for LikeOrAnnounce { async fn verify(&self, data: &Data) -> Result<(), Self::Error> { // TODO - verify_blocked(&self.id, data).await?; + verify_blocked(&self.actor(), data).await?; Ok(()) } diff --git a/crates/apub/src/activities/like_or_announce/undo_like_or_announce.rs b/crates/apub/src/activities/like_or_announce/undo_like_or_announce.rs index b69a382b..72bd0ea6 100644 --- a/crates/apub/src/activities/like_or_announce/undo_like_or_announce.rs +++ b/crates/apub/src/activities/like_or_announce/undo_like_or_announce.rs @@ -39,7 +39,7 @@ impl ActivityHandler for UndoLikeOrAnnounce { async fn verify(&self, data: &Data) -> Result<(), Self::Error> { // TODO - verify_blocked(&self.id, data).await?; + verify_blocked(&self.actor(), data).await?; Ok(()) }