mirror of
https://github.com/tooot-app/app
synced 2025-05-28 18:04:18 +02:00
Merge branch 'main' into release
This commit is contained in:
commit
2d72218446
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tooot",
|
"name": "tooot",
|
||||||
"version": "4.8.4",
|
"version": "4.8.5",
|
||||||
"description": "tooot for Mastodon",
|
"description": "tooot for Mastodon",
|
||||||
"author": "xmflsct <me@xmflsct.com>",
|
"author": "xmflsct <me@xmflsct.com>",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
|
@ -171,17 +171,17 @@
|
|||||||
},
|
},
|
||||||
"preferencesFilters": {
|
"preferencesFilters": {
|
||||||
"expired": "",
|
"expired": "",
|
||||||
"keywords_one": "",
|
"keywords_one": "{{count}} từ khóa",
|
||||||
"keywords_other": "",
|
"keywords_other": "{{count}} từ khóa",
|
||||||
"statuses_one": "",
|
"statuses_one": "{{count}} tút",
|
||||||
"statuses_other": "",
|
"statuses_other": "{{count}} tút",
|
||||||
"context": "",
|
"context": "",
|
||||||
"contexts": {
|
"contexts": {
|
||||||
"home": "",
|
"home": "",
|
||||||
"notifications": "",
|
"notifications": "thông báo",
|
||||||
"public": "",
|
"public": "liên hợp",
|
||||||
"thread": "",
|
"thread": "thảo luận",
|
||||||
"account": ""
|
"account": "người"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"preferencesFilter": {
|
"preferencesFilter": {
|
||||||
|
@ -48,22 +48,13 @@ const ComposeEditAttachment: React.FC<
|
|||||||
}
|
}
|
||||||
|
|
||||||
setIsSubmitting(true)
|
setIsSubmitting(true)
|
||||||
const formData = new FormData()
|
const body = { description: theAttachment.description }
|
||||||
if (theAttachment.description) {
|
|
||||||
formData.append('description', theAttachment.description)
|
|
||||||
}
|
|
||||||
if (theAttachment.meta?.focus?.x !== 0 || theAttachment.meta.focus.y !== 0) {
|
|
||||||
formData.append(
|
|
||||||
'focus',
|
|
||||||
`${theAttachment.meta?.focus?.x || 0},${-theAttachment.meta?.focus?.y || 0}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
theAttachment?.id &&
|
theAttachment?.id &&
|
||||||
apiInstance<Mastodon.Attachment>({
|
apiInstance<Mastodon.Attachment>({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: `media/${theAttachment.id}`,
|
url: `media/${theAttachment.id}`,
|
||||||
body: formData
|
body
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
haptics('Success')
|
haptics('Success')
|
||||||
|
@ -75,19 +75,21 @@ const TabMePush: React.FC = () => {
|
|||||||
<MenuRow
|
<MenuRow
|
||||||
key={alert}
|
key={alert}
|
||||||
title={t(`me.push.${alert}.heading`)}
|
title={t(`me.push.${alert}.heading`)}
|
||||||
switchDisabled={!pushEnabled || !push.global}
|
// switchDisabled={!pushEnabled || !push.global}
|
||||||
switchValue={push?.alerts[alert]}
|
switchValue={push?.alerts[alert]}
|
||||||
switchOnValueChange={async () => {
|
switchOnValueChange={async () => {
|
||||||
const alerts = { ...push?.alerts, [alert]: !push?.alerts[alert] }
|
const alerts = { ...push?.alerts, [alert]: !push?.alerts[alert] }
|
||||||
const formData = new FormData()
|
const body: { data: { alerts: { [key: string]: boolean } } } = {
|
||||||
|
data: { alerts: {} }
|
||||||
|
}
|
||||||
for (const [key, value] of Object.entries(alerts)) {
|
for (const [key, value] of Object.entries(alerts)) {
|
||||||
formData.append(`data[alerts][${key}]`, value.toString())
|
body.data.alerts[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
await apiInstance<Mastodon.PushSubscription>({
|
await apiInstance<Mastodon.PushSubscription>({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: 'push/subscription',
|
url: 'push/subscription',
|
||||||
body: formData
|
body
|
||||||
})
|
})
|
||||||
|
|
||||||
setAccountStorage([{ key: 'push', value: { ...push, alerts } }])
|
setAccountStorage([{ key: 'push', value: { ...push, alerts } }])
|
||||||
@ -103,19 +105,21 @@ const TabMePush: React.FC = () => {
|
|||||||
<MenuRow
|
<MenuRow
|
||||||
key={type}
|
key={type}
|
||||||
title={t(`me.push.${type}.heading`)}
|
title={t(`me.push.${type}.heading`)}
|
||||||
switchDisabled={!pushEnabled || !push.global}
|
// switchDisabled={!pushEnabled || !push.global}
|
||||||
switchValue={push?.alerts[type]}
|
switchValue={push?.alerts[type]}
|
||||||
switchOnValueChange={async () => {
|
switchOnValueChange={async () => {
|
||||||
const alerts = { ...push?.alerts, [type]: !push?.alerts[type] }
|
const alerts = { ...push?.alerts, [type]: !push?.alerts[type] }
|
||||||
const formData = new FormData()
|
const body: { data: { alerts: { [key: string]: boolean } } } = {
|
||||||
|
data: { alerts: {} }
|
||||||
|
}
|
||||||
for (const [key, value] of Object.entries(alerts)) {
|
for (const [key, value] of Object.entries(alerts)) {
|
||||||
formData.append(`data[alerts][${key}]`, value.toString())
|
body.data.alerts[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
await apiInstance<Mastodon.PushSubscription>({
|
await apiInstance<Mastodon.PushSubscription>({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: 'push/subscription',
|
url: 'push/subscription',
|
||||||
body: formData
|
body
|
||||||
})
|
})
|
||||||
|
|
||||||
setAccountStorage([{ key: 'push', value: { ...push, alerts } }])
|
setAccountStorage([{ key: 'push', value: { ...push, alerts } }])
|
||||||
@ -190,21 +194,25 @@ const TabMePush: React.FC = () => {
|
|||||||
|
|
||||||
const endpoint = `https://${TOOOT_API_DOMAIN}/push/send/${pushPath}/${randomPath}`
|
const endpoint = `https://${TOOOT_API_DOMAIN}/push/send/${pushPath}/${randomPath}`
|
||||||
|
|
||||||
const formData = new FormData()
|
const body: { subscription: any; alerts: { [key: string]: boolean } } = {
|
||||||
formData.append('subscription[endpoint]', endpoint)
|
subscription: {
|
||||||
formData.append(
|
endpoint,
|
||||||
'subscription[keys][p256dh]',
|
keys: {
|
||||||
'BMn2PLpZrMefG981elzG6SB1EY9gU7QZwmtZ/a/J2vUeWG+zXgeskMPwHh4T/bxsD4l7/8QT94F57CbZqYRRfJo='
|
p256dh:
|
||||||
)
|
'BMn2PLpZrMefG981elzG6SB1EY9gU7QZwmtZ/a/J2vUeWG+zXgeskMPwHh4T/bxsD4l7/8QT94F57CbZqYRRfJo=',
|
||||||
formData.append('subscription[keys][auth]', authKey)
|
auth: authKey
|
||||||
|
}
|
||||||
|
},
|
||||||
|
alerts: {}
|
||||||
|
}
|
||||||
for (const [key, value] of Object.entries(push.alerts)) {
|
for (const [key, value] of Object.entries(push.alerts)) {
|
||||||
formData.append(`data[alerts][${key}]`, value.toString())
|
body.alerts[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await apiInstance<Mastodon.PushSubscription>({
|
const res = await apiInstance<Mastodon.PushSubscription>({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: 'push/subscription',
|
url: 'push/subscription',
|
||||||
body: formData
|
body
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!res.body.server_key?.length) {
|
if (!res.body.server_key?.length) {
|
||||||
|
@ -53,22 +53,29 @@ const TabSharedReport: React.FC<TabSharedStackScreenProps<'Tab-Shared-Report'>>
|
|||||||
content={t('screenTabs:shared.report.report')}
|
content={t('screenTabs:shared.report.report')}
|
||||||
destructive
|
destructive
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
const body = new FormData()
|
const body: {
|
||||||
|
status_ids?: string[]
|
||||||
|
account_id?: string
|
||||||
|
comment?: string
|
||||||
|
forward?: boolean
|
||||||
|
category?: string
|
||||||
|
rule_ids?: string[]
|
||||||
|
} = {}
|
||||||
if (status) {
|
if (status) {
|
||||||
if (status._remote) {
|
if (status._remote) {
|
||||||
const fetchedStatus = await searchLocalStatus(status.uri)
|
const fetchedStatus = await searchLocalStatus(status.uri)
|
||||||
if (fetchedStatus) {
|
if (fetchedStatus) {
|
||||||
body.append('status_ids[]', fetchedStatus.id)
|
body.status_ids = [fetchedStatus.id]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
body.append('status_ids[]', status.id)
|
body.status_ids = [status.id]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body.append('account_id', account.id)
|
body.account_id = account.id
|
||||||
comment.length && body.append('comment', comment)
|
comment.length && (body.comment = comment)
|
||||||
body.append('forward', forward.toString())
|
body.forward = forward
|
||||||
body.append('category', categories.find(category => category.selected)?.type || 'other')
|
body.category = categories.find(category => category.selected)?.type || 'other'
|
||||||
rules.filter(rule => rule.selected).forEach(rule => body.append('rule_ids[]', rule.id))
|
body.rule_ids = rules.filter(rule => rule.selected).map(rule => rule.id)
|
||||||
|
|
||||||
apiInstance({ method: 'post', url: 'reports', body })
|
apiInstance({ method: 'post', url: 'reports', body })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { ctx, handleError, PagedResponse, parseHeaderLinks, processBody, userAgent } from './helpers'
|
import { ctx, handleError, PagedResponse, parseHeaderLinks, userAgent } from './helpers'
|
||||||
|
|
||||||
export type Params = {
|
export type Params = {
|
||||||
method: 'get' | 'post' | 'put' | 'delete'
|
method: 'get' | 'post' | 'put' | 'delete'
|
||||||
@ -41,9 +41,10 @@ const apiGeneral = async <T = unknown>({
|
|||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
...userAgent,
|
...userAgent,
|
||||||
...headers
|
...headers,
|
||||||
|
...(body && body instanceof FormData && { 'Content-Type': 'multipart/form-data' })
|
||||||
},
|
},
|
||||||
data: processBody(body)
|
data: body
|
||||||
})
|
})
|
||||||
.then(response => ({ body: response.data, links: parseHeaderLinks(response.headers.link) }))
|
.then(response => ({ body: response.data, links: parseHeaderLinks(response.headers.link) }))
|
||||||
.catch(handleError())
|
.catch(handleError())
|
||||||
|
@ -102,20 +102,4 @@ export type PagedResponse<T = unknown> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const processBody = (body?: FormData | Object): FormData | Object | undefined => {
|
|
||||||
if (!body) return
|
|
||||||
|
|
||||||
if (body instanceof FormData) {
|
|
||||||
if ((body as FormData & { _parts: [][] })._parts?.length) {
|
|
||||||
return body
|
|
||||||
} else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Object.keys(body).length) {
|
|
||||||
return body
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { ctx, handleError, userAgent }
|
export { ctx, handleError, userAgent }
|
||||||
|
@ -1,14 +1,7 @@
|
|||||||
import { getAccountDetails } from '@utils/storage/actions'
|
import { getAccountDetails } from '@utils/storage/actions'
|
||||||
import { StorageGlobal } from '@utils/storage/global'
|
import { StorageGlobal } from '@utils/storage/global'
|
||||||
import axios, { AxiosRequestConfig } from 'axios'
|
import axios, { AxiosRequestConfig } from 'axios'
|
||||||
import {
|
import { ctx, handleError, PagedResponse, parseHeaderLinks, userAgent } from './helpers'
|
||||||
ctx,
|
|
||||||
handleError,
|
|
||||||
PagedResponse,
|
|
||||||
parseHeaderLinks,
|
|
||||||
processBody,
|
|
||||||
userAgent
|
|
||||||
} from './helpers'
|
|
||||||
|
|
||||||
export type Params = {
|
export type Params = {
|
||||||
account?: StorageGlobal['account.active']
|
account?: StorageGlobal['account.active']
|
||||||
@ -50,7 +43,7 @@ const apiInstance = async <T = unknown>({
|
|||||||
method + ctx.blue(' -> ') + `/${url}` + (params ? ctx.blue(' -> ') : ''),
|
method + ctx.blue(' -> ') + `/${url}` + (params ? ctx.blue(' -> ') : ''),
|
||||||
params ? params : ''
|
params ? params : ''
|
||||||
)
|
)
|
||||||
|
console.log('body', body)
|
||||||
return axios({
|
return axios({
|
||||||
timeout: method === 'post' ? 1000 * 60 : 1000 * 15,
|
timeout: method === 'post' ? 1000 * 60 : 1000 * 15,
|
||||||
method,
|
method,
|
||||||
@ -61,9 +54,10 @@ const apiInstance = async <T = unknown>({
|
|||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
...userAgent,
|
...userAgent,
|
||||||
...headers,
|
...headers,
|
||||||
Authorization: `Bearer ${accountDetails['auth.token']}`
|
Authorization: `Bearer ${accountDetails['auth.token']}`,
|
||||||
|
...(body && body instanceof FormData && { 'Content-Type': 'multipart/form-data' })
|
||||||
},
|
},
|
||||||
data: processBody(body),
|
data: body,
|
||||||
...extras
|
...extras
|
||||||
})
|
})
|
||||||
.then(response => ({ body: response.data, links: parseHeaderLinks(response.headers.link) }))
|
.then(response => ({ body: response.data, links: parseHeaderLinks(response.headers.link) }))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { mapEnvironment } from '@utils/helpers/checkEnvironment'
|
import { mapEnvironment } from '@utils/helpers/checkEnvironment'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { ctx, handleError, processBody, userAgent } from './helpers'
|
import { ctx, handleError, userAgent } from './helpers'
|
||||||
|
|
||||||
export type Params = {
|
export type Params = {
|
||||||
method: 'get' | 'post' | 'put' | 'delete'
|
method: 'get' | 'post' | 'put' | 'delete'
|
||||||
@ -46,7 +46,7 @@ const apiTooot = async <T = unknown>({
|
|||||||
...userAgent,
|
...userAgent,
|
||||||
...headers
|
...headers
|
||||||
},
|
},
|
||||||
data: processBody(body)
|
data: body
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
|
@ -44,11 +44,11 @@ type MutationVarsLists =
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mutationFunction = async (params: MutationVarsLists) => {
|
const mutationFunction = async (params: MutationVarsLists) => {
|
||||||
const body = new FormData()
|
const body: { title?: string; replies_policy?: string } = {}
|
||||||
switch (params.type) {
|
switch (params.type) {
|
||||||
case 'add':
|
case 'add':
|
||||||
body.append('title', params.payload.title)
|
body.title = params.payload.title
|
||||||
body.append('replies_policy', params.payload.replies_policy)
|
body.replies_policy = params.payload.replies_policy
|
||||||
|
|
||||||
return apiInstance<Mastodon.List>({
|
return apiInstance<Mastodon.List>({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@ -56,8 +56,8 @@ const mutationFunction = async (params: MutationVarsLists) => {
|
|||||||
body
|
body
|
||||||
}).then(res => res.body)
|
}).then(res => res.body)
|
||||||
case 'edit':
|
case 'edit':
|
||||||
body.append('title', params.payload.title)
|
body.title = params.payload.title
|
||||||
body.append('replies_policy', params.payload.replies_policy)
|
body.replies_policy = params.payload.replies_policy
|
||||||
|
|
||||||
return apiInstance<Mastodon.List>({
|
return apiInstance<Mastodon.List>({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
@ -117,9 +117,9 @@ type AccountsMutationVarsLists = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const accountsMutationFunction = async (params: AccountsMutationVarsLists) => {
|
const accountsMutationFunction = async (params: AccountsMutationVarsLists) => {
|
||||||
const body = new FormData()
|
const body: { account_ids?: string[] } = {}
|
||||||
for (const account of params.payload.accounts) {
|
for (const account of params.payload.accounts) {
|
||||||
body.append('account_ids[]', account)
|
body.account_ids = [account]
|
||||||
}
|
}
|
||||||
return apiInstance<{}>({
|
return apiInstance<{}>({
|
||||||
method: params.type === 'add' ? 'post' : 'delete',
|
method: params.type === 'add' ? 'post' : 'delete',
|
||||||
|
@ -64,16 +64,19 @@ type MutationVarsProfile = MutationVarsProfileBase & {
|
|||||||
|
|
||||||
const mutationFunction = async ({ type, data }: MutationVarsProfile) => {
|
const mutationFunction = async ({ type, data }: MutationVarsProfile) => {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
|
|
||||||
if (type === 'fields_attributes') {
|
if (type === 'fields_attributes') {
|
||||||
if (!data.length) {
|
const body: { fields_attributes: { name: string; value: string }[] } = {
|
||||||
formData.append('fields_attributes[]', '')
|
fields_attributes: []
|
||||||
} else {
|
|
||||||
const tempData = data as { name: string; value: string }[]
|
|
||||||
tempData.forEach((d, index) => {
|
|
||||||
formData.append(`fields_attributes[${index}][name]`, d.name)
|
|
||||||
formData.append(`fields_attributes[${index}][value]`, d.value)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
if (data.length) {
|
||||||
|
body.fields_attributes = data as { name: string; value: string }[]
|
||||||
|
}
|
||||||
|
return apiInstance<AccountWithSource>({
|
||||||
|
method: 'patch',
|
||||||
|
url: 'accounts/update_credentials',
|
||||||
|
body
|
||||||
|
})
|
||||||
} else if (type === 'avatar' || type === 'header') {
|
} else if (type === 'avatar' || type === 'header') {
|
||||||
formData.append(type, {
|
formData.append(type, {
|
||||||
uri: data,
|
uri: data,
|
||||||
@ -84,7 +87,6 @@ const mutationFunction = async ({ type, data }: MutationVarsProfile) => {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
formData.append(type, data)
|
formData.append(type, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiInstance<AccountWithSource>({
|
return apiInstance<AccountWithSource>({
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
url: 'accounts/update_credentials',
|
url: 'accounts/update_credentials',
|
||||||
|
@ -74,16 +74,14 @@ const mutationFunction = async (params: MutationVarsRelationship) => {
|
|||||||
url: `follow_requests/${params.id}/${params.payload.action}`
|
url: `follow_requests/${params.id}/${params.payload.action}`
|
||||||
}).then(res => res.body)
|
}).then(res => res.body)
|
||||||
case 'outgoing':
|
case 'outgoing':
|
||||||
const formData = new FormData()
|
const body: { reblogs?: boolean; notify?: boolean } = {}
|
||||||
typeof params.payload.reblogs === 'boolean' &&
|
typeof params.payload.reblogs === 'boolean' && (body.reblogs = params.payload.reblogs)
|
||||||
formData.append('reblogs', params.payload.reblogs.toString())
|
typeof params.payload.notify === 'boolean' && (body.notify = params.payload.notify)
|
||||||
typeof params.payload.notify === 'boolean' &&
|
|
||||||
formData.append('notify', params.payload.notify.toString())
|
|
||||||
|
|
||||||
return apiInstance<Mastodon.Relationship>({
|
return apiInstance<Mastodon.Relationship>({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: `accounts/${params.id}/${params.payload.state ? 'un' : ''}${params.payload.action}`,
|
url: `accounts/${params.id}/${params.payload.state ? 'un' : ''}${params.payload.action}`,
|
||||||
body: formData
|
body
|
||||||
}).then(res => res.body)
|
}).then(res => res.body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -355,21 +355,19 @@ const mutationFunction = async (params: MutationVarsTimeline) => {
|
|||||||
case 'updateStatusProperty':
|
case 'updateStatusProperty':
|
||||||
switch (params.payload.type) {
|
switch (params.payload.type) {
|
||||||
case 'poll':
|
case 'poll':
|
||||||
const formData = new FormData()
|
|
||||||
params.payload.action === 'vote' &&
|
|
||||||
params.payload.options?.forEach((option, index) => {
|
|
||||||
if (option) {
|
|
||||||
formData.append('choices[]', index.toString())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return apiInstance<Mastodon.Poll>({
|
return apiInstance<Mastodon.Poll>({
|
||||||
method: params.payload.action === 'vote' ? 'post' : 'get',
|
method: params.payload.action === 'vote' ? 'post' : 'get',
|
||||||
url:
|
url:
|
||||||
params.payload.action === 'vote'
|
params.payload.action === 'vote'
|
||||||
? `polls/${params.status.poll?.id}/votes`
|
? `polls/${params.status.poll?.id}/votes`
|
||||||
: `polls/${params.status.poll?.id}`,
|
: `polls/${params.status.poll?.id}`,
|
||||||
...(params.payload.action === 'vote' && { body: formData })
|
...(params.payload.action === 'vote' && {
|
||||||
|
body: {
|
||||||
|
choices: params.payload.options
|
||||||
|
.map((option, index) => (option ? index.toString() : undefined))
|
||||||
|
.filter(o => o)
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
let tootId = params.status.id
|
let tootId = params.status.id
|
||||||
@ -381,16 +379,14 @@ const mutationFunction = async (params: MutationVarsTimeline) => {
|
|||||||
return Promise.reject('Fetching for remote toot failed')
|
return Promise.reject('Fetching for remote toot failed')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const body = new FormData()
|
|
||||||
if (params.payload.type === 'reblogged') {
|
|
||||||
body.append('visibility', params.payload.visibility)
|
|
||||||
}
|
|
||||||
return apiInstance<Mastodon.Status>({
|
return apiInstance<Mastodon.Status>({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: `statuses/${tootId}/${params.payload.to ? '' : 'un'}${
|
url: `statuses/${tootId}/${params.payload.to ? '' : 'un'}${
|
||||||
MapPropertyToUrl[params.payload.type]
|
MapPropertyToUrl[params.payload.type]
|
||||||
}`,
|
}`,
|
||||||
...(params.payload.type === 'reblogged' && { body })
|
...(params.payload.type === 'reblogged' && {
|
||||||
|
body: { visibility: params.payload.visibility }
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
case 'updateAccountProperty':
|
case 'updateAccountProperty':
|
||||||
|
@ -291,11 +291,12 @@ export const removeAccount = async (account: string, warning: boolean = true) =>
|
|||||||
revokeDetails.client_secret &&
|
revokeDetails.client_secret &&
|
||||||
revokeDetails.token
|
revokeDetails.token
|
||||||
) {
|
) {
|
||||||
const body = new FormData()
|
apiGeneral({
|
||||||
body.append('client_id', revokeDetails.client_id)
|
method: 'post',
|
||||||
body.append('client_secret', revokeDetails.client_secret)
|
domain: revokeDetails.domain,
|
||||||
body.append('token', revokeDetails.token)
|
url: '/oauth/revoke',
|
||||||
apiGeneral({ method: 'post', domain: revokeDetails.domain, url: '/oauth/revoke', body })
|
body: revokeDetails
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const currAccounts: NonNullable<StorageGlobal['accounts']> =
|
const currAccounts: NonNullable<StorageGlobal['accounts']> =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user