Implement showing quotes

This commit is contained in:
tusooa 2023-07-12 20:45:44 -04:00
parent c9d07c6202
commit 1c20487494
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
5 changed files with 26 additions and 0 deletions

View File

@ -401,6 +401,9 @@ const Status = {
}, },
editingAvailable () { editingAvailable () {
return this.$store.state.instance.editingAvailable return this.$store.state.instance.editingAvailable
},
quotedStatus () {
return this.status.quote_id ? this.$store.state.statuses.allStatusesObject[this.status.quote_id] : undefined
} }
}, },
methods: { methods: {

View File

@ -422,4 +422,10 @@
} }
} }
} }
.quoted-status {
margin-top: 0.5em;
border: 1px solid var(--border, $fallback--border);
border-radius: var(--attachmentRadius, $fallback--attachmentRadius);
}
} }

View File

@ -364,6 +364,15 @@
@parseReady="setHeadTailLinks" @parseReady="setHeadTailLinks"
/> />
<article
v-if="quotedStatus"
class="quoted-status"
>
<Status
:statusoid="quotedStatus"
/>
</article>
<div <div
v-if="inConversation && !isPreview && replies && replies.length" v-if="inConversation && !isPreview && replies && replies.length"
class="replies" class="replies"

View File

@ -229,6 +229,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
timelineObject.newStatusCount += 1 timelineObject.newStatusCount += 1
} }
if (status.quote) {
addStatus(status.quote, /* showImmediately = */ false, /* addToTimeline = */ false)
}
return status return status
} }

View File

@ -325,6 +325,10 @@ export const parseStatus = (data) => {
output.thread_muted = pleroma.thread_muted output.thread_muted = pleroma.thread_muted
output.emoji_reactions = pleroma.emoji_reactions output.emoji_reactions = pleroma.emoji_reactions
output.parent_visible = pleroma.parent_visible === undefined ? true : pleroma.parent_visible 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 { } else {
output.text = data.content output.text = data.content
output.summary = data.spoiler_text output.summary = data.spoiler_text