From 831739d215355eb58f33e34d69f3197c4fd47f38 Mon Sep 17 00:00:00 2001 From: silverpill Date: Sun, 5 Feb 2023 20:46:58 +0000 Subject: [PATCH] Ignore Announce(Delete) activities --- CHANGELOG.md | 1 + src/activitypub/handlers/announce.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c482f1d..4614387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/activitypub/handlers/announce.rs b/src/activitypub/handlers/announce.rs index 268050c..054438d 100644 --- a/src/activitypub/handlers/announce.rs +++ b/src/activitypub/handlers/announce.rs @@ -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