Browse Source

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.
pull/275/head
Adam Harvey 2 years ago
parent
commit
926bc52832
No known key found for this signature in database
GPG Key ID: CDDA7B793B3E9A18
  1. 9
      api/item.go

9
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
}

Loading…
Cancel
Save