Merge branch 'instance-migration' into shigusegubu-themes3
This commit is contained in:
commit
7c6ce89b6e
45 changed files with 266 additions and 266 deletions
0
changelog.d/instance-store-migration.skip
Normal file
0
changelog.d/instance-store-migration.skip
Normal file
25
src/App.js
25
src/App.js
|
|
@ -23,6 +23,7 @@ import { getOrCreateServiceWorker } from './services/sw/sw'
|
||||||
import { windowHeight, windowWidth } from './services/window_utils/window_utils'
|
import { windowHeight, windowWidth } from './services/window_utils/window_utils'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useShoutStore } from 'src/stores/shout.js'
|
import { useShoutStore } from 'src/stores/shout.js'
|
||||||
|
|
||||||
|
|
@ -146,13 +147,6 @@ export default {
|
||||||
shout() {
|
shout() {
|
||||||
return useShoutStore().joined
|
return useShoutStore().joined
|
||||||
},
|
},
|
||||||
showInstanceSpecificPanel() {
|
|
||||||
return (
|
|
||||||
this.showInstanceSpecificPanel &&
|
|
||||||
!this.$store.getters.mergedConfig.hideISP &&
|
|
||||||
this.instanceSpecificPanelContent
|
|
||||||
)
|
|
||||||
},
|
|
||||||
isChats() {
|
isChats() {
|
||||||
return this.$route.name === 'chat' || this.$route.name === 'chats'
|
return this.$route.name === 'chat' || this.$route.name === 'chats'
|
||||||
},
|
},
|
||||||
|
|
@ -193,6 +187,12 @@ export default {
|
||||||
scrollParent() {
|
scrollParent() {
|
||||||
return window /* this.$refs.appContentRef */
|
return window /* this.$refs.appContentRef */
|
||||||
},
|
},
|
||||||
|
showInstanceSpecificPanel() {
|
||||||
|
return (
|
||||||
|
this.instanceSpecificPanelPresent &&
|
||||||
|
!this.$store.getters.mergedConfig.hideISP
|
||||||
|
)
|
||||||
|
},
|
||||||
...mapGetters(['mergedConfig']),
|
...mapGetters(['mergedConfig']),
|
||||||
...mapState(useInterfaceStore, [
|
...mapState(useInterfaceStore, [
|
||||||
'themeApplied',
|
'themeApplied',
|
||||||
|
|
@ -200,14 +200,15 @@ export default {
|
||||||
'layoutType',
|
'layoutType',
|
||||||
]),
|
]),
|
||||||
...mapState(useInstanceStore, ['styleDataUsed', 'private']),
|
...mapState(useInstanceStore, ['styleDataUsed', 'private']),
|
||||||
|
...mapState(useInstanceCapabilitiesStore, [
|
||||||
|
'suggestionsEnabled',
|
||||||
|
'editingAvailable',
|
||||||
|
]),
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceStore, {
|
||||||
instanceBackground: (store) => store.instanceIdentity.background,
|
instanceBackground: (store) => store.instanceIdentity.background,
|
||||||
showFeaturesPanel: (store) => store.instanceIdentity.showFeaturesPanel,
|
showFeaturesPanel: (store) => store.instanceIdentity.showFeaturesPanel,
|
||||||
showInstanceSpecificPanel: (store) =>
|
instanceSpecificPanelPresent: (store) =>
|
||||||
store.instanceIdentity.showInstanceSpecificPanel,
|
store.instanceIdentity.showInstanceSpecificPanel &&
|
||||||
suggestionsEnabled: (store) => store.featureSet.suggestionsEnabled,
|
|
||||||
editingAvailable: (store) => store.featureSet.editingAvailable,
|
|
||||||
instanceSpecificPanelContent: (store) =>
|
|
||||||
store.instanceIdentity.instanceSpecificPanelContent,
|
store.instanceIdentity.instanceSpecificPanelContent,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import { useAuthFlowStore } from 'src/stores/auth_flow'
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useI18nStore } from 'src/stores/i18n'
|
import { useI18nStore } from 'src/stores/i18n'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useOAuthStore } from 'src/stores/oauth'
|
import { useOAuthStore } from 'src/stores/oauth'
|
||||||
|
|
||||||
|
|
@ -82,10 +83,10 @@ const getInstanceConfig = async ({ store }) => {
|
||||||
const textlimit = data.max_toot_chars
|
const textlimit = data.max_toot_chars
|
||||||
const vapidPublicKey = data.pleroma.vapid_public_key
|
const vapidPublicKey = data.pleroma.vapid_public_key
|
||||||
|
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
name: 'featureSet.pleromaExtensionsAvailable',
|
'pleromaExtensionsAvailable',
|
||||||
value: data.pleroma,
|
data.pleroma,
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'textlimit',
|
name: 'textlimit',
|
||||||
value: textlimit,
|
value: textlimit,
|
||||||
|
|
@ -278,68 +279,68 @@ const getNodeInfo = async ({ store }) => {
|
||||||
path: 'registrationOpen',
|
path: 'registrationOpen',
|
||||||
value: data.openRegistrations,
|
value: data.openRegistrations,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.mediaProxyAvailable',
|
'mediaProxyAvailable',
|
||||||
value: features.includes('media_proxy'),
|
features.includes('media_proxy'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.safeDM',
|
'safeDM',
|
||||||
value: features.includes('safe_dm_mentions'),
|
features.includes('safe_dm_mentions'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.shoutAvailable',
|
'shoutAvailable',
|
||||||
value: features.includes('chat'),
|
features.includes('chat'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.pleromaChatMessagesAvailable',
|
'pleromaChatMessagesAvailable',
|
||||||
value: features.includes('pleroma_chat_messages'),
|
features.includes('pleroma_chat_messages'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.pleromaCustomEmojiReactionsAvailable',
|
'pleromaCustomEmojiReactionsAvailable',
|
||||||
value:
|
|
||||||
features.includes('pleroma_custom_emoji_reactions') ||
|
features.includes('pleroma_custom_emoji_reactions') ||
|
||||||
features.includes('custom_emoji_reactions'),
|
features.includes('custom_emoji_reactions'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.pleromaBookmarkFoldersAvailable',
|
'pleromaBookmarkFoldersAvailable',
|
||||||
value: features.includes('pleroma:bookmark_folders'),
|
features.includes('pleroma:bookmark_folders'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.gopherAvailable',
|
'gopherAvailable',
|
||||||
value: features.includes('gopher'),
|
features.includes('gopher'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.pollsAvailable',
|
'pollsAvailable',
|
||||||
value: features.includes('polls'),
|
features.includes('polls'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.editingAvailable',
|
'editingAvailable',
|
||||||
value: features.includes('editing'),
|
features.includes('editing'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.mailerEnabled',
|
'mailerEnabled',
|
||||||
value: metadata.mailerEnabled,
|
metadata.mailerEnabled,
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.quotingAvailable',
|
'quotingAvailable',
|
||||||
value: features.includes('quote_posting'),
|
features.includes('quote_posting'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.groupActorAvailable',
|
'groupActorAvailable',
|
||||||
value: features.includes('pleroma:group_actors'),
|
features.includes('pleroma:group_actors'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.blockExpiration',
|
'blockExpiration',
|
||||||
value: features.includes('pleroma:block_expiration'),
|
features.includes('pleroma:block_expiration'),
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'localBubbleInstances',
|
path: 'localBubbleInstances',
|
||||||
value: metadata.localBubbleInstances ?? [],
|
value: metadata.localBubbleInstances ?? [],
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
path: 'featureSet.localBubble',
|
'localBubble',
|
||||||
value: (metadata.localBubbleInstances ?? []).length > 0,
|
(metadata.localBubbleInstances ?? []).length > 0,
|
||||||
})
|
)
|
||||||
|
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'limits.pollLimits',
|
path: 'limits.pollLimits',
|
||||||
|
|
@ -347,44 +348,39 @@ const getNodeInfo = async ({ store }) => {
|
||||||
})
|
})
|
||||||
const uploadLimits = metadata.uploadLimits
|
const uploadLimits = metadata.uploadLimits
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'limits.uploadlimit',
|
path: 'limits.uploadlimit',
|
||||||
value: parseInt(uploadLimits.general),
|
value: parseInt(uploadLimits.general),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'limits.avatarlimit',
|
path: 'limits.avatarlimit',
|
||||||
value: parseInt(uploadLimits.avatar),
|
value: parseInt(uploadLimits.avatar),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'limits.backgroundlimit',
|
path: 'limits.backgroundlimit',
|
||||||
value: parseInt(uploadLimits.background),
|
value: parseInt(uploadLimits.background),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'limits.bannerlimit',
|
path: 'limits.bannerlimit',
|
||||||
value: parseInt(uploadLimits.banner),
|
value: parseInt(uploadLimits.banner),
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'limits.fieldsLimits',
|
path: 'limits.fieldsLimits',
|
||||||
value: metadata.fieldsLimits,
|
value: metadata.fieldsLimits,
|
||||||
})
|
})
|
||||||
|
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'restrictedNicknames',
|
path: 'restrictedNicknames',
|
||||||
value: metadata.restrictedNicknames,
|
value: metadata.restrictedNicknames,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set('postFormats', metadata.postFormats)
|
||||||
name: 'featureSet.postFormats',
|
|
||||||
value: metadata.postFormats,
|
|
||||||
})
|
|
||||||
|
|
||||||
const suggestions = metadata.suggestions
|
const suggestions = metadata.suggestions
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
name: 'featureSet.suggestionsEnabled',
|
'suggestionsEnabled',
|
||||||
value: suggestions.enabled,
|
suggestions.enabled,
|
||||||
})
|
)
|
||||||
useInstanceStore().set({
|
// this is unused, why?
|
||||||
name: 'featureSet.suggestionsWeb',
|
useInstanceCapabilitiesStore().set('suggestionsWeb', suggestions.web)
|
||||||
value: suggestions.web,
|
|
||||||
})
|
|
||||||
|
|
||||||
const software = data.software
|
const software = data.software
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
|
|
@ -407,27 +403,26 @@ const getNodeInfo = async ({ store }) => {
|
||||||
|
|
||||||
const federation = metadata.federation
|
const federation = metadata.federation
|
||||||
|
|
||||||
useInstanceStore().set({
|
useInstanceCapabilitiesStore().set(
|
||||||
name: 'featureSet.tagPolicyAvailable',
|
'tagPolicyAvailable',
|
||||||
value:
|
typeof federation.mrf_policies === 'undefined'
|
||||||
typeof federation.mrf_policies === 'undefined'
|
? false
|
||||||
? false
|
: metadata.federation.mrf_policies.includes('TagPolicy'),
|
||||||
: metadata.federation.mrf_policies.includes('TagPolicy'),
|
)
|
||||||
})
|
|
||||||
|
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'federationPolicy',
|
path: 'federationPolicy',
|
||||||
value: federation,
|
value: federation,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'federating',
|
path: 'federating',
|
||||||
value:
|
value:
|
||||||
typeof federation.enabled === 'undefined' ? true : federation.enabled,
|
typeof federation.enabled === 'undefined' ? true : federation.enabled,
|
||||||
})
|
})
|
||||||
|
|
||||||
const accountActivationRequired = metadata.accountActivationRequired
|
const accountActivationRequired = metadata.accountActivationRequired
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'accountActivationRequired',
|
path: 'accountActivationRequired',
|
||||||
value: accountActivationRequired,
|
value: accountActivationRequired,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import BookmarkFolders from '../components/bookmark_folders/bookmark_folders.vue
|
||||||
import QuotesTimeline from '../components/quotes_timeline/quotes_timeline.vue'
|
import QuotesTimeline from '../components/quotes_timeline/quotes_timeline.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
export default (store) => {
|
export default (store) => {
|
||||||
const validateAuthenticatedRoute = (to, from, next) => {
|
const validateAuthenticatedRoute = (to, from, next) => {
|
||||||
|
|
@ -205,7 +206,7 @@ export default (store) => {
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (useInstanceStore().featureSet.pleromaChatMessagesAvailable) {
|
if (useInstanceCapabilitiesStore().pleromaChatMessagesAvailable) {
|
||||||
routes = routes.concat([
|
routes = routes.concat([
|
||||||
{
|
{
|
||||||
name: 'chat',
|
name: 'chat',
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import ConfirmModal from '../confirm_modal/confirm_modal.vue'
|
||||||
import Popover from '../popover/popover.vue'
|
import Popover from '../popover/popover.vue'
|
||||||
import ProgressButton from '../progress_button/progress_button.vue'
|
import ProgressButton from '../progress_button/progress_button.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useReportsStore } from 'src/stores/reports'
|
import { useReportsStore } from 'src/stores/reports'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
|
@ -94,11 +94,10 @@ const AccountActions = {
|
||||||
shouldConfirmRemoveUserFromFollowers() {
|
shouldConfirmRemoveUserFromFollowers() {
|
||||||
return this.$store.getters.mergedConfig.modalOnRemoveUserFromFollowers
|
return this.$store.getters.mergedConfig.modalOnRemoveUserFromFollowers
|
||||||
},
|
},
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceCapabilitiesStore, [
|
||||||
blockExpirationSupported: (store) => store.featureSet.blockExpiration,
|
'blockExpiration',
|
||||||
pleromaChatMessagesAvailable: (store) =>
|
'pleromaChatMessagesAvailable',
|
||||||
store.featureSet.pleromaChatMessagesAvailable,
|
]),
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
</Popover>
|
</Popover>
|
||||||
<teleport to="#modal">
|
<teleport to="#modal">
|
||||||
<confirm-modal
|
<confirm-modal
|
||||||
v-if="showingConfirmBlock && !blockExpirationSupported"
|
v-if="showingConfirmBlock && !blockExpiration"
|
||||||
ref="blockDialog"
|
ref="blockDialog"
|
||||||
:title="$t('user_card.block_confirm_title')"
|
:title="$t('user_card.block_confirm_title')"
|
||||||
:confirm-text="$t('user_card.block_confirm_accept_button')"
|
:confirm-text="$t('user_card.block_confirm_accept_button')"
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
</confirm-modal>
|
</confirm-modal>
|
||||||
<UserTimedFilterModal
|
<UserTimedFilterModal
|
||||||
v-if="blockExpirationSupported"
|
v-if="blockExpiration"
|
||||||
ref="timedBlockDialog"
|
ref="timedBlockDialog"
|
||||||
:is-mute="false"
|
:is-mute="false"
|
||||||
:user="user"
|
:user="user"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import StillImage from '../still-image/still-image.vue'
|
||||||
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useMediaViewerStore } from 'src/stores/media_viewer'
|
import { useMediaViewerStore } from 'src/stores/media_viewer'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
|
@ -107,7 +108,7 @@ const Attachment = {
|
||||||
return 'file'
|
return 'file'
|
||||||
},
|
},
|
||||||
referrerpolicy() {
|
referrerpolicy() {
|
||||||
return useInstanceStore().featureSet.mediaProxyAvailable
|
return useInstanceCapabilitiesStore().mediaProxyAvailable
|
||||||
? ''
|
? ''
|
||||||
: 'no-referrer'
|
: 'no-referrer'
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import { mapState } from 'pinia'
|
import { mapState } from 'pinia'
|
||||||
|
|
||||||
|
import UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue'
|
||||||
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
const BlockCard = {
|
const BlockCard = {
|
||||||
props: ['userId'],
|
props: ['userId'],
|
||||||
|
|
@ -26,19 +27,18 @@ const BlockCard = {
|
||||||
new Date(this.user.mute_expires_at).toLocaleString(),
|
new Date(this.user.mute_expires_at).toLocaleString(),
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceCapabilitiesStore, ['blockExpiration']),
|
||||||
blockExpirationSupported: (store) => store.featureSet.blockExpiration,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
BasicUserCard,
|
BasicUserCard,
|
||||||
|
UserTimedFilterModal,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
unblockUser() {
|
unblockUser() {
|
||||||
this.$store.dispatch('unblockUser', this.user.id)
|
this.$store.dispatch('unblockUser', this.user.id)
|
||||||
},
|
},
|
||||||
blockUser() {
|
blockUser() {
|
||||||
if (this.blockExpirationSupported) {
|
if (this.blockExpiration) {
|
||||||
this.$refs.timedBlockDialog.optionallyPrompt()
|
this.$refs.timedBlockDialog.optionallyPrompt()
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('blockUser', { id: this.user.id })
|
this.$store.dispatch('blockUser', { id: this.user.id })
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export const ListsMenuContent = {
|
||||||
...mapPiniaState(useListsStore, {
|
...mapPiniaState(useListsStore, {
|
||||||
lists: getListEntries,
|
lists: getListEntries,
|
||||||
}),
|
}),
|
||||||
...mapPiniaState(useInstanceStore, ['private','federating']),
|
...mapPiniaState(useInstanceStore, ['private', 'federating']),
|
||||||
...mapState({
|
...mapState({
|
||||||
currentUser: (state) => state.users.currentUser,
|
currentUser: (state) => state.users.currentUser,
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import DialogModal from '../dialog_modal/dialog_modal.vue'
|
||||||
import Popover from '../popover/popover.vue'
|
import Popover from '../popover/popover.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { faChevronDown } from '@fortawesome/free-solid-svg-icons'
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
@ -56,7 +57,7 @@ const ModerationTools = {
|
||||||
},
|
},
|
||||||
canUseTagPolicy() {
|
canUseTagPolicy() {
|
||||||
return (
|
return (
|
||||||
useInstanceStore().featureSet.tagPolicyAvailable &&
|
useInstanceCapabilitiesStore().tagPolicyAvailable &&
|
||||||
this.privileged('users_manage_tags')
|
this.privileged('users_manage_tags')
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import NavigationPins from 'src/components/navigation/navigation_pins.vue'
|
||||||
|
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
|
@ -112,14 +113,14 @@ const NavPanel = {
|
||||||
unreadAnnouncementCount: 'unreadAnnouncementCount',
|
unreadAnnouncementCount: 'unreadAnnouncementCount',
|
||||||
supportsAnnouncements: (store) => store.supportsAnnouncements,
|
supportsAnnouncements: (store) => store.supportsAnnouncements,
|
||||||
}),
|
}),
|
||||||
|
...mapPiniaState(useInstanceCapabilitiesStore, [
|
||||||
|
'pleromaChatMessagesAvailable',
|
||||||
|
'pleromaBookmarkFoldersAvailable',
|
||||||
|
'localBubble',
|
||||||
|
]),
|
||||||
...mapPiniaState(useInstanceStore, ['federating']),
|
...mapPiniaState(useInstanceStore, ['federating']),
|
||||||
...mapPiniaState(useInstanceStore, {
|
...mapPiniaState(useInstanceStore, {
|
||||||
privateMode: (store) => store.private,
|
privateMode: (store) => store.private,
|
||||||
pleromaChatMessagesAvailable: (store) =>
|
|
||||||
store.featureSet.pleromaChatMessagesAvailable,
|
|
||||||
bookmarkFolders: (store) =>
|
|
||||||
store.featureSet.pleromaBookmarkFoldersAvailable,
|
|
||||||
bubbleTimeline: (store) => store.featureSet.localBubble,
|
|
||||||
}),
|
}),
|
||||||
...mapPiniaState(useServerSideStorageStore, {
|
...mapPiniaState(useServerSideStorageStore, {
|
||||||
collapsed: (store) => store.prefsStorage.simple.collapseNav,
|
collapsed: (store) => store.prefsStorage.simple.collapseNav,
|
||||||
|
|
@ -142,8 +143,8 @@ const NavPanel = {
|
||||||
isFederating: this.federating,
|
isFederating: this.federating,
|
||||||
isPrivate: this.privateMode,
|
isPrivate: this.privateMode,
|
||||||
currentUser: this.currentUser,
|
currentUser: this.currentUser,
|
||||||
supportsBubbleTimeline: this.bubbleTimeline,
|
supportsBubbleTimeline: this.localBubble,
|
||||||
supportsBookmarkFolders: this.bookmarkFolders,
|
supportsBookmarkFolders: this.pleromaBookmarkFoldersAvailable,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
@ -156,8 +157,8 @@ const NavPanel = {
|
||||||
isFederating: this.federating,
|
isFederating: this.federating,
|
||||||
isPrivate: this.privateMode,
|
isPrivate: this.privateMode,
|
||||||
currentUser: this.currentUser,
|
currentUser: this.currentUser,
|
||||||
supportsBubbleTimeline: this.bubbleTimeline,
|
supportsBubbleTimeline: this.localBubble,
|
||||||
supportsBookmarkFolders: this.bookmarkFolders,
|
supportsBookmarkFolders: this.pleromaBookmarkFoldersAvailable,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<NavigationEntry
|
<NavigationEntry
|
||||||
v-if="currentUser && bookmarkFolders"
|
v-if="currentUser && pleromaBookmarkFoldersAvailable"
|
||||||
:show-pin="false"
|
:show-pin="false"
|
||||||
:item="{ icon: 'bookmark', label: 'nav.bookmarks' }"
|
:item="{ icon: 'bookmark', label: 'nav.bookmarks' }"
|
||||||
:aria-expanded="showBookmarkFolders ? 'true' : 'false'"
|
:aria-expanded="showBookmarkFolders ? 'true' : 'false'"
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import StillImage from 'src/components/still-image/still-image.vue'
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||||
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
|
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useListsStore } from 'src/stores/lists'
|
import { useListsStore } from 'src/stores/lists'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
|
|
||||||
|
|
@ -73,12 +74,11 @@ const NavPanel = {
|
||||||
pinnedItems: (store) =>
|
pinnedItems: (store) =>
|
||||||
new Set(store.prefsStorage.collections.pinnedNavItems),
|
new Set(store.prefsStorage.collections.pinnedNavItems),
|
||||||
}),
|
}),
|
||||||
...mapPiniaState(useInstanceStore, {
|
|
||||||
pleromaChatMessagesAvailable: (store) =>
|
|
||||||
store.featureSet.pleromaChatMessagesAvailable,
|
|
||||||
bubbleTimeline: (store) => store.featureSet.localBubble,
|
|
||||||
}),
|
|
||||||
...mapPiniaState(useInstanceStore, ['private', 'federating']),
|
...mapPiniaState(useInstanceStore, ['private', 'federating']),
|
||||||
|
...mapPiniaState(useInstanceCapabilitiesStore, [
|
||||||
|
'pleromaChatMessagesAvailable',
|
||||||
|
'localBubble',
|
||||||
|
]),
|
||||||
...mapState({
|
...mapState({
|
||||||
currentUser: (state) => state.users.currentUser,
|
currentUser: (state) => state.users.currentUser,
|
||||||
followRequestCount: (state) => state.api.followRequests.length,
|
followRequestCount: (state) => state.api.followRequests.length,
|
||||||
|
|
@ -97,13 +97,11 @@ const NavPanel = {
|
||||||
isFederating: this.federating,
|
isFederating: this.federating,
|
||||||
isPrivate: this.private,
|
isPrivate: this.private,
|
||||||
currentUser: this.currentUser,
|
currentUser: this.currentUser,
|
||||||
supportsBubbleTimeline: this.bubbleTimeline,
|
supportsBubbleTimeline: this.localBubble,
|
||||||
supportsBookmarkFolders: this.bookmarks,
|
supportsBookmarkFolders: this.bookmarks,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
console.log([...this.pinnedItems])
|
|
||||||
console.log([...this.bookmarks])
|
|
||||||
return filterNavigation(
|
return filterNavigation(
|
||||||
[
|
[
|
||||||
...Object.entries({ ...TIMELINES })
|
...Object.entries({ ...TIMELINES })
|
||||||
|
|
@ -118,7 +116,7 @@ const NavPanel = {
|
||||||
{
|
{
|
||||||
hasChats: this.pleromaChatMessagesAvailable,
|
hasChats: this.pleromaChatMessagesAvailable,
|
||||||
hasAnnouncements: this.supportsAnnouncements,
|
hasAnnouncements: this.supportsAnnouncements,
|
||||||
supportsBubbleTimeline: this.bubbleTimeline,
|
supportsBubbleTimeline: this.localBubble,
|
||||||
supportsBookmarkFolders: this.bookmarks,
|
supportsBookmarkFolders: this.bookmarks,
|
||||||
isFederating: this.federating,
|
isFederating: this.federating,
|
||||||
isPrivate: this.private,
|
isPrivate: this.private,
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import StatusContent from '../status_content/status_content.vue'
|
||||||
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useMediaViewerStore } from 'src/stores/media_viewer.js'
|
import { useMediaViewerStore } from 'src/stores/media_viewer.js'
|
||||||
|
|
||||||
|
|
@ -309,14 +310,14 @@ const PostStatusForm = {
|
||||||
return this.mergedConfig.alwaysShowSubjectInput
|
return this.mergedConfig.alwaysShowSubjectInput
|
||||||
},
|
},
|
||||||
postFormats() {
|
postFormats() {
|
||||||
return useInstanceStore().featureSet.postFormats || []
|
return useInstanceCapabilitiesStore().postFormats || []
|
||||||
},
|
},
|
||||||
safeDMEnabled() {
|
safeDMEnabled() {
|
||||||
return useInstanceStore().featureSet.safeDM
|
return useInstanceCapabilitiesStore().safeDM
|
||||||
},
|
},
|
||||||
pollsAvailable() {
|
pollsAvailable() {
|
||||||
return (
|
return (
|
||||||
useInstanceStore().featureSet.pollsAvailable &&
|
useInstanceCapabilitiesStore().pollsAvailable &&
|
||||||
useInstanceStore().limits.pollLimits.max_options >= 2 &&
|
useInstanceStore().limits.pollLimits.max_options >= 2 &&
|
||||||
this.disablePolls !== true
|
this.disablePolls !== true
|
||||||
)
|
)
|
||||||
|
|
@ -346,7 +347,7 @@ const PostStatusForm = {
|
||||||
return typeof this.statusId !== 'undefined' && this.statusId.trim() !== ''
|
return typeof this.statusId !== 'undefined' && this.statusId.trim() !== ''
|
||||||
},
|
},
|
||||||
quotable() {
|
quotable() {
|
||||||
if (!useInstanceStore().featureSet.quotingAvailable) {
|
if (!useInstanceCapabilitiesStore().quotingAvailable) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
description: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
path: {
|
path: {
|
||||||
type: [String, Array],
|
type: [String, Array],
|
||||||
required: false,
|
required: false,
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,6 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
parentCollapsed: {
|
|
||||||
required: false,
|
|
||||||
type: Boolean,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -202,7 +197,7 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
role="tabpanel"
|
role="tabpanel"
|
||||||
class={'contents' + (this.scrollableTabs ? ' scrollable-tabs' : '')}
|
class="contents"
|
||||||
v-body-scroll-lock={this.bodyScrollLock}
|
v-body-scroll-lock={this.bodyScrollLock}
|
||||||
ref="contents"
|
ref="contents"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
ref="tabSwitcher"
|
ref="tabSwitcher"
|
||||||
class="settings_tab-switcher"
|
class="settings_tab-switcher"
|
||||||
:scrollable-tabs="true"
|
:scrollable-tabs="true"
|
||||||
:child-collapsed="childCollapsed"
|
|
||||||
:body-scroll-lock="bodyLock"
|
:body-scroll-lock="bodyLock"
|
||||||
:hide-header="navHideHeader"
|
:hide-header="navHideHeader"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import UnitSetting from '../helpers/unit_setting.vue'
|
import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
|
|
||||||
const ClutterTab = {
|
const ClutterTab = {
|
||||||
|
|
@ -25,14 +26,18 @@ const ClutterTab = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject(),
|
||||||
|
...mapState(useInstanceCapabilitiesStore, ['shoutAvailable']),
|
||||||
|
...mapState(useInstanceStore, {
|
||||||
|
showFeaturesPanel: (store) => store.instanceIdentity.showFeaturesPanel,
|
||||||
|
instanceSpecificPanelPresent: (store) =>
|
||||||
|
store.instanceIdentity.showInstanceSpecificPanel &&
|
||||||
|
store.instanceIdentity.instanceSpecificPanelContent,
|
||||||
|
}),
|
||||||
...mapState(useServerSideStorageStore, {
|
...mapState(useServerSideStorageStore, {
|
||||||
muteFilters: (store) =>
|
muteFilters: (store) =>
|
||||||
Object.entries(store.prefsStorage.simple.muteFilters),
|
Object.entries(store.prefsStorage.simple.muteFilters),
|
||||||
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
||||||
}),
|
}),
|
||||||
...mapState(useInstanceStore, {
|
|
||||||
blockExpirationSupported: (store) => store.featureSet.blockExpiration,
|
|
||||||
}),
|
|
||||||
onMuteDefaultActionLv1: {
|
onMuteDefaultActionLv1: {
|
||||||
get() {
|
get() {
|
||||||
const value = this.$store.state.config.onMuteDefaultAction
|
const value = this.$store.state.config.onMuteDefaultAction
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,11 @@
|
||||||
{{ $t('settings.hide_scrobbles_after') }}
|
{{ $t('settings.hide_scrobbles_after') }}
|
||||||
</UnitSetting>
|
</UnitSetting>
|
||||||
</li>
|
</li>
|
||||||
|
<li v-if="instanceSpecificPanelPresent">
|
||||||
|
<BooleanSetting path="hideISP">
|
||||||
|
{{ $t('settings.hide_isp') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -73,7 +78,7 @@
|
||||||
{{ $t('settings.user_card_hide_personal_marks') }}
|
{{ $t('settings.user_card_hide_personal_marks') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="instanceShoutboxPresent">
|
<li v-if="shoutAvailable">
|
||||||
<BooleanSetting
|
<BooleanSetting
|
||||||
path="hideShoutbox"
|
path="hideShoutbox"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'pinia'
|
||||||
|
|
||||||
import FontControl from 'src/components/font_control/font_control.vue'
|
import FontControl from 'src/components/font_control/font_control.vue'
|
||||||
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
|
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
|
||||||
|
|
@ -29,12 +29,6 @@ import {
|
||||||
library.add(faGlobe, faMessage, faPenAlt, faDatabase, faSliders)
|
library.add(faGlobe, faMessage, faPenAlt, faDatabase, faSliders)
|
||||||
|
|
||||||
const ComposingTab = {
|
const ComposingTab = {
|
||||||
props: {
|
|
||||||
parentCollapsed: {
|
|
||||||
required: true,
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
subjectLineOptions: ['email', 'noop', 'masto'].map((mode) => ({
|
subjectLineOptions: ['email', 'noop', 'masto'].map((mode) => ({
|
||||||
|
|
@ -132,9 +126,7 @@ const ComposingTab = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject(),
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceStore, ['blockExpiration']),
|
||||||
blockExpirationSupported: (store) => store.featureSet.blockExpiration,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeDefaultScope(value) {
|
changeDefaultScope(value) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import IntegerSetting from '../helpers/integer_setting.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import UnitSetting from '../helpers/unit_setting.vue'
|
import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
|
|
||||||
|
|
@ -97,9 +97,7 @@ const FilteringTab = {
|
||||||
Object.entries(store.prefsStorage.simple.muteFilters),
|
Object.entries(store.prefsStorage.simple.muteFilters),
|
||||||
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
||||||
}),
|
}),
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceCapabilitiesStore, ['blockExpiration']),
|
||||||
blockExpirationSupported: (store) => store.featureSet.blockExpiration,
|
|
||||||
}),
|
|
||||||
onMuteDefaultActionLv1: {
|
onMuteDefaultActionLv1: {
|
||||||
get() {
|
get() {
|
||||||
const value = this.$store.state.config.onMuteDefaultAction
|
const value = this.$store.state.config.onMuteDefaultAction
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="blockExpirationSupported">
|
<li v-if="blockExpiration">
|
||||||
<span class="setting-item">
|
<span class="setting-item">
|
||||||
<span class="setting-label">
|
<span class="setting-label">
|
||||||
{{ $t('user_card.default_block_expiration') }}
|
{{ $t('user_card.default_block_expiration') }}
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,11 @@ import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import UnitSetting from '../helpers/unit_setting.vue'
|
import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
import localeService from 'src/services/locale/locale.service.js'
|
import localeService from 'src/services/locale/locale.service.js'
|
||||||
|
|
||||||
const GeneralTab = {
|
const GeneralTab = {
|
||||||
props: {
|
|
||||||
parentCollapsed: {
|
|
||||||
required: true,
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
absoluteTime12hOptions: ['24h', '12h'].map((mode) => ({
|
absoluteTime12hOptions: ['24h', '12h'].map((mode) => ({
|
||||||
|
|
@ -52,9 +47,7 @@ const GeneralTab = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject(),
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceCapabilitiesStore, ['blockExpiration']),
|
||||||
blockExpirationSupported: (store) => store.featureSet.blockExpiration,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateProfile() {
|
updateProfile() {
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li
|
||||||
v-if="!blockExpirationSupported"
|
v-if="!blockExpiration"
|
||||||
>
|
>
|
||||||
<BooleanSetting
|
<BooleanSetting
|
||||||
path="modalOnBlock"
|
path="modalOnBlock"
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,9 @@ import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import UnitSetting from '../helpers/unit_setting.vue'
|
import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
const GeneralTab = {
|
const GeneralTab = {
|
||||||
props: {
|
|
||||||
parentCollapsed: {
|
|
||||||
required: true,
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
thirdColumnModeOptions: ['none', 'notifications', 'postform'].map(
|
thirdColumnModeOptions: ['none', 'notifications', 'postform'].map(
|
||||||
|
|
@ -33,12 +27,10 @@ const GeneralTab = {
|
||||||
ProfileSettingIndicator,
|
ProfileSettingIndicator,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceCapabilitiesStore, [
|
||||||
postFormats: (store) => store.featureSet.postFormats || [],
|
'postFormats',
|
||||||
instanceSpecificPanelPresent: (store) =>
|
'suggestionsEnabled',
|
||||||
store.instanceIdentity.instanceSpecificPanelPresent,
|
]),
|
||||||
instanceShoutboxPresent: (store) => store.featureSet.shoutAvailable,
|
|
||||||
}),
|
|
||||||
columns() {
|
columns() {
|
||||||
const mode = this.$store.getters.mergedConfig.thirdColumnMode
|
const mode = this.$store.getters.mergedConfig.thirdColumnMode
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,11 +69,6 @@
|
||||||
{{ $t('settings.show_scrollbars') }}
|
{{ $t('settings.show_scrollbars') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="instanceSpecificPanelPresent">
|
|
||||||
<BooleanSetting path="hideISP">
|
|
||||||
{{ $t('settings.hide_isp') }}
|
|
||||||
</BooleanSetting>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<UnitSetting
|
<UnitSetting
|
||||||
path="panelHeaderSize"
|
path="panelHeaderSize"
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ const MutesAndBlocks = {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
useOAuthTokensStore().fetchTokens()
|
useOAuthTokensStore().fetchTokens()
|
||||||
this.$store.dispatch('getKnownDomains')
|
useInstanceStore().getKnownDomains()
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
TabSwitcher,
|
TabSwitcher,
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,6 @@ import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
|
|
||||||
const GeneralTab = {
|
const GeneralTab = {
|
||||||
props: {
|
|
||||||
parentCollapsed: {
|
|
||||||
required: true,
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
conversationDisplayOptions: ['tree', 'linear'].map((mode) => ({
|
conversationDisplayOptions: ['tree', 'linear'].map((mode) => ({
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import ProgressButton from 'src/components/progress_button/progress_button.vue'
|
||||||
import Mfa from './mfa.vue'
|
import Mfa from './mfa.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useOAuthTokensStore } from 'src/stores/oauth_tokens'
|
import { useOAuthTokensStore } from 'src/stores/oauth_tokens'
|
||||||
|
|
||||||
import localeService from 'src/services/locale/locale.service.js'
|
import localeService from 'src/services/locale/locale.service.js'
|
||||||
|
|
@ -45,7 +46,7 @@ const SecurityTab = {
|
||||||
return this.$store.state.users.currentUser
|
return this.$store.state.users.currentUser
|
||||||
},
|
},
|
||||||
pleromaExtensionsAvailable() {
|
pleromaExtensionsAvailable() {
|
||||||
return useInstanceStore().featureSet.pleromaExtensionsAvailable
|
return useInstanceCapabilitiesStore().pleromaExtensionsAvailable
|
||||||
},
|
},
|
||||||
oauthTokens() {
|
oauthTokens() {
|
||||||
return useOAuthTokensStore().tokens.map((oauthToken) => {
|
return useOAuthTokensStore().tokens.map((oauthToken) => {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import UserCard from '../user_card/user_card.vue'
|
||||||
|
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
import { useShoutStore } from 'src/stores/shout'
|
import { useShoutStore } from 'src/stores/shout'
|
||||||
|
|
||||||
|
|
@ -95,14 +96,15 @@ const SideDrawer = {
|
||||||
'supportsAnnouncements',
|
'supportsAnnouncements',
|
||||||
'unreadAnnouncementCount',
|
'unreadAnnouncementCount',
|
||||||
]),
|
]),
|
||||||
|
...mapState(useInstanceCapabilitiesStore, [
|
||||||
|
'pleromaChatMessagesAvailable',
|
||||||
|
'suggestionsEnabled',
|
||||||
|
]),
|
||||||
...mapState(useInstanceStore, ['private', 'federating']),
|
...mapState(useInstanceStore, ['private', 'federating']),
|
||||||
...mapState(useInstanceStore, {
|
...mapState(useInstanceStore, {
|
||||||
logo: (store) => store.instanceIdentity.logo,
|
logo: (store) => store.instanceIdentity.logo,
|
||||||
sitename: (store) => store.instanceIdentity.name,
|
sitename: (store) => store.instanceIdentity.name,
|
||||||
hideSitename: (store) => store.instanceIdentity.hideSitename,
|
hideSitename: (store) => store.instanceIdentity.hideSitename,
|
||||||
pleromaChatMessagesAvailable: (store) =>
|
|
||||||
store.featureSet.pleromaChatMessagesAvailable,
|
|
||||||
suggestionsEnabled: (store) => store.featureSet.suggestionsEnabled,
|
|
||||||
}),
|
}),
|
||||||
...mapGetters(['unreadChatCount', 'draftCount']),
|
...mapGetters(['unreadChatCount', 'draftCount']),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import UserListPopover from '../user_list_popover/user_list_popover.vue'
|
||||||
import UserPopover from '../user_popover/user_popover.vue'
|
import UserPopover from '../user_popover/user_popover.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
|
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
|
|
@ -497,7 +498,7 @@ const Status = {
|
||||||
return this.status.edited_at !== null
|
return this.status.edited_at !== null
|
||||||
},
|
},
|
||||||
editingAvailable() {
|
editingAvailable() {
|
||||||
return useInstanceStore().featureSet.editingAvailable
|
return useInstanceCapabilitiesStore().editingAvailable
|
||||||
},
|
},
|
||||||
hasVisibleQuote() {
|
hasVisibleQuote() {
|
||||||
return this.status.quote_url && this.status.quote_visible
|
return this.status.quote_url && this.status.quote_visible
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import Popover from 'src/components/popover/popover.vue'
|
||||||
import StatusBookmarkFolderMenu from 'src/components/status_bookmark_folder_menu/status_bookmark_folder_menu.vue'
|
import StatusBookmarkFolderMenu from 'src/components/status_bookmark_folder_menu/status_bookmark_folder_menu.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
|
|
@ -93,7 +94,7 @@ export default {
|
||||||
return this.status.thread_muted
|
return this.status.thread_muted
|
||||||
},
|
},
|
||||||
hideCustomEmoji() {
|
hideCustomEmoji() {
|
||||||
return !useInstanceStore().pleromaCustomEmojiReactionsAvailable
|
return !useInstanceCapabilitiesStore().pleromaCustomEmojiReactionsAvailable
|
||||||
},
|
},
|
||||||
buttonInnerClass() {
|
buttonInnerClass() {
|
||||||
return [
|
return [
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useEditStatusStore } from 'src/stores/editStatus.js'
|
import { useEditStatusStore } from 'src/stores/editStatus.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useReportsStore } from 'src/stores/reports.js'
|
import { useReportsStore } from 'src/stores/reports.js'
|
||||||
import { useStatusHistoryStore } from 'src/stores/statusHistory.js'
|
import { useStatusHistoryStore } from 'src/stores/statusHistory.js'
|
||||||
|
|
||||||
|
|
@ -161,7 +162,7 @@ export const BUTTONS = [
|
||||||
label: 'status.status_history',
|
label: 'status.status_history',
|
||||||
if({ status, state }) {
|
if({ status, state }) {
|
||||||
return (
|
return (
|
||||||
useInstanceStore().featureSet.editingAvailable &&
|
useInstanceCapabilitiesStore().editingAvailable &&
|
||||||
status.edited_at !== null
|
status.edited_at !== null
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
@ -193,7 +194,7 @@ export const BUTTONS = [
|
||||||
if({ status, loggedIn, currentUser, state }) {
|
if({ status, loggedIn, currentUser, state }) {
|
||||||
return (
|
return (
|
||||||
loggedIn &&
|
loggedIn &&
|
||||||
useInstanceStore().featureSet.editingAvailable &&
|
useInstanceCapabilitiesStore().editingAvailable &&
|
||||||
status.user.id === currentUser.id
|
status.user.id === currentUser.id
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import Popover from '../popover/popover.vue'
|
||||||
|
|
||||||
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
|
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
import { useListsStore } from 'src/stores/lists'
|
import { useListsStore } from 'src/stores/lists'
|
||||||
|
|
||||||
|
|
@ -61,14 +62,13 @@ const TimelineMenu = {
|
||||||
(route === 'bookmark-folder' || route === 'bookmarks')
|
(route === 'bookmark-folder' || route === 'bookmarks')
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
...mapPiniaState(useInstanceCapabilitiesStore, [
|
||||||
|
'pleromaChatMessagesAvailable',
|
||||||
|
'pleromaBookmarkFoldersAvailable',
|
||||||
|
'bookmarkFolders',
|
||||||
|
'localBubble',
|
||||||
|
]),
|
||||||
...mapPiniaState(useInstanceStore, ['private', 'federating']),
|
...mapPiniaState(useInstanceStore, ['private', 'federating']),
|
||||||
...mapPiniaState(useInstanceStore, {
|
|
||||||
pleromaChatMessagesAvailable: (store) =>
|
|
||||||
store.featureSet.pleromaChatMessagesAvailable,
|
|
||||||
bookmarkFolders: (store) =>
|
|
||||||
store.featureSet.pleromaBookmarkFoldersAvailable,
|
|
||||||
bubbleTimeline: (store) => store.featureSet.localBubble,
|
|
||||||
}),
|
|
||||||
...mapState({
|
...mapState({
|
||||||
currentUser: (state) => state.users.currentUser,
|
currentUser: (state) => state.users.currentUser,
|
||||||
}),
|
}),
|
||||||
|
|
@ -80,8 +80,8 @@ const TimelineMenu = {
|
||||||
isFederating: this.federating,
|
isFederating: this.federating,
|
||||||
isPrivate: this.private,
|
isPrivate: this.private,
|
||||||
currentUser: this.currentUser,
|
currentUser: this.currentUser,
|
||||||
supportsBookmarkFolders: this.bookmarkFolders,
|
supportsBookmarkFolders: this.pleromaBookmarkFoldersAvailable,
|
||||||
supportsBubbleTimeline: this.bubbleTimeline,
|
supportsBubbleTimeline: this.localBubble,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import UserNote from '../user_note/user_note.vue'
|
||||||
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { usePostStatusStore } from 'src/stores/post_status'
|
import { usePostStatusStore } from 'src/stores/post_status'
|
||||||
|
|
||||||
import { propsToNative } from 'src/services/attributes_helper/attributes_helper.service.js'
|
import { propsToNative } from 'src/services/attributes_helper/attributes_helper.service.js'
|
||||||
|
|
@ -180,7 +181,7 @@ export default {
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
groupActorAvailable() {
|
groupActorAvailable() {
|
||||||
return useInstanceStore().featureSet.groupActorAvailable
|
return useInstanceCapabilitiesStore().groupActorAvailable
|
||||||
},
|
},
|
||||||
availableActorTypes() {
|
availableActorTypes() {
|
||||||
return this.groupActorAvailable
|
return this.groupActorAvailable
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import Timeline from '../timeline/timeline.vue'
|
||||||
import UserCard from '../user_card/user_card.vue'
|
import UserCard from '../user_card/user_card.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
|
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
@ -89,7 +90,7 @@ const UserProfile = {
|
||||||
favoritesTabVisible() {
|
favoritesTabVisible() {
|
||||||
return (
|
return (
|
||||||
this.isUs ||
|
this.isUs ||
|
||||||
(useInstanceStore().featureSet.pleromaPublicFavouritesAvailable &&
|
(useInstanceCapabilitiesStore().pleromaPublicFavouritesAvailable &&
|
||||||
!this.user.hide_favorites)
|
!this.user.hide_favorites)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { shuffle } from 'lodash'
|
||||||
import apiService from '../../services/api/api.service.js'
|
import apiService from '../../services/api/api.service.js'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
|
|
||||||
|
|
@ -49,7 +50,7 @@ const WhoToFollowPanel = {
|
||||||
return this.$store.state.users.currentUser.screen_name
|
return this.$store.state.users.currentUser.screen_name
|
||||||
},
|
},
|
||||||
suggestionsEnabled() {
|
suggestionsEnabled() {
|
||||||
return useInstanceStore().featureSet.suggestionsEnabled
|
return useInstanceCapabilitiesStore().suggestionsEnabled
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import backendInteractorService from '../services/backend_interactor_service/bac
|
||||||
import { maybeShowChatNotification } from '../services/chat_utils/chat_utils.js'
|
import { maybeShowChatNotification } from '../services/chat_utils/chat_utils.js'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useShoutStore } from 'src/stores/shout.js'
|
import { useShoutStore } from 'src/stores/shout.js'
|
||||||
|
|
||||||
|
|
@ -239,7 +240,7 @@ const api = {
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
timeline === 'favourites' &&
|
timeline === 'favourites' &&
|
||||||
!useInstanceStore().featureSet.pleromaPublicFavouritesAvailable
|
!useInstanceCapabilitiesStore().pleromaPublicFavouritesAvailable
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
if (store.state.fetchers[timeline]) return
|
if (store.state.fetchers[timeline]) return
|
||||||
|
|
@ -324,7 +325,8 @@ const api = {
|
||||||
// Bookmark folders
|
// Bookmark folders
|
||||||
startFetchingBookmarkFolders(store) {
|
startFetchingBookmarkFolders(store) {
|
||||||
if (store.state.fetchers.bookmarkFolders) return
|
if (store.state.fetchers.bookmarkFolders) return
|
||||||
if (!useInstanceStore().featureSet.pleromaBookmarkFoldersAvailable) return
|
if (!useInstanceCapabilitiesStore().pleromaBookmarkFoldersAvailable)
|
||||||
|
return
|
||||||
const fetcher =
|
const fetcher =
|
||||||
store.state.backendInteractor.startFetchingBookmarkFolders({ store })
|
store.state.backendInteractor.startFetchingBookmarkFolders({ store })
|
||||||
store.commit('addFetcher', { fetcherName: 'bookmarkFolders', fetcher })
|
store.commit('addFetcher', { fetcherName: 'bookmarkFolders', fetcher })
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ const config = {
|
||||||
},
|
},
|
||||||
mergedConfig(state) {
|
mergedConfig(state) {
|
||||||
const instancePrefs = useInstanceStore().prefsStorage
|
const instancePrefs = useInstanceStore().prefsStorage
|
||||||
console.log(state)
|
|
||||||
const result = Object.fromEntries(
|
const result = Object.fromEntries(
|
||||||
Object.keys(defaultState).map((key) => [
|
Object.keys(defaultState).map((key) => [
|
||||||
key,
|
key,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import {
|
||||||
|
|
||||||
import apiService from '../services/api/api.service.js'
|
import apiService from '../services/api/api.service.js'
|
||||||
|
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
|
||||||
const emptyTl = (userId = 0) => ({
|
const emptyTl = (userId = 0) => ({
|
||||||
|
|
@ -41,7 +42,6 @@ export const defaultState = () => ({
|
||||||
conversationsObject: {},
|
conversationsObject: {},
|
||||||
maxId: 0,
|
maxId: 0,
|
||||||
favorites: new Set(),
|
favorites: new Set(),
|
||||||
pleromaScrobblesAvailable: true, // not reported in nodeinfo
|
|
||||||
timelines: {
|
timelines: {
|
||||||
mentions: emptyTl(),
|
mentions: emptyTl(),
|
||||||
public: emptyTl(),
|
public: emptyTl(),
|
||||||
|
|
@ -115,7 +115,8 @@ const sortTimeline = (timeline) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getLatestScrobble = (state, user) => {
|
const getLatestScrobble = (state, user) => {
|
||||||
const scrobblesSupport = state.pleromaScrobblesAvailable
|
const scrobblesSupport =
|
||||||
|
useInstanceCapabilitiesStore().pleromaScrobblesAvailable
|
||||||
|
|
||||||
if (!scrobblesSupport || !user.name || user.id === 'undefined') {
|
if (!scrobblesSupport || !user.name || user.id === 'undefined') {
|
||||||
return
|
return
|
||||||
|
|
@ -134,7 +135,7 @@ const getLatestScrobble = (state, user) => {
|
||||||
.fetchScrobbles({ accountId: user.id })
|
.fetchScrobbles({ accountId: user.id })
|
||||||
.then((scrobbles) => {
|
.then((scrobbles) => {
|
||||||
if (scrobbles?.error) {
|
if (scrobbles?.error) {
|
||||||
state.pleromaScrobblesAvailable = false
|
useInstanceCapabilitiesStore().set('pleromaScrobblesAvailable', false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import {
|
||||||
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
|
|
@ -766,7 +767,7 @@ const users = {
|
||||||
dispatch('startFetchingNotifications')
|
dispatch('startFetchingNotifications')
|
||||||
|
|
||||||
if (
|
if (
|
||||||
useInstanceStore().featureSet.pleromaChatMessagesAvailable
|
useInstanceCapabilitiesStore().pleromaChatMessagesAvailable
|
||||||
) {
|
) {
|
||||||
// Start fetching chats
|
// Start fetching chats
|
||||||
dispatch('startFetchingChats')
|
dispatch('startFetchingChats')
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import apiService from '../api/api.service.js'
|
||||||
import { promiseInterval } from '../promise_interval/promise_interval.js'
|
import { promiseInterval } from '../promise_interval/promise_interval.js'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
|
||||||
const update = ({ store, notifications, older }) => {
|
const update = ({ store, notifications, older }) => {
|
||||||
|
|
@ -30,7 +31,7 @@ const fetchAndUpdate = ({ store, credentials, older = false, since }) => {
|
||||||
const timelineData = rootState.notifications
|
const timelineData = rootState.notifications
|
||||||
const hideMutedPosts = getters.mergedConfig.hideMutedPosts
|
const hideMutedPosts = getters.mergedConfig.hideMutedPosts
|
||||||
|
|
||||||
if (useInstanceStore().featureSet.pleromaChatMessagesAvailable) {
|
if (useInstanceCapabilitiesStore().pleromaChatMessagesAvailable) {
|
||||||
mastoApiNotificationTypes.add('pleroma:chat_mention')
|
mastoApiNotificationTypes.add('pleroma:chat_mention')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import apiService from '../api/api.service.js'
|
||||||
import { promiseInterval } from '../promise_interval/promise_interval.js'
|
import { promiseInterval } from '../promise_interval/promise_interval.js'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
|
||||||
const update = ({
|
const update = ({
|
||||||
|
|
@ -78,7 +79,7 @@ const fetchAndUpdate = ({
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.errors) {
|
if (response.errors) {
|
||||||
if (timeline === 'favorites') {
|
if (timeline === 'favorites') {
|
||||||
useInstanceStore().featureSet.pleromaPublicFavouritesAvailable = false
|
useInstanceCapabilitiesStore().pleromaPublicFavouritesAvailable = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
throw new Error(`${response.status} ${response.statusText}`)
|
throw new Error(`${response.status} ${response.statusText}`)
|
||||||
|
|
|
||||||
|
|
@ -69,31 +69,6 @@ const defaultState = {
|
||||||
restrictedNicknames: [],
|
restrictedNicknames: [],
|
||||||
localBubbleInstances: [], // Akkoma
|
localBubbleInstances: [], // Akkoma
|
||||||
|
|
||||||
// Feature-set, apparently, not everything here is reported...
|
|
||||||
featureSet: {
|
|
||||||
postFormats: [],
|
|
||||||
mailerEnabled: false,
|
|
||||||
safeDM: true,
|
|
||||||
shoutAvailable: false,
|
|
||||||
pleromaExtensionsAvailable: true,
|
|
||||||
pleromaChatMessagesAvailable: false,
|
|
||||||
pleromaCustomEmojiReactionsAvailable: false,
|
|
||||||
pleromaBookmarkFoldersAvailable: false,
|
|
||||||
pleromaPublicFavouritesAvailable: true,
|
|
||||||
statusNotificationTypeAvailable: true,
|
|
||||||
gopherAvailable: false,
|
|
||||||
editingAvailable: false,
|
|
||||||
mediaProxyAvailable: false,
|
|
||||||
suggestionsEnabled: false,
|
|
||||||
suggestionsWeb: '',
|
|
||||||
quotingAvailable: false,
|
|
||||||
groupActorAvailable: false,
|
|
||||||
blockExpiration: false,
|
|
||||||
tagPolicyAvailable: false,
|
|
||||||
pollsAvailable: false,
|
|
||||||
localBubble: false, // Akkoma
|
|
||||||
},
|
|
||||||
|
|
||||||
// Version Information
|
// Version Information
|
||||||
backendVersion: '',
|
backendVersion: '',
|
||||||
backendRepository: '',
|
backendRepository: '',
|
||||||
|
|
@ -118,17 +93,10 @@ export const useInstanceStore = defineStore('instance', {
|
||||||
console.error(
|
console.error(
|
||||||
`Unknown instance option ${path ?? name}, value: ${value}`,
|
`Unknown instance option ${path ?? name}, value: ${value}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
set(this, path ?? name, value)
|
set(this, path ?? name, value)
|
||||||
switch (name) {
|
|
||||||
case 'name':
|
if ((path ?? name) === 'name') useInterfaceStore().setPageTitle()
|
||||||
useInterfaceStore().setPageTitle()
|
|
||||||
break
|
|
||||||
case 'shoutAvailable':
|
|
||||||
if (value) {
|
|
||||||
window.vuex.dispatch('initializeSocket')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async getKnownDomains() {
|
async getKnownDomains() {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
48
src/stores/instance_capabilities.js
Normal file
48
src/stores/instance_capabilities.js
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
|
const defaultState = {
|
||||||
|
postFormats: [],
|
||||||
|
mailerEnabled: false,
|
||||||
|
safeDM: true,
|
||||||
|
shoutAvailable: false,
|
||||||
|
pleromaExtensionsAvailable: true,
|
||||||
|
pleromaChatMessagesAvailable: false,
|
||||||
|
pleromaCustomEmojiReactionsAvailable: false,
|
||||||
|
pleromaBookmarkFoldersAvailable: false,
|
||||||
|
pleromaPublicFavouritesAvailable: true,
|
||||||
|
statusNotificationTypeAvailable: true,
|
||||||
|
gopherAvailable: false,
|
||||||
|
editingAvailable: false,
|
||||||
|
mediaProxyAvailable: false,
|
||||||
|
suggestionsEnabled: false,
|
||||||
|
suggestionsWeb: '',
|
||||||
|
quotingAvailable: false,
|
||||||
|
groupActorAvailable: false,
|
||||||
|
blockExpiration: false,
|
||||||
|
tagPolicyAvailable: false,
|
||||||
|
pollsAvailable: false,
|
||||||
|
localBubble: false, // Akkoma
|
||||||
|
scrobblesSupport: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useInstanceCapabilitiesStore = defineStore(
|
||||||
|
'instance-capabilities',
|
||||||
|
{
|
||||||
|
state: () => ({ ...defaultState }),
|
||||||
|
actions: {
|
||||||
|
set(capability, value) {
|
||||||
|
if (!Object.hasOwn(defaultState, capability)) {
|
||||||
|
console.error(
|
||||||
|
`Unknown instance capability ${capability}, value: ${value}`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
this[capability] = value
|
||||||
|
|
||||||
|
if (capability === 'shoutAvailable') {
|
||||||
|
window.vuex.dispatch('initializeSocket')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue