From aafb29c58978cbd8dbea2898b93bdab9979b5646 Mon Sep 17 00:00:00 2001
From: eugenijm
+ + +
+
+ + +
diff --git a/src/i18n/en.json b/src/i18n/en.json index ddde471ab8..a63ee21d4f 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -277,6 +277,8 @@ "no_mutes": "No mutes", "hide_follows_description": "Don't show who I'm following", "hide_followers_description": "Don't show who's following me", + "hide_follows_count_description": "Don't show follow count", + "hide_followers_count_description": "Don't show follower count", "show_admin_badge": "Show Admin badge in my profile", "show_moderator_badge": "Show Moderator badge in my profile", "nsfw_clickthrough": "Enable clickthrough NSFW attachment hiding", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index 3af65f400c..16268425aa 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -178,6 +178,8 @@ "no_rich_text_description": "Убрать форматирование из всех постов", "hide_follows_description": "Не показывать кого я читаю", "hide_followers_description": "Не показывать кто читает меня", + "hide_follows_count_description": "Не показывать число читаемых пользователей", + "hide_followers_count_description": "Не показывать число моих подписчиков", "show_admin_badge": "Показывать значок администратора в моем профиле", "show_moderator_badge": "Показывать значок модератора в моем профиле", "nsfw_clickthrough": "Включить скрытие NSFW вложений", diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 7438cd9069..b630933602 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -74,6 +74,8 @@ export const parseUser = (data) => { output.hide_follows = data.pleroma.hide_follows output.hide_followers = data.pleroma.hide_followers + output.hide_follows_count = data.pleroma.hide_follows_count + output.hide_followers_count = data.pleroma.hide_followers_count output.rights = { moderator: data.pleroma.is_moderator, @@ -140,6 +142,8 @@ export const parseUser = (data) => { output.default_scope = data.default_scope output.hide_follows = data.hide_follows output.hide_followers = data.hide_followers + output.hide_follows_count = data.hide_follows_count + output.hide_followers_count = data.hide_followers_count output.background_image = data.background_image // on mastoapi this info is contained in a "relationship" output.following = data.following 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 20e03cb08f..736b842c58 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -278,10 +278,12 @@ describe('API Entities normalizer', () => { }) it('adds hide_follows and hide_followers user settings', () => { - const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false } }) + const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false, hide_followers_count: false, hide_follows_count: true } }) expect(parseUser(user)).to.have.property('hide_followers', true) expect(parseUser(user)).to.have.property('hide_follows', false) + expect(parseUser(user)).to.have.property('hide_followers_count', false) + expect(parseUser(user)).to.have.property('hide_follows_count', true) }) })