Comment on If a Lemmy user has the same name as a community, how can I tag the community on Mastodon?
rimu@piefed.social 1 week ago
In webfinger, the sidecar protocol we use to look up actors, lemmy does distinguish between community and user actors. Mastodon needs to up their game.
rglullis@communick.news 1 week ago
I am not so sure Mastodon is at fault, here. Going to
https://lemmy.world/.well-known/webfinger?resource=acct%3Avinyl%40lemmy.world, this is the result:So, lemmy is just providing two different actors for the same subject name and saying they refer to the same account.
julian@activitypub.space 1 week ago
Agreed... I didn't respond right away since I wasn't sure if I was right, but there are two constraints at play here:
You can fault Mastodon for not handling it, but I think the onus is on Lemmy to adjust their behaviour.
For reference, the same constraint happened with NodeBB. When we started, categories didn't have handles and were not unique with users (so, a category could be named the same as a user). I needed to make the handle unique between both categories and users, for this exact reason.
rglullis@communick.news 1 week ago
I sound like a broken record, but none of this would happen if the devs took a good look at RDF before throwing everything into objects/classes and ORMs.
I’m working on something that aims to be compatible with Lemmy’s API, and my models are based on the context definitions first. This means that it becomes impossible to have communities and users with the preferred_username, because they are both actors.
yo_scottie_oh@lemmy.ml 1 week ago
I also posted this question in another comment thread, but is there no way for an app to say “give me communities only” or “give me the users only” when calling the webfinger lookup thingy?
julian@activitypub.space 1 week ago
Nope, it's just a.single route, no filters or qualifiers I am aware of.
One could go through the returned accounts and see which are users and which are groups, although that's expensive and time consuming to do.
Die4Ever@retrolemmy.com 1 week ago
What if the community was the first entry in the results instead of the user? Maybe that’s more appropriate and might cause Mastodon to default to the community when there’s a conflict
nutomic@lemmy.ml 6 days ago
Its intentionally in this order because Mastodon prioritizes the last item (ie the community). If the order was changed, it would be impossible for Mastodon users to interact with a community where a user with the same name exists.
rglullis@communick.news 1 week ago
That might work, but it’s never a good idea to write your code against a specific implementation. Plus, it seems that in this case the Lemmy devs shot themselves in the foot: why allow to create two different types of actors with the same name?!
Die4Ever@retrolemmy.com 1 week ago
I agree. Users shouldn’t be allowed to choose a name that already exists as a community. But it would be a shame if communities could not be created because a user with that name already exists.