Skip to content

Conversation

graue
Copy link
Contributor

@graue graue commented Jul 13, 2024

Fixes #596. I've been wanting to make a contribution and this seemed like a good first issue.

@cheeaun
Copy link
Owner

cheeaun commented Jul 14, 2024

Thanks, but I think this doesn't handle the LOCAL_DOMAIN vs WEB_DOMAIN cases https://docs.joinmastodon.org/admin/config/#web_domain

@graue
Copy link
Contributor Author

graue commented Jul 14, 2024

Is the problem that if I'm on example.com, you think this would copy @alice@mastodon.example.com instead of @alice@example.com?

If so (I don't have an account with a server like that, so I can't test), then the existing AccountHandleInfo UI would also be incorrect:

image

I'm a bit stumped by this one. I don't see anything in Masto.js that would allow distinguishing between the two different instance domains in that case. Does Phanpy deal with this elsewhere?

@cheeaun
Copy link
Owner

cheeaun commented Jul 17, 2024

@graue you're right and right. Seems like I've already added this feature+bug in both cases; account handle UI (you mentioned above) and the Accounts selection UI.

At the back of head, I kept reminding myself that there's this LOCAL_DOMAIN vs WEB_DOMAIN case which is not possible to fix for now.

  • Mastodon web cheats a little but grabbing the LOCAL_DOMAIN straight from the backend and inject it into JS.
  • The right solution is perform a webfinger call Mastodon API and WEB_DOMAIN mastodon/mastodon#26848 — but most of the "well-known" endpoints are not CORS-enabled so the browsers won't allow them.

Will be looking at this and merging this later 🙇‍♂️

@cheeaun cheeaun merged commit 808c626 into cheeaun:main Jul 18, 2024
2 checks passed
@graue graue deleted the graue/copy-handle-with-instance branch July 18, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include domain name when copying handle
2 participants