From 36e56354e448b3c2106668f353dedcab5fde794d Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 19 Jan 2021 10:01:55 -0600 Subject: [PATCH] More robust backwards compatibility --- .../entity_normalizer/entity_normalizer.service.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index a199ebd0..d6d84d9a 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -188,9 +188,12 @@ export const parseUser = (data) => { output.follow_request_count = data.pleroma.follow_request_count output.tags = data.pleroma.tags + // deactivated was changed to is_active in Pleroma 2.3.0 - // backwards compatability kept for now - output.deactivated = data.pleroma.deactivated ? !data.pleroma.is_active : data.pleroma.deactivated + // so check if is_active is present + output.deactivated = typeof data.pleroma.is_active !== undefined + ? !data.pleroma.is_active // new backend + : data.pleroma.deactivated // old backend output.notification_settings = data.pleroma.notification_settings output.unread_chat_count = data.pleroma.unread_chat_count