Various small fixes #459

Merged
Oneric merged 4 commits from Oneric/akkoma-fe:varfixes-20251018 into develop 2025-10-24 18:56:42 +00:00
2 changed files with 5 additions and 8 deletions
Showing only changes of commit c3673eb53a - Show all commits

Always use AP ID when copying post link

This is the canonical reference to a post and works best for lookups on
other servers. Previously this canonical ID was not accessible from the
frontend at all.

The "source" button continues to redirect to the preferred display URL
though (if set), since this is as the name suggests the preferred URL
for viewing the post in a browser (it might however not work when the
source instance restricts unauthenticated access even to local content).

This lifts the redundancy between the "source" and "copy link" buttons.

Since the legac qvitter API is still accounted for in the entity
normaliser, we just assume its external_url serves as both the canoncial
location and preferred display URL. It is dubious however, if this
codepath can even still be triggered at all and it likely makes more
sense to purge all remnants of the legacy API from the codebase.

Resolves: #166
Oneric 2025-10-18 00:00:00 +00:00

View file

@ -91,7 +91,7 @@ const ExtraButtons = {
.catch(err => this.$emit('onError', err.error.error))
},
copyLink () {
navigator.clipboard.writeText(this.statusLink)
navigator.clipboard.writeText(this.status.canonical_id)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
},
@ -187,13 +187,6 @@ const ExtraButtons = {
noTranslationTargetSet () {
return this.$store.getters.mergedConfig.translationLanguage === undefined
},
statusLink () {
if (this.status.is_local) {
return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}`
} else {
return this.status.external_url
}
},
shouldConfirmDelete () {
return this.$store.getters.mergedConfig.modalOnDelete
},

View file

@ -316,7 +316,10 @@ export const parseStatus = (data) => {
}
output.summary_raw_html = escape(data.spoiler_text)
// display URL
output.external_url = data.url
// ActivityPub ID
output.canonical_id = data.uri
output.poll = data.poll
if (output.poll) {
output.poll.options = (output.poll.options || []).map(field => ({
@ -363,6 +366,7 @@ export const parseStatus = (data) => {
output.summary = data.summary
output.summary_html = data.summary_html
output.external_url = data.external_url
output.canonical_id = data.external_url
output.is_local = data.is_local
}