From 5cd18be47b53d62c3f5bc6587a04ae3e0479d23c Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 28 Dec 2021 18:30:34 -0500 Subject: Enable anonymous users to interact with statuses remotely --- src/modules/instance.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/modules/instance.js') 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: { -- cgit v1.2.3-70-g09d2