Compare commits

...

3 Commits

Author SHA1 Message Date
lamp 18be86a8db :/ 2025-10-14 16:25:01 -07:00
lamp 589d8ea29f Merge remote-tracking branch 'upstream/stable' into public-favorites 2025-10-14 14:45:50 -07:00
lamp 4d91a7b2c3 Fix public favorites
Show favorites tab to anyone when "Don't show list of my favorites" is unchecked.

Adapted from upstream changes by marcin mikołajczak <git@mkljczk.pl>:
https://git.pleroma.social/pleroma/pleroma-fe/-/commit/6f452d672fe740035cf1d29d03bcda0d39438753?merge_request_iid=1883
https://git.pleroma.social/pleroma/pleroma-fe/-/commit/1ceffb4e713b4b20d70121fba92d2b50f2d3cadf?merge_request_iid=1908
2024-05-06 17:55:10 -07:00
5 changed files with 16 additions and 5 deletions
+9 -2
View File
@@ -97,6 +97,9 @@ const UserProfile = {
followersTabVisible () { followersTabVisible () {
return this.isUs || !this.user.hide_followers return this.isUs || !this.user.hide_followers
}, },
favoritesTabVisible () {
return this.isUs || !this.user.hide_favorites
},
currentUser () { currentUser () {
return this.$store.state.users.currentUser return this.$store.state.users.currentUser
}, },
@@ -114,8 +117,12 @@ const UserProfile = {
replies: 'replies', replies: 'replies',
media: 'media' media: 'media'
} }
// only we can see our own favourites
if (this.isUs) timelineTabMap['favorites'] = 'favorites' if (this.isUs) {
timelineTabMap['favorites'] = 'favorites'
} else if (!this.user.hide_favorites) {
timelineTabMap['favorites'] = 'publicFavorites'
}
const timeline = timelineTabMap[nextTab] const timeline = timelineTabMap[nextTab]
+2 -2
View File
@@ -165,14 +165,14 @@
:footer-slipgate="footerRef" :footer-slipgate="footerRef"
/> />
<Timeline <Timeline
v-if="isUs" v-if="favoritesTabVisible"
key="favorites" key="favorites"
:label="$t('user_card.favorites')" :label="$t('user_card.favorites')"
:disabled="!isUs"
:embedded="true" :embedded="true"
:title="$t('user_card.favorites')" :title="$t('user_card.favorites')"
timeline-name="favorites" timeline-name="favorites"
:timeline="favorites" :timeline="favorites"
:user-id="userId"
:in-profile="true" :in-profile="true"
:footer-slipgate="footerRef" :footer-slipgate="footerRef"
/> />
+2 -1
View File
@@ -57,6 +57,7 @@ export const defaultState = () => ({
public: emptyTl(), public: emptyTl(),
user: emptyTl(), user: emptyTl(),
favorites: emptyTl(), favorites: emptyTl(),
publicFavorites: emptyTl(),
media: emptyTl(), media: emptyTl(),
publicAndExternal: emptyTl(), publicAndExternal: emptyTl(),
friends: emptyTl(), friends: emptyTl(),
@@ -314,7 +315,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
}) })
// Keep the visible statuses sorted // Keep the visible statuses sorted
if (timeline && !(['bookmarks', 'favorites'].includes(timeline))) { if (timeline && !(['bookmarks', 'favorites', 'publicFavorites'].includes(timeline))) {
sortTimeline(timelineObject) sortTimeline(timelineObject)
} }
} }
+2
View File
@@ -107,6 +107,7 @@ const PLEROMA_ANNOUNCEMENTS_URL = '/api/v1/pleroma/admin/announcements'
const PLEROMA_POST_ANNOUNCEMENT_URL = '/api/v1/pleroma/admin/announcements' const PLEROMA_POST_ANNOUNCEMENT_URL = '/api/v1/pleroma/admin/announcements'
const PLEROMA_EDIT_ANNOUNCEMENT_URL = id => `/api/v1/pleroma/admin/announcements/${id}` const PLEROMA_EDIT_ANNOUNCEMENT_URL = id => `/api/v1/pleroma/admin/announcements/${id}`
const PLEROMA_DELETE_ANNOUNCEMENT_URL = id => `/api/v1/pleroma/admin/announcements/${id}` const PLEROMA_DELETE_ANNOUNCEMENT_URL = id => `/api/v1/pleroma/admin/announcements/${id}`
const PLEROMA_USER_FAVORITES_TIMELINE_URL = id => `/api/v1/pleroma/accounts/${id}/favourites`
const AKKOMA_SETTING_PROFILE_URL = (name) => `/api/v1/akkoma/frontend_settings/pleroma-fe/${name}` const AKKOMA_SETTING_PROFILE_URL = (name) => `/api/v1/akkoma/frontend_settings/pleroma-fe/${name}`
const AKKOMA_SETTING_PROFILE_LIST = `/api/v1/akkoma/frontend_settings/pleroma-fe` const AKKOMA_SETTING_PROFILE_LIST = `/api/v1/akkoma/frontend_settings/pleroma-fe`
const MASTODON_TAG_URL = (name) => `/api/v1/tags/${name}` const MASTODON_TAG_URL = (name) => `/api/v1/tags/${name}`
@@ -709,6 +710,7 @@ const fetchTimeline = ({
media: MASTODON_USER_TIMELINE_URL, media: MASTODON_USER_TIMELINE_URL,
list: MASTODON_LIST_TIMELINE_URL, list: MASTODON_LIST_TIMELINE_URL,
favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, favorites: MASTODON_USER_FAVORITES_TIMELINE_URL,
publicFavorites: PLEROMA_USER_FAVORITES_TIMELINE_URL,
tag: MASTODON_TAG_TIMELINE_URL, tag: MASTODON_TAG_TIMELINE_URL,
bookmarks: MASTODON_BOOKMARK_TIMELINE_URL bookmarks: MASTODON_BOOKMARK_TIMELINE_URL
} }
@@ -110,6 +110,7 @@ export const parseUser = (data) => {
output.allow_following_move = data.pleroma.allow_following_move output.allow_following_move = data.pleroma.allow_following_move
output.hide_favorites = data.pleroma.hide_favorites
output.hide_follows = data.pleroma.hide_follows output.hide_follows = data.pleroma.hide_follows
output.hide_followers = data.pleroma.hide_followers output.hide_followers = data.pleroma.hide_followers
output.hide_follows_count = data.pleroma.hide_follows_count output.hide_follows_count = data.pleroma.hide_follows_count