Display quotes count on posts and add quotes list page
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
bdf46eca5a
commit
6c4c8fe51f
14 changed files with 80 additions and 10 deletions
|
|
@ -108,6 +108,7 @@ const PLEROMA_POST_ANNOUNCEMENT_URL = '/api/v1/pleroma/admin/announcements'
|
|||
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_SCROBBLES_URL = id => `/api/v1/pleroma/accounts/${id}/scrobbles`
|
||||
const PLEROMA_STATUS_QUOTES_URL = id => `/api/v1/pleroma/statuses/${id}/quotes`
|
||||
|
||||
const PLEROMA_ADMIN_CONFIG_URL = '/api/pleroma/admin/config'
|
||||
const PLEROMA_ADMIN_DESCRIPTIONS_URL = '/api/pleroma/admin/config/descriptions'
|
||||
|
|
@ -675,6 +676,7 @@ const fetchTimeline = ({
|
|||
until = false,
|
||||
userId = false,
|
||||
listId = false,
|
||||
statusId = false,
|
||||
tag = false,
|
||||
withMuted = false,
|
||||
replyVisibility = 'all',
|
||||
|
|
@ -691,7 +693,8 @@ const fetchTimeline = ({
|
|||
list: MASTODON_LIST_TIMELINE_URL,
|
||||
favorites: MASTODON_USER_FAVORITES_TIMELINE_URL,
|
||||
tag: MASTODON_TAG_TIMELINE_URL,
|
||||
bookmarks: MASTODON_BOOKMARK_TIMELINE_URL
|
||||
bookmarks: MASTODON_BOOKMARK_TIMELINE_URL,
|
||||
quotes: PLEROMA_STATUS_QUOTES_URL
|
||||
}
|
||||
const isNotifications = timeline === 'notifications'
|
||||
const params = []
|
||||
|
|
@ -706,6 +709,10 @@ const fetchTimeline = ({
|
|||
url = url(listId)
|
||||
}
|
||||
|
||||
if (timeline === 'quotes') {
|
||||
url = url(statusId)
|
||||
}
|
||||
|
||||
if (minId) {
|
||||
params.push(['min_id', minId])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import followRequestFetcher from '../../services/follow_request_fetcher/follow_r
|
|||
import listsFetcher from '../../services/lists_fetcher/lists_fetcher.service.js'
|
||||
|
||||
const backendInteractorService = credentials => ({
|
||||
startFetchingTimeline ({ timeline, store, userId = false, listId = false, tag }) {
|
||||
return timelineFetcher.startFetching({ timeline, store, credentials, userId, listId, tag })
|
||||
startFetchingTimeline ({ timeline, store, userId = false, listId = false, statusId = false, tag }) {
|
||||
return timelineFetcher.startFetching({ timeline, store, credentials, userId, listId, statusId, tag })
|
||||
},
|
||||
|
||||
fetchTimeline (args) {
|
||||
|
|
|
|||
|
|
@ -329,6 +329,7 @@ export const parseStatus = (data) => {
|
|||
output.quote_id = pleroma.quote_id ? pleroma.quote_id : (output.quote ? output.quote.id : undefined)
|
||||
output.quote_url = pleroma.quote_url
|
||||
output.quote_visible = pleroma.quote_visible
|
||||
output.quotes_count = pleroma.quotes_count
|
||||
} else {
|
||||
output.text = data.content
|
||||
output.summary = data.spoiler_text
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const fetchAndUpdate = ({
|
|||
showImmediately = false,
|
||||
userId = false,
|
||||
listId = false,
|
||||
statusId = false,
|
||||
tag = false,
|
||||
until,
|
||||
since
|
||||
|
|
@ -47,6 +48,7 @@ const fetchAndUpdate = ({
|
|||
|
||||
args.userId = userId
|
||||
args.listId = listId
|
||||
args.statusId = statusId
|
||||
args.tag = tag
|
||||
args.withMuted = !hideMutedPosts
|
||||
if (loggedIn && ['friends', 'public', 'publicAndExternal'].includes(timeline)) {
|
||||
|
|
@ -78,15 +80,15 @@ const fetchAndUpdate = ({
|
|||
})
|
||||
}
|
||||
|
||||
const startFetching = ({ timeline = 'friends', credentials, store, userId = false, listId = false, tag = false }) => {
|
||||
const startFetching = ({ timeline = 'friends', credentials, store, userId = false, listId = false, statusId = false, tag = false }) => {
|
||||
const rootState = store.rootState || store.state
|
||||
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
|
||||
const showImmediately = timelineData.visibleStatuses.length === 0
|
||||
timelineData.userId = userId
|
||||
timelineData.listId = listId
|
||||
fetchAndUpdate({ timeline, credentials, store, showImmediately, userId, listId, tag })
|
||||
fetchAndUpdate({ timeline, credentials, store, showImmediately, userId, listId, statusId, tag })
|
||||
const boundFetchAndUpdate = () =>
|
||||
fetchAndUpdate({ timeline, credentials, store, userId, listId, tag })
|
||||
fetchAndUpdate({ timeline, credentials, store, userId, listId, statusId, tag })
|
||||
return promiseInterval(boundFetchAndUpdate, 10000)
|
||||
}
|
||||
const timelineFetcher = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue