logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 1c2048749480800e2d44b3876378beee421a79ba
parent c9d07c62024a9e2d6f45e33a491daa6b7127abac
Author: tusooa <tusooa@kazv.moe>
Date:   Wed, 12 Jul 2023 20:45:44 -0400

Implement showing quotes

Diffstat:

Msrc/components/status/status.js3+++
Msrc/components/status/status.scss6++++++
Msrc/components/status/status.vue9+++++++++
Msrc/modules/statuses.js4++++
Msrc/services/entity_normalizer/entity_normalizer.service.js4++++
5 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/components/status/status.js b/src/components/status/status.js @@ -401,6 +401,9 @@ const Status = { }, editingAvailable () { return this.$store.state.instance.editingAvailable + }, + quotedStatus () { + return this.status.quote_id ? this.$store.state.statuses.allStatusesObject[this.status.quote_id] : undefined } }, methods: { diff --git a/src/components/status/status.scss b/src/components/status/status.scss @@ -422,4 +422,10 @@ } } } + + .quoted-status { + margin-top: 0.5em; + border: 1px solid var(--border, $fallback--border); + border-radius: var(--attachmentRadius, $fallback--attachmentRadius); + } } diff --git a/src/components/status/status.vue b/src/components/status/status.vue @@ -364,6 +364,15 @@ @parseReady="setHeadTailLinks" /> + <article + v-if="quotedStatus" + class="quoted-status" + > + <Status + :statusoid="quotedStatus" + /> + </article> + <div v-if="inConversation && !isPreview && replies && replies.length" class="replies" diff --git a/src/modules/statuses.js b/src/modules/statuses.js @@ -229,6 +229,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us timelineObject.newStatusCount += 1 } + if (status.quote) { + addStatus(status.quote, /* showImmediately = */ false, /* addToTimeline = */ false) + } + return status } diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js @@ -325,6 +325,10 @@ export const parseStatus = (data) => { output.thread_muted = pleroma.thread_muted output.emoji_reactions = pleroma.emoji_reactions output.parent_visible = pleroma.parent_visible === undefined ? true : pleroma.parent_visible + output.quote = pleroma.quote ? parseStatus(pleroma.quote) : undefined + output.quote_id = output.quote ? output.quote.id : undefined + output.quote_url = pleroma.quote_url + output.quote_visible = pleroma.quote_visible } else { output.text = data.content output.summary = data.spoiler_text