aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boot/after_store.js3
-rw-r--r--src/modules/instance.js1
-rw-r--r--src/services/api/api.service.js3
-rw-r--r--src/services/status_poster/status_poster.service.js2
-rw-r--r--static/config.json3
5 files changed, 9 insertions, 3 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 5b9e5c96..6e87d5f6 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -72,6 +72,7 @@ const afterStoreSetup = ({ store, i18n }) => {
var scopeCopy = (config.scopeCopy)
var subjectLineBehavior = (config.subjectLineBehavior)
var alwaysShowSubjectInput = (config.alwaysShowSubjectInput)
+ var noAttachmentLinks = (config.noAttachmentLinks)
store.dispatch('setInstanceOption', { name: 'theme', value: theme })
store.dispatch('setInstanceOption', { name: 'background', value: background })
@@ -90,6 +91,8 @@ const afterStoreSetup = ({ store, i18n }) => {
store.dispatch('setInstanceOption', { name: 'scopeCopy', value: scopeCopy })
store.dispatch('setInstanceOption', { name: 'subjectLineBehavior', value: subjectLineBehavior })
store.dispatch('setInstanceOption', { name: 'alwaysShowSubjectInput', value: alwaysShowSubjectInput })
+ store.dispatch('setInstanceOption', { name: 'noAttachmentLinks', value: noAttachmentLinks })
+
if (chatDisabled) {
store.dispatch('disableChat')
}
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 342bc9ac..546d2cc4 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -27,6 +27,7 @@ const defaultState = {
loginMethod: 'password',
nsfwCensorImage: undefined,
vapidPublicKey: undefined,
+ noAttachmentLinks: false,
// Nasty stuff
pleromaBackend: true,
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 182f9126..4ee95bd1 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -370,12 +370,13 @@ const unretweet = ({ id, credentials }) => {
})
}
-const postStatus = ({credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType}) => {
+const postStatus = ({credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType, noAttachmentLinks}) => {
const idsText = mediaIds.join(',')
const form = new FormData()
form.append('status', status)
form.append('source', 'Pleroma FE')
+ if (noAttachmentLinks) form.append('no_attachment_links', noAttachmentLinks)
if (spoilerText) form.append('spoiler_text', spoilerText)
if (visibility) form.append('visibility', visibility)
if (sensitive) form.append('sensitive', sensitive)
diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js
index 7f8b0fc0..1e20d336 100644
--- a/src/services/status_poster/status_poster.service.js
+++ b/src/services/status_poster/status_poster.service.js
@@ -4,7 +4,7 @@ import apiService from '../api/api.service.js'
const postStatus = ({ store, status, spoilerText, visibility, sensitive, media = [], inReplyToStatusId = undefined, contentType = 'text/plain' }) => {
const mediaIds = map(media, 'id')
- return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType})
+ return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType, noAttachmentLinks: store.state.instance.noAttachmentLinks})
.then((data) => data.json())
.then((data) => {
if (!data.error) {
diff --git a/static/config.json b/static/config.json
index f508eea1..9bdcb3b2 100644
--- a/static/config.json
+++ b/static/config.json
@@ -17,5 +17,6 @@
"hidePostStats": false,
"hideUserStats": false,
"loginMethod": "password",
- "webPushNotifications": false
+ "webPushNotifications": false,
+ "noAttachmentLinks": false
}