Compare commits

...

13 commits

Author SHA1 Message Date
Henry Jameson
980917a16f Merge remote-tracking branch 'origin/develop' into shigusegubu-themes3 2025-06-29 16:40:54 +03:00
HJ
d72438f0a7 Merge branch 'akkoma-support-part-2' into 'develop'
better error handling

See merge request pleroma/pleroma-fe!2193
2025-06-29 12:24:44 +00:00
Henry Jameson
e66b1edcf4 better error handling 2025-06-29 15:24:04 +03:00
HJ
389ca8e151 Merge branch 'akkoma-support-part-2' into 'develop'
fix infinite loop

See merge request pleroma/pleroma-fe!2192
2025-06-29 00:19:19 +00:00
Henry Jameson
114257359c fix infinite loop 2025-06-29 03:18:09 +03:00
HJ
ea519c0cf3 Merge branch 'akkoma-support-part-2' into 'develop'
handle akkoma not supporting status notification type

See merge request pleroma/pleroma-fe!2191
2025-06-28 23:52:42 +00:00
Henry Jameson
4b5e6804a9 handle akkoma not supporting status notification type 2025-06-29 02:49:35 +03:00
HJ
5dc0048eac Merge branch 'akkoma-support-part-2' into 'develop'
custom emoji reactions feature check for akkoma

See merge request pleroma/pleroma-fe!2190
2025-06-28 22:49:59 +00:00
Henry Jameson
c5c27a2167 custom emoji reactions feature check for akkoma 2025-06-29 01:49:07 +03:00
HJ
917d0b5b23 Merge branch 'akkoma-support-part-2' into 'develop'
microfix

See merge request pleroma/pleroma-fe!2189
2025-06-28 22:11:15 +00:00
Henry Jameson
cf9c91dd02 microfix 2025-06-29 01:09:59 +03:00
HJ
79f4e44028 Merge branch 'akkoma-support-part-2' into 'develop'
oops

See merge request pleroma/pleroma-fe!2188
2025-06-28 19:47:17 +00:00
HJ
466ff72067 Merge branch 'akkoma-support-part-2' into 'develop'
Akkoma support part 2

See merge request pleroma/pleroma-fe!2187
2025-06-28 19:25:06 +00:00
4 changed files with 37 additions and 19 deletions

View file

@ -260,7 +260,12 @@ const getNodeInfo = async ({ store }) => {
store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') })
store.dispatch('setInstanceOption', { name: 'shoutAvailable', value: features.includes('chat') })
store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') })
store.dispatch('setInstanceOption', { name: 'pleromaCustomEmojiReactionsAvailable', value: features.includes('pleroma_custom_emoji_reactions') })
store.dispatch('setInstanceOption', {
name: 'pleromaCustomEmojiReactionsAvailable',
value:
features.includes('pleroma_custom_emoji_reactions') ||
features.includes('custom_emoji_reactions')
})
store.dispatch('setInstanceOption', { name: 'pleromaBookmarkFoldersAvailable', value: features.includes('pleroma:bookmark_folders') })
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })

View file

@ -157,6 +157,7 @@ const defaultState = {
pleromaCustomEmojiReactionsAvailable: false,
pleromaBookmarkFoldersAvailable: false,
pleromaPublicFavouritesAvailable: true,
statusNotificationTypeAvailable: true,
gopherAvailable: false,
mediaProxyAvailable: false,
suggestionsEnabled: false,

View file

@ -759,7 +759,7 @@ const fetchTimeline = ({
if (replyVisibility !== 'all') {
params.push(['reply_visibility', replyVisibility])
}
if (includeTypes.length > 0) {
if (includeTypes.size > 0) {
includeTypes.forEach(type => {
params.push(['include_types[]', type])
})

View file

@ -5,22 +5,24 @@ import { promiseInterval } from '../promise_interval/promise_interval.js'
const update = ({ store, notifications, older }) => {
store.dispatch('addNewNotifications', { notifications, older })
}
//
// For using include_types when fetching notifications.
// Note: chat_mention excluded as pleroma-fe polls them separately
const mastoApiNotificationTypes = new Set([
'mention',
'status',
'favourite',
'reblog',
'follow',
'follow_request',
'move',
'poll',
'pleroma:emoji_reaction',
'pleroma:report',
'test'
])
const fetchAndUpdate = ({ store, credentials, older = false, since }) => {
// For using include_types when fetching notifications.
// Note: chat_mention excluded as pleroma-fe polls them separately
const mastoApiNotificationTypes = [
'mention',
'status',
'favourite',
'reblog',
'follow',
'follow_request',
'move',
'poll',
'pleroma:emoji_reaction',
'pleroma:report'
]
const args = { credentials }
const { getters } = store
@ -28,8 +30,8 @@ const fetchAndUpdate = ({ store, credentials, older = false, since }) => {
const timelineData = rootState.notifications
const hideMutedPosts = getters.mergedConfig.hideMutedPosts
if (store.rootState.instance.pleromaChatMessagesAvailable) {
mastoApiNotificationTypes.push('pleroma:chat_mention')
if (rootState.instance.pleromaChatMessagesAvailable) {
mastoApiNotificationTypes.add('pleroma:chat_mention')
}
args.includeTypes = mastoApiNotificationTypes
@ -75,7 +77,17 @@ const fetchNotifications = ({ store, args, older }) => {
return apiService.fetchTimeline(args)
.then((response) => {
if (response.errors) {
throw new Error(`${response.status} ${response.statusText}`)
if (response.status === 400 && response.statusText.includes('Invalid value for enum')) {
response
.statusText
.matchAll(/(\w+) - Invalid value for enum./g)
.toArray()
.map(x => x[1])
.forEach(x => mastoApiNotificationTypes.delete(x))
return fetchNotifications({ store, args, older })
} else {
throw new Error(`${response.status} ${response.statusText}`)
}
}
const notifications = response.data
update({ store, notifications, older })