From 2707c346593be7a06aca6d57335a58e4337e0768 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 25 Jan 2023 19:42:55 +0600 Subject: [PATCH] Fix remove contact with gravatar/color (#2542) Signed-off-by: Denis Bykhov --- server-plugins/contact-resources/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-plugins/contact-resources/src/index.ts b/server-plugins/contact-resources/src/index.ts index 41ade59147..dff3b7f524 100644 --- a/server-plugins/contact-resources/src/index.ts +++ b/server-plugins/contact-resources/src/index.ts @@ -50,6 +50,10 @@ export async function OnContactDelete (tx: Tx, { findAll, hierarchy, storageFx } return [] } + if (avatar.includes('://') && !avatar.startsWith('image://')) { + return [] + } + storageFx(async (adapter, bucket) => { await adapter.remove(bucket, [avatar])