#468 - show pinned timeline and add pinned label to the status

This commit is contained in:
dave 2019-04-04 15:10:34 -04:00 committed by taehoon
parent e28b19645a
commit 2c89d49a3d
11 changed files with 69 additions and 18 deletions

View file

@ -506,6 +506,19 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
.then((data) => data.map(isNotifications ? parseNotification : parseStatus))
}
const fetchPinnedStatuses = ({ id, credentials }) => {
const url = MASTODON_USER_TIMELINE_URL(id) + '?pinned=true'
return fetch(url, { headers: authHeaders(credentials) })
.then((data) => {
if (data.ok) {
return data
}
throw new Error('Error fetching pinned timeline', data)
})
.then((data) => data.json())
.then((data) => data.map(parseStatus))
}
const verifyCredentials = (user) => {
return fetch(LOGIN_URL, {
method: 'POST',
@ -726,6 +739,7 @@ const reportUser = ({credentials, userId, statusIds, comment, forward}) => {
const apiService = {
verifyCredentials,
fetchTimeline,
fetchPinnedStatuses,
fetchConversation,
fetchStatus,
fetchFriends,