mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-29 15:51:20 +00:00
Fixing local user check in apub code.
This commit is contained in:
parent
0204b35324
commit
0e9ea4df9d
1 changed files with 8 additions and 3 deletions
|
@ -136,9 +136,14 @@ impl Object for ApubPrivateMessage {
|
||||||
let recipient = note.to[0].dereference(context).await?;
|
let recipient = note.to[0].dereference(context).await?;
|
||||||
PersonBlock::read(&mut context.pool(), recipient.id, creator.id).await?;
|
PersonBlock::read(&mut context.pool(), recipient.id, creator.id).await?;
|
||||||
|
|
||||||
let recipient_local_user =
|
// If its a local user, check that they can receive private messages
|
||||||
LocalUserView::read_person(&mut context.pool(), recipient.id).await?;
|
if recipient.local {
|
||||||
check_private_messages_enabled(&recipient_local_user)?;
|
if let Ok(recipient_local_user) =
|
||||||
|
LocalUserView::read_person(&mut context.pool(), recipient.id).await
|
||||||
|
{
|
||||||
|
check_private_messages_enabled(&recipient_local_user)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
let local_site = LocalSite::read(&mut context.pool()).await.ok();
|
let local_site = LocalSite::read(&mut context.pool()).await.ok();
|
||||||
let slur_regex = &local_site_opt_to_slur_regex(&local_site);
|
let slur_regex = &local_site_opt_to_slur_regex(&local_site);
|
||||||
let url_blocklist = get_url_blocklist(context).await?;
|
let url_blocklist = get_url_blocklist(context).await?;
|
||||||
|
|
Loading…
Reference in a new issue