Add bookmarks
Co-authored-by: jared <jaredrmain@gmail.com>
This commit is contained in:
parent
7bd89b579f
commit
de291e2e33
20 changed files with 213 additions and 24 deletions
|
@ -1,4 +1,5 @@
|
|||
import escape from 'escape-html'
|
||||
import parseLinkHeader from 'parse-link-header'
|
||||
import { isStatusNotification } from '../notification_utils/notification_utils.js'
|
||||
|
||||
const qvitterStatusType = (status) => {
|
||||
|
@ -232,6 +233,8 @@ export const parseStatus = (data) => {
|
|||
output.repeated = data.reblogged
|
||||
output.repeat_num = data.reblogs_count
|
||||
|
||||
output.bookmarked = data.bookmarked
|
||||
|
||||
output.type = data.reblog ? 'retweet' : 'status'
|
||||
output.nsfw = data.sensitive
|
||||
|
||||
|
@ -381,3 +384,16 @@ const isNsfw = (status) => {
|
|||
const nsfwRegex = /#nsfw/i
|
||||
return (status.tags || []).includes('nsfw') || !!(status.text || '').match(nsfwRegex)
|
||||
}
|
||||
|
||||
export const parseLinkHeaderPagination = (linkHeader, opts = {}) => {
|
||||
const flakeId = opts.flakeId
|
||||
const parsedLinkHeader = parseLinkHeader(linkHeader)
|
||||
if (!parsedLinkHeader) return
|
||||
const maxId = parsedLinkHeader.next.max_id
|
||||
const minId = parsedLinkHeader.prev.min_id
|
||||
|
||||
return {
|
||||
maxId: flakeId ? maxId : parseInt(maxId, 10),
|
||||
minId: flakeId ? minId : parseInt(minId, 10)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue