From 926bc52832855a006084b2f61b888a90a6bac808 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Tue, 10 Oct 2023 02:04:57 -0700 Subject: [PATCH] Allow the original page of a status to be opened This adds a link when the "open" option is selected for a status that matches the "open original page" overflow menu item for a status in the Mastodon web UI. --- api/item.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/item.go b/api/item.go index 7e31720..4c37add 100644 --- a/api/item.go +++ b/api/item.go @@ -67,6 +67,15 @@ func getUrlsStatus(status *mastodon.Status) ([]util.URL, []mastodon.Mention, []m } } + // Also append the URL of the actual status, in case the user wants to open + // that. This is equivalent to "open original page" in the Mastodon web + // interface. + realUrls = append(realUrls, util.URL{ + Text: status.URL + " (original page)", + URL: status.URL, + Classes: []string{}, + }) + length := len(realUrls) + len(status.Mentions) + len(status.Tags) return realUrls, status.Mentions, status.Tags, length }