Enable anonymous users to interact with statuses remotely
This commit is contained in:
parent
56501e95c4
commit
5cd18be47b
7 changed files with 48 additions and 7 deletions
|
|
@ -3,6 +3,8 @@ import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js'
|
|||
import apiService from '../services/api/api.service.js'
|
||||
import { instanceDefaultProperties } from './config.js'
|
||||
|
||||
const REMOTE_INTERACTION_URL = '/main/ostatus'
|
||||
|
||||
const defaultState = {
|
||||
// Stuff from apiConfig
|
||||
name: 'Pleroma FE',
|
||||
|
|
@ -116,6 +118,18 @@ const instance = {
|
|||
},
|
||||
instanceDomain (state) {
|
||||
return new URL(state.server).hostname
|
||||
},
|
||||
remoteInteractionLink (state) {
|
||||
const server = state.server.endsWith('/') ? state.server.slice(0, -1) : state.server
|
||||
const link = server + REMOTE_INTERACTION_URL
|
||||
|
||||
return ({ statusId, nickname }) => {
|
||||
if (statusId) {
|
||||
return `${link}?status_id=${statusId}`
|
||||
} else {
|
||||
return `${link}?nickname=${nickname}`
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue