Implement a /share endpoint #428

Open
CenTdemeern1 wants to merge 1 commit from CenTdemeern1/akkoma-fe:share into develop
First-time contributor

This PR implements an endpoint for prefilling a specific message in the post form by reusing the otherwise broken preset system implemented in 462eeb90b for things like share buttons.

My motivation for making this PR is a relay/redirect service for fediverse links that I'm working on, that among other functionality, allows users to get redirected to their native instance while automatically picking the correct share endpoint for their instance software.
Akkoma and Pleroma seem to be the main platforms without a documented endpoint for this.

It would probably be even more optimal if the preset functionality could be fixed, but I don't know how I would go about doing that.
(It seems it's broken because the router is uninitialized or something when it's run? It always seems to think you're at /)

Feedback and suggestions for alternative approaches would be appreciated

This PR implements an endpoint for prefilling a specific message in the post form by reusing the otherwise broken `preset` system implemented in 462eeb90b for things like share buttons. My motivation for making this PR is a relay/redirect service for fediverse links that I'm working on, that among other functionality, allows users to get redirected to their native instance while automatically picking the correct share endpoint for their instance software. Akkoma and Pleroma seem to be the main platforms without a documented endpoint for this. It would probably be even more optimal if the `preset` functionality could be fixed, but I don't know how I would go about doing that. (It seems it's broken because the router is uninitialized or something when it's run? It always seems to think you're at `/`) Feedback and suggestions for alternative approaches would be appreciated
Hacky way of implementing a Share endpoint
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
405158d280
Contributor

This assumes the /share?message={text} template instead of /share?text={text} adopted by Mastodon and most of other platforms?

This assumes the `/share?message={text}` template instead of `/share?text={text}` adopted by Mastodon and most of other platforms?
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u share:CenTdemeern1-share
git switch CenTdemeern1-share
Sign in to join this conversation.
No description provided.