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 From fcf62a13ed49359b6bc2e82e8d05f55bfe914803 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 8 Aug 2022 02:01:07 +0300 Subject: don't show to anons, make it possible to disable notification instance-wide --- src/components/update_notification/update_notification.js | 4 +++- src/components/update_notification/update_notification.vue | 3 ++- src/modules/instance.js | 1 + static/config.json | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/modules/instance.js') diff --git a/src/components/update_notification/update_notification.js b/src/components/update_notification/update_notification.js index 172be889..83fbf922 100644 --- a/src/components/update_notification/update_notification.js +++ b/src/components/update_notification/update_notification.js @@ -30,7 +30,9 @@ const UpdateNotification = { } }, shouldShow () { - return this.$store.state.serverSideStorage.flagStorage.updateCounter < CURRENT_UPDATE_COUNTER && + return !this.$store.state.instance.disableUpdateNotification && + this.$store.state.currentUser && + this.$store.state.serverSideStorage.flagStorage.updateCounter < CURRENT_UPDATE_COUNTER && !this.$store.state.serverSideStorage.flagStorage.dontShowUpdateNotifs } }, diff --git a/src/components/update_notification/update_notification.vue b/src/components/update_notification/update_notification.vue index 07e91ec9..8cae3de9 100644 --- a/src/components/update_notification/update_notification.vue +++ b/src/components/update_notification/update_notification.vue @@ -1,6 +1,7 @@