Ignore Announce(Delete) activities

This commit is contained in:
silverpill 2023-02-05 20:46:58 +00:00
parent ad1a658806
commit 831739d215
2 changed files with 3 additions and 2 deletions

View file

@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Change max body size in nginx example config to match app limit.
- Don't create invoice if recipient can't accept subscription payments.
- Ignore `Announce(Delete)` activities.
## [1.12.0] - 2023-01-26

View file

@ -5,7 +5,7 @@ use crate::activitypub::{
fetcher::helpers::{get_or_import_profile_by_actor_id, import_post},
identifiers::parse_local_object_id,
receiver::deserialize_into_object_id,
vocabulary::{CREATE, DISLIKE, LIKE, NOTE, UNDO, UPDATE},
vocabulary::{CREATE, DELETE, DISLIKE, LIKE, NOTE, UNDO, UPDATE},
};
use crate::config::Config;
use crate::database::{DatabaseClient, DatabaseError};
@ -32,7 +32,7 @@ pub async fn handle_announce(
db_client: &mut impl DatabaseClient,
activity: Value,
) -> HandlerResult {
if let Some(CREATE | DISLIKE | LIKE | UNDO | UPDATE) =
if let Some(CREATE | DELETE | DISLIKE | LIKE | UNDO | UPDATE) =
activity["object"]["type"].as_str()
{
// Ignore wrapped activities from Lemmy