Merge branch 'mastodon-api-user-statuses-filters' into 'develop'
Mastodon API: support pinned param for account statuses See merge request firefish/firefish!10549
This commit is contained in:
commit
f3dc848d6a
1 changed files with 11 additions and 0 deletions
|
@ -18,6 +18,10 @@ export function argsToBools(q: ParsedUrlQuery) {
|
||||||
const toBoolean = (value: string) =>
|
const toBoolean = (value: string) =>
|
||||||
!["0", "f", "F", "false", "FALSE", "off", "OFF"].includes(value);
|
!["0", "f", "F", "false", "FALSE", "off", "OFF"].includes(value);
|
||||||
|
|
||||||
|
// Keys taken from:
|
||||||
|
// - https://docs.joinmastodon.org/methods/accounts/#statuses
|
||||||
|
// - https://docs.joinmastodon.org/methods/timelines/#public
|
||||||
|
// - https://docs.joinmastodon.org/methods/timelines/#tag
|
||||||
let object: any = q;
|
let object: any = q;
|
||||||
if (q.only_media)
|
if (q.only_media)
|
||||||
if (typeof q.only_media === "string")
|
if (typeof q.only_media === "string")
|
||||||
|
@ -25,6 +29,13 @@ export function argsToBools(q: ParsedUrlQuery) {
|
||||||
if (q.exclude_replies)
|
if (q.exclude_replies)
|
||||||
if (typeof q.exclude_replies === "string")
|
if (typeof q.exclude_replies === "string")
|
||||||
object.exclude_replies = toBoolean(q.exclude_replies);
|
object.exclude_replies = toBoolean(q.exclude_replies);
|
||||||
|
if (q.exclude_reblogs)
|
||||||
|
if (typeof q.exclude_reblogs === "string")
|
||||||
|
object.exclude_reblogs = toBoolean(q.exclude_reblogs);
|
||||||
|
if (q.pinned)
|
||||||
|
if (typeof q.pinned === "string") object.pinned = toBoolean(q.pinned);
|
||||||
|
if (q.local)
|
||||||
|
if (typeof q.local === "string") object.local = toBoolean(q.local);
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue