diff options
| author | tusooa <tusooa@kazv.moe> | 2023-07-12 20:45:44 -0400 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2023-07-13 00:44:30 -0400 |
| commit | 1c2048749480800e2d44b3876378beee421a79ba (patch) | |
| tree | 49e0957df4068de2f1886734488ea13a1cd9d5f8 | |
| parent | c9d07c62024a9e2d6f45e33a491daa6b7127abac (diff) | |
Implement showing quotes
| -rw-r--r-- | src/components/status/status.js | 3 | ||||
| -rw-r--r-- | src/components/status/status.scss | 6 | ||||
| -rw-r--r-- | src/components/status/status.vue | 9 | ||||
| -rw-r--r-- | src/modules/statuses.js | 4 | ||||
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 4 |
5 files changed, 26 insertions, 0 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 9a9bca7a..c10c6cf5 100644 --- 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 index 44812867..4dfd1f87 100644 --- 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 index 35b15362..58fc0eca 100644 --- 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 index ed21a730..186bba3c 100644 --- 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 index adefc5a5..fb9ee80a 100644 --- 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 |
