Date: Fri, 15 Nov 2019 12:52:29 -0500
Subject: [PATCH 15/38] show badge visibility user setting checkbox only if
needed
---
src/components/user_settings/user_settings.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 8c18cf499b..3f1982a6bb 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -104,7 +104,7 @@
{{ $t('settings.hide_followers_count_description') }}
-
+
{{ $t('settings.show_admin_badge') }}
From 0995658757b89eeb38b78e997bec2d85b96296af Mon Sep 17 00:00:00 2001
From: kPherox
Date: Tue, 19 Nov 2019 14:07:15 +0000
Subject: [PATCH 16/38] backend interactor service: implement
startFetchingFollowRequest
backend interactor service: remove unused fetchFollowRequests
---
src/components/nav_panel/nav_panel.js | 7 +------
src/components/side_drawer/side_drawer.js | 4 ++++
src/modules/api.js | 7 +++++++
src/modules/users.js | 1 +
.../backend_interactor_service.js | 8 ++++++--
5 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index aa3f760533..7f783acbaa 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -1,12 +1,7 @@
-import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
-
const NavPanel = {
created () {
if (this.currentUser && this.currentUser.locked) {
- const store = this.$store
- const credentials = store.state.users.currentUser.credentials
-
- followRequestFetcher.startFetching({ store, credentials })
+ this.$store.dispatch('startFetchingFollowRequest')
}
},
computed: {
diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js
index 567d2e5e65..0188cf3e40 100644
--- a/src/components/side_drawer/side_drawer.js
+++ b/src/components/side_drawer/side_drawer.js
@@ -10,6 +10,10 @@ const SideDrawer = {
}),
created () {
this.closeGesture = GestureService.swipeGesture(GestureService.DIRECTION_LEFT, this.toggleDrawer)
+
+ if (this.currentUser && this.currentUser.locked) {
+ this.$store.dispatch('startFetchingFollowRequest')
+ }
},
components: { UserCard },
computed: {
diff --git a/src/modules/api.js b/src/modules/api.js
index eb6a798093..1293e3c841 100644
--- a/src/modules/api.js
+++ b/src/modules/api.js
@@ -43,6 +43,13 @@ const api = {
const fetcher = store.state.backendInteractor.startFetchingNotifications({ store })
store.commit('addFetcher', { fetcherName: 'notifications', fetcher })
},
+ startFetchingFollowRequest (store) {
+ // Don't start fetching if we already are.
+ if (store.state.fetchers['followRequest']) return
+
+ const fetcher = store.state.backendInteractor.startFetchingFollowRequest({ store })
+ store.commit('addFetcher', { fetcherName: 'followRequest', fetcher })
+ },
stopFetching (store, fetcherName) {
const fetcher = store.state.fetchers[fetcherName]
window.clearInterval(fetcher)
diff --git a/src/modules/users.js b/src/modules/users.js
index 1c9ff5e879..14b2d8b53d 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -434,6 +434,7 @@ const users = {
store.dispatch('stopFetching', 'friends')
store.commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))
store.dispatch('stopFetching', 'notifications')
+ store.dispatch('stopFetching', 'followRequest')
store.commit('clearNotifications')
store.commit('resetStatuses')
})
diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js
index d6617276d9..c16bd1f1aa 100644
--- a/src/services/backend_interactor_service/backend_interactor_service.js
+++ b/src/services/backend_interactor_service/backend_interactor_service.js
@@ -1,6 +1,7 @@
import apiService from '../api/api.service.js'
import timelineFetcherService from '../timeline_fetcher/timeline_fetcher.service.js'
import notificationsFetcher from '../notifications_fetcher/notifications_fetcher.service.js'
+import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
const backendInteractorService = credentials => {
const fetchStatus = ({ id }) => {
@@ -63,6 +64,10 @@ const backendInteractorService = credentials => {
return notificationsFetcher.startFetching({ store, credentials })
}
+ const startFetchingFollowRequest = ({ store }) => {
+ return followRequestFetcher.startFetching({ store, credentials })
+ }
+
// eslint-disable-next-line camelcase
const tagUser = ({ screen_name }, tag) => {
return apiService.tagUser({ screen_name, tag, credentials })
@@ -111,7 +116,6 @@ const backendInteractorService = credentials => {
const subscribeUser = (id) => apiService.subscribeUser({ credentials, id })
const unsubscribeUser = (id) => apiService.unsubscribeUser({ credentials, id })
const fetchBlocks = () => apiService.fetchBlocks({ credentials })
- const fetchFollowRequests = () => apiService.fetchFollowRequests({ credentials })
const fetchOAuthTokens = () => apiService.fetchOAuthTokens({ credentials })
const revokeOAuthToken = (id) => apiService.revokeOAuthToken({ id, credentials })
const fetchPinnedStatuses = (id) => apiService.fetchPinnedStatuses({ credentials, id })
@@ -168,6 +172,7 @@ const backendInteractorService = credentials => {
verifyCredentials: apiService.verifyCredentials,
startFetchingTimeline,
startFetchingNotifications,
+ startFetchingFollowRequest,
fetchMutes,
muteUser,
unmuteUser,
@@ -203,7 +208,6 @@ const backendInteractorService = credentials => {
mfaSetupOTP,
mfaConfirmOTP,
mfaDisableOTP,
- fetchFollowRequests,
approveUser,
denyUser,
vote,
From a55486f8d78161166e84b2b69709a49b3845c14e Mon Sep 17 00:00:00 2001
From: kPherox
Date: Tue, 19 Nov 2019 14:15:41 +0000
Subject: [PATCH 17/38] Normalize profile fields
---
.../entity_normalizer/entity_normalizer.service.js | 9 +++++++++
.../entity_normalizer/entity_normalizer.spec.js | 13 +++++++++++++
2 files changed, 22 insertions(+)
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index 5f45660d6b..ca79df6f6f 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -46,6 +46,14 @@ export const parseUser = (data) => {
output.description = data.note
output.description_html = addEmojis(data.note, data.emojis)
+ output.fields = data.fields
+ output.fields_html = data.fields.map(field => {
+ return {
+ name: addEmojis(field.name, data.emojis),
+ value: addEmojis(field.value, data.emojis)
+ }
+ })
+
// Utilize avatar_static for gif avatars?
output.profile_image_url = data.avatar
output.profile_image_url_original = data.avatar
@@ -95,6 +103,7 @@ export const parseUser = (data) => {
if (data.source) {
output.description = data.source.note
output.default_scope = data.source.privacy
+ output.fields = data.source.fields
if (data.source.pleroma) {
output.no_rich_text = data.source.pleroma.no_rich_text
output.show_role = data.source.pleroma.show_role
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 49f378e2bd..cfb380bafc 100644
--- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
+++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
@@ -277,6 +277,19 @@ describe('API Entities normalizer', () => {
expect(parsedUser).to.have.property('description_html').that.contains(' {
+ const user = makeMockUserMasto({ emojis: makeMockEmojiMasto(), fields: [{ name: ':thinking:', value: ':image:' }] })
+
+ const parsedUser = parseUser(user)
+
+ expect(parsedUser).to.have.property('fields_html').to.be.an('array')
+
+ const field = parsedUser.fields_html[0]
+
+ expect(field).to.have.property('name').that.contains(' {
const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false, hide_followers_count: false, hide_follows_count: true } })
From 55da4462a4934f00486fdcaba5d43b3a092860e9 Mon Sep 17 00:00:00 2001
From: Hakaba Hitoyo
Date: Tue, 19 Nov 2019 17:02:45 +0000
Subject: [PATCH 18/38] [i18n] Improve easy/pedantic Japanese switching
---
src/i18n/{ja.json => ja_pedantic.json} | 0
src/i18n/messages.js | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
rename src/i18n/{ja.json => ja_pedantic.json} (100%)
diff --git a/src/i18n/ja.json b/src/i18n/ja_pedantic.json
similarity index 100%
rename from src/i18n/ja.json
rename to src/i18n/ja_pedantic.json
diff --git a/src/i18n/messages.js b/src/i18n/messages.js
index 774a48e0bb..c56ae205aa 100644
--- a/src/i18n/messages.js
+++ b/src/i18n/messages.js
@@ -23,7 +23,7 @@ const messages = {
he: require('./he.json'),
hu: require('./hu.json'),
it: require('./it.json'),
- ja: require('./ja.json'),
+ ja: require('./ja_pedantic.json'),
ja_easy: require('./ja_easy.json'),
ko: require('./ko.json'),
nb: require('./nb.json'),
From 40e774e05abfce6da3c558c09ce1750c132a580f Mon Sep 17 00:00:00 2001
From: taehoon
Date: Mon, 25 Nov 2019 12:25:01 -0500
Subject: [PATCH 19/38] =?UTF-8?q?restore=20muted=20users=20collapsing=20lo?=
=?UTF-8?q?gic=20on=20other=20user=E2=80=99s=20profiles?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/conversation/conversation.js | 3 ++-
src/components/conversation/conversation.vue | 1 +
src/components/status/status.js | 5 +++--
src/components/timeline/timeline.vue | 2 ++
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 72ee9c390d..08283fff88 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -43,7 +43,8 @@ const conversation = {
'collapsable',
'isPage',
'pinnedStatusIdsObject',
- 'inProfile'
+ 'inProfile',
+ 'profileUserId'
],
created () {
if (this.isPage) {
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 0f1de55fd4..2e48240aa1 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -27,6 +27,7 @@
:highlight="getHighlight()"
:replies="getReplies(status.id)"
:in-profile="inProfile"
+ :profile-user-id="profileUserId"
class="status-fadein panel-body"
@goto="setHighlight"
@toggleExpanded="toggleExpanded"
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 714ea6d222..c49e729c07 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -33,7 +33,8 @@ const Status = {
'noHeading',
'inlineExpanded',
'showPinned',
- 'inProfile'
+ 'inProfile',
+ 'profileUserId'
],
data () {
return {
@@ -115,7 +116,7 @@ const Status = {
return hits
},
- muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || (!this.inConversation && this.status.thread_muted) || this.muteWordHits.length > 0) },
+ muted () { return !this.unmuted && ((!(this.inProfile && this.status.user.id === this.profileUserId) && this.status.user.muted) || (!this.inConversation && this.status.thread_muted) || this.muteWordHits.length > 0) },
hideFilteredStatuses () {
return this.mergedConfig.hideFilteredStatuses
},
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index f1d3903a07..93f6f5706b 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -37,6 +37,7 @@
:collapsable="true"
:pinned-status-ids-object="pinnedStatusIdsObject"
:in-profile="inProfile"
+ :profile-user-id="userId"
/>
@@ -47,6 +48,7 @@
:status-id="status.id"
:collapsable="true"
:in-profile="inProfile"
+ :profile-user-id="userId"
/>