From 14ec12b4f62695d0cf36acb3a9ace6685763aa65 Mon Sep 17 00:00:00 2001 From: Eugenij Date: Sun, 7 Jul 2019 10:20:55 +0000 Subject: [PATCH] Set hide_follows and hide_followers settings when parsing Mastodon format --- .../entity_normalizer/entity_normalizer.service.js | 3 +++ .../services/entity_normalizer/entity_normalizer.spec.js | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 9af71e4f..df6747a6 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -70,6 +70,9 @@ export const parseUser = (data) => { output.muted = relationship.muting } + output.hide_follows = data.pleroma.hide_follows + output.hide_followers = data.pleroma.hide_followers + output.rights = { moderator: data.pleroma.is_moderator, admin: data.pleroma.is_admin diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js index 3d34c5cc..b3491c61 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -282,6 +282,13 @@ describe('API Entities normalizer', () => { expect(parsedUser).to.have.property('description_html').that.contains(' { + const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false } }) + + expect(parseUser(user)).to.have.property('hide_followers', true) + expect(parseUser(user)).to.have.property('hide_follows', false) + }) }) // We currently use QvitterAPI notifications only, and especially due to MastoAPI lacking is_seen, support for MastoAPI