From 03cae1f43462465cbd1ffe232540c0a7abb5b0cd Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Thu, 18 Aug 2022 03:25:28 +0100 Subject: [PATCH] Revert "use akkoma-specific source for MFM unless asked not to (#132)" This reverts commit e61228b0310c46e641cd3429ccb5348e954dbf6e. --- src/boot/after_store.js | 6 ------ src/components/rich_content/rich_content.jsx | 15 ++------------- src/components/status_body/status_body.vue | 1 - src/modules/users.js | 2 +- .../entity_normalizer.service.js | 1 - 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index b1f1ee02..c0a4cff9 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -124,11 +124,6 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { copyInstanceOption('hideBotIndication') copyInstanceOption('hideUserStats') copyInstanceOption('hideFilteredStatuses') - copyInstanceOption('hideSiteName') - copyInstanceOption('hideSiteFavicon') - copyInstanceOption('showWiderShortcuts') - copyInstanceOption('showNavShortcuts') - copyInstanceOption('showPanelNavShortcuts') copyInstanceOption('logo') store.dispatch('setInstanceOption', { @@ -159,7 +154,6 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { copyInstanceOption('alwaysShowSubjectInput') copyInstanceOption('showFeaturesPanel') copyInstanceOption('hideSitename') - copyInstanceOption('renderMisskeyMarkdown') copyInstanceOption('sidebarRight') return store.dispatch('setTheme', config['theme']) diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index e384b745..0d4127b6 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -10,11 +10,6 @@ import HashtagLink from 'src/components/hashtag_link/hashtag_link.vue' import './rich_content.scss' -const selectContent = (html, sourceContent, mfm) => { - if (!mfm) return html - return sourceContent === '' ? html : sourceContent -} - /** * RichContent, The Über-powered component for rendering Post HTML. * @@ -71,11 +66,6 @@ export default { required: false, type: Boolean, default: false - }, - sourceContent: { - required: false, - type: String, - default: '' } }, // NEVER EVER TOUCH DATA INSIDE RENDER @@ -84,8 +74,7 @@ export default { const greentext = this.mfm ? false : this.greentext // Pre-process HTML - const useContent = selectContent(this.html, this.sourceContent, this.mfm) - const { newHtml: html } = preProcessPerLine(useContent, greentext) + const { newHtml: html } = preProcessPerLine(this.html, greentext) let currentMentions = null // Current chain of mentions, we group all mentions together // This is used to recover spacing removed when parsing mentions let lastSpacing = '' @@ -180,7 +169,7 @@ export default { } // Processor to use with html_tree_converter - const processItem = (item, index, array) => { + const processItem = (item, index, array, what) => { // Handle text nodes - just add emoji if (typeof item === 'string') { const emptyText = item.trim() === '' diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue index 5a5f3e5e..321f3c4b 100644 --- a/src/components/status_body/status_body.vue +++ b/src/components/status_body/status_body.vue @@ -52,7 +52,6 @@ :emoji="status.emojis" :handle-links="true" :mfm="renderMisskeyMarkdown && (status.media_type === 'text/x.misskeymarkdown')" - :sourceContent="status.source_content" :greentext="mergedConfig.greentext" :attentions="status.attentions" @parseReady="onParseReady" diff --git a/src/modules/users.js b/src/modules/users.js index 5daf3862..02a9e361 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -589,7 +589,7 @@ const users = { const response = data.error // Authentication failed commit('endLogin') - if (response.status === 401 || response.status === 403) { + if (response.status === 401) { reject(new Error('Wrong username or password')) } else { reject(new Error('An error occurred, please try again')) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 29032a65..b66191bf 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -282,7 +282,6 @@ export const parseStatus = (data) => { const { akkoma } = data if (akkoma && akkoma.source) { output.media_type = akkoma.source.mediaType - output.source_content = akkoma.source.content } }