]> Untitled Git - lemmy.git/commitdiff
Rejected federated pm from blocked users (fixes #2398) (#2408)
authorNutomic <me@nutomic.com>
Wed, 17 Aug 2022 20:53:19 +0000 (20:53 +0000)
committerGitHub <noreply@github.com>
Wed, 17 Aug 2022 20:53:19 +0000 (16:53 -0400)
crates/apub/src/objects/private_message.rs

index fd3f5135cd17cfc2892366b37a4b17662acb9962..8a8f9b4af7916dd6e5f13c1e17174d147f97a07b 100644 (file)
@@ -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,