From c89006c94a4ec5aab2bf387d7605d92a565f8184 Mon Sep 17 00:00:00 2001 From: Nutomic Date: Wed, 17 Aug 2022 20:53:19 +0000 Subject: [PATCH] Rejected federated pm from blocked users (fixes #2398) (#2408) --- crates/apub/src/objects/private_message.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/apub/src/objects/private_message.rs b/crates/apub/src/objects/private_message.rs index fd3f5135..8a8f9b4a 100644 --- a/crates/apub/src/objects/private_message.rs +++ b/crates/apub/src/objects/private_message.rs @@ -14,7 +14,7 @@ use activitypub_federation::{ utils::verify_domains_match, }; use chrono::NaiveDateTime; -use lemmy_api_common::utils::blocking; +use lemmy_api_common::utils::{blocking, check_person_block}; use lemmy_db_schema::{ source::{ person::Person, @@ -132,6 +132,7 @@ impl ApubObject for ApubPrivateMessage { let recipient = note.to[0] .dereference(context, local_instance(context), request_counter) .await?; + check_person_block(creator.id, recipient.id, context.pool()).await?; let form = PrivateMessageForm { creator_id: creator.id, -- 2.44.1