diff options
| author | Tusooa Zhu <tusooa@kazv.moe> | 2021-12-28 18:30:34 -0500 |
|---|---|---|
| committer | Tusooa Zhu <tusooa@kazv.moe> | 2022-07-01 13:03:45 -0400 |
| commit | 5cd18be47b53d62c3f5bc6587a04ae3e0479d23c (patch) | |
| tree | 0e5e94e2494ed094dbdee36af12d9b4ddb92ad2e /src/modules | |
| parent | 56501e95c42859a826ad0f0b11de4e6b189b9f92 (diff) | |
Enable anonymous users to interact with statuses remotely
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/instance.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/instance.js b/src/modules/instance.js index 220463ca..6a657533 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -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: { |
