Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

The Fedi Forum

  1. Home
  2. Fediverse
  3. If a Lemmy user has the same name as a community, how can I tag the community on Mastodon?

If a Lemmy user has the same name as a community, how can I tag the community on Mastodon?

Scheduled Pinned Locked Moved Fediverse
26 Posts 9 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • rglullis@communick.newsR rglullis@communick.news

    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:

    {
      "subject": "acct:vinyl@lemmy.world",
      "links": [
        {
          "rel": "http://webfinger.net/rel/profile-page",
          "type": "text/html",
          "href": "https://lemmy.world/u/vinyl",
          "template": null
        },
        {
          "rel": "self",
          "type": "application/activity+json",
          "href": "https://lemmy.world/u/vinyl",
          "template": null,
          "properties": {
            "https://www.w3.org/ns/activitystreams#type": "Person"
          }
        },
        {
          "rel": "http://ostatus.org/schema/1.0/subscribe",
          "type": null,
          "href": null,
          "template": "https://lemmy.world/activitypub/externalInteraction?uri=%7Buri%7D"
        },
        {
          "rel": "http://webfinger.net/rel/profile-page",
          "type": "text/html",
          "href": "https://lemmy.world/c/vinyl",
          "template": null
        },
        {
          "rel": "self",
          "type": "application/activity+json",
          "href": "https://lemmy.world/c/vinyl",
          "template": null,
          "properties": {
            "https://www.w3.org/ns/activitystreams#type": "Group"
          }
        }
      ]
    }
    

    So, lemmy is just providing two different actors for the same subject name and saying they refer to the same account.

    die4ever@retrolemmy.comD This user is from outside of this forum
    die4ever@retrolemmy.comD This user is from outside of this forum
    die4ever@retrolemmy.com
    wrote last edited by
    #10

    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

    rglullis@communick.newsR NutomicN 2 Replies Last reply
    2
    • rglullis@communick.newsR rglullis@communick.news

      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:

      {
        "subject": "acct:vinyl@lemmy.world",
        "links": [
          {
            "rel": "http://webfinger.net/rel/profile-page",
            "type": "text/html",
            "href": "https://lemmy.world/u/vinyl",
            "template": null
          },
          {
            "rel": "self",
            "type": "application/activity+json",
            "href": "https://lemmy.world/u/vinyl",
            "template": null,
            "properties": {
              "https://www.w3.org/ns/activitystreams#type": "Person"
            }
          },
          {
            "rel": "http://ostatus.org/schema/1.0/subscribe",
            "type": null,
            "href": null,
            "template": "https://lemmy.world/activitypub/externalInteraction?uri=%7Buri%7D"
          },
          {
            "rel": "http://webfinger.net/rel/profile-page",
            "type": "text/html",
            "href": "https://lemmy.world/c/vinyl",
            "template": null
          },
          {
            "rel": "self",
            "type": "application/activity+json",
            "href": "https://lemmy.world/c/vinyl",
            "template": null,
            "properties": {
              "https://www.w3.org/ns/activitystreams#type": "Group"
            }
          }
        ]
      }
      

      So, lemmy is just providing two different actors for the same subject name and saying they refer to the same account.

      julianJ This user is from outside of this forum
      julianJ This user is from outside of this forum
      julian
      wrote last edited by
      #11

      Agreed... I didn't respond right away since I wasn't sure if I was right, but there are two constraints at play here:

      • Lemmy wants to allow communities to be named the same as a user
      • This is not allowed in webfinger (insomuch that multiple IDs reports should refer to the same entity)

      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.

      1 Reply Last reply
      2
      • die4ever@retrolemmy.comD die4ever@retrolemmy.com

        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

        rglullis@communick.newsR This user is from outside of this forum
        rglullis@communick.newsR This user is from outside of this forum
        rglullis@communick.news
        wrote last edited by
        #12

        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.comD NutomicN 2 Replies Last reply
        1
        • rglullis@communick.newsR This user is from outside of this forum
          rglullis@communick.newsR This user is from outside of this forum
          rglullis@communick.news
          wrote last edited by
          #13

          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.

          1 Reply Last reply
          2
          • rglullis@communick.newsR rglullis@communick.news

            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.comD This user is from outside of this forum
            die4ever@retrolemmy.comD This user is from outside of this forum
            die4ever@retrolemmy.com
            wrote last edited by
            #14

            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.

            rglullis@communick.newsR 1 Reply Last reply
            1
            • die4ever@retrolemmy.comD die4ever@retrolemmy.com

              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.

              rglullis@communick.newsR This user is from outside of this forum
              rglullis@communick.newsR This user is from outside of this forum
              rglullis@communick.news
              wrote last edited by
              #15

              I think this is yet-another reason to have a separation between users and communities at the instance/domain level.

              Setting up a server should require one top-level domain and two subdomains:

              • https://myserver.com/ would be for webfinger and the actual backend.
              • https://groups.myserver.com/ would be the subdomain for the AS2.Group actors
              • https://people.myserver.com/ would be the subdomain for the AS2.Person actor
              NutomicN 1 Reply Last reply
              2
              • RimuR This user is from outside of this forum
                RimuR This user is from outside of this forum
                Rimu
                wrote last edited by
                #16

                Regardless of how webfinger is supposed to work, Lemmy has now got a situation where there are many many overlapping actors. I don't see a clean way out of this for them so it'll probably persist.

                Lucky this came up because I have been meaning to make PieFed work the same as Lemmy, with multiple actors in the webfinger response!

                julianJ 1 Reply Last reply
                2
                • RimuR Rimu

                  Regardless of how webfinger is supposed to work, Lemmy has now got a situation where there are many many overlapping actors. I don't see a clean way out of this for them so it'll probably persist.

                  Lucky this came up because I have been meaning to make PieFed work the same as Lemmy, with multiple actors in the webfinger response!

                  julianJ This user is from outside of this forum
                  julianJ This user is from outside of this forum
                  julian
                  wrote last edited by
                  #17

                  By the time it (unique handles between users and categories) was needed, NodeBB had been around for 10 years and installed in countless places.

                  It needed to be done in one fell swoop so we coded an upgrade script that prioritized the user slug (as historically it had been around longer).

                  Hopefully the only thing you really have to federate out is an Update, but who knows what'll happen.

                  1 Reply Last reply
                  2
                  • RimuR This user is from outside of this forum
                    RimuR This user is from outside of this forum
                    Rimu
                    wrote last edited by
                    #18

                    https://github.com/LemmyNet/lemmy/issues/1922

                    Unlikely to change. I found a more recent issue that was closed with a link going to that one, so they've been over this multiple times over the years and don't want to budge.

                    PieFed will continue to disallow communities and feeds to have the same name as users, that will maximize compatibility.

                    J 1 Reply Last reply
                    0
                    • tuckermT tuckerm

                      I think that's just a way of getting a link to the community, but it doesn't actually tag the community in your post or make it get posted into that community. I just tried it, and the post does not show up in the community that I mentioned with !.

                      Y This user is from outside of this forum
                      Y This user is from outside of this forum
                      yo_scottie_oh@lemmy.ml
                      wrote last edited by yo_scottie_oh@lemmy.ml
                      #19

                      Is there no way for an app to say "give me the community only" or "give me the user only" when it calls the webfinger lookup thingy? Because if there is, then Mastodon devs could update the behavior on their side to depend on whether the name starts with @ or ! (the same way Lemmy apps do).

                      1 Reply Last reply
                      0
                      • Y This user is from outside of this forum
                        Y This user is from outside of this forum
                        yo_scottie_oh@lemmy.ml
                        wrote last edited by yo_scottie_oh@lemmy.ml
                        #20

                        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 users only" when calling the webfinger lookup thingy? Because if there is, then Mastodon devs could update the behavior on their side to depend on whether the name starts with @ or ! (the same way Lemmy apps do).

                        julianJ 1 Reply Last reply
                        0
                        • Y yo_scottie_oh@lemmy.ml

                          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 users only" when calling the webfinger lookup thingy? Because if there is, then Mastodon devs could update the behavior on their side to depend on whether the name starts with @ or ! (the same way Lemmy apps do).

                          julianJ This user is from outside of this forum
                          julianJ This user is from outside of this forum
                          julian
                          wrote last edited by
                          #21

                          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.

                          1 Reply Last reply
                          0
                          • die4ever@retrolemmy.comD die4ever@retrolemmy.com

                            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

                            NutomicN This user is from outside of this forum
                            NutomicN This user is from outside of this forum
                            Nutomic
                            wrote last edited by
                            #22

                            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.

                            1 Reply Last reply
                            0
                            • rglullis@communick.newsR rglullis@communick.news

                              I think this is yet-another reason to have a separation between users and communities at the instance/domain level.

                              Setting up a server should require one top-level domain and two subdomains:

                              • https://myserver.com/ would be for webfinger and the actual backend.
                              • https://groups.myserver.com/ would be the subdomain for the AS2.Group actors
                              • https://people.myserver.com/ would be the subdomain for the AS2.Person actor
                              NutomicN This user is from outside of this forum
                              NutomicN This user is from outside of this forum
                              Nutomic
                              wrote last edited by
                              #23

                              This would make instance creation too complicated.

                              rglullis@communick.newsR 1 Reply Last reply
                              0
                              • rglullis@communick.newsR rglullis@communick.news

                                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?!

                                NutomicN This user is from outside of this forum
                                NutomicN This user is from outside of this forum
                                Nutomic
                                wrote last edited by
                                #24

                                Because users and communities are completely separate, and stored in different DB tables. So there is no good way to enforce uniqueness.

                                1 Reply Last reply
                                0
                                • NutomicN Nutomic

                                  This would make instance creation too complicated.

                                  rglullis@communick.newsR This user is from outside of this forum
                                  rglullis@communick.newsR This user is from outside of this forum
                                  rglullis@communick.news
                                  wrote last edited by rglullis@communick.news
                                  #25

                                  It could be an optional feature.

                                  By default, users and communities share the namespace so they can not have the same name. But if you as an admin want to let users and communities with the same handle (the "as:preferredUsername"), then you need to add two CNAMEs that point to the same domain of the backend, and add these to lemmy.hjson, so that the backend can know how to generate actor ids.

                                  Of course, this still wouldn't let mastodon users to find the actors by querying "username@myserver", but at least they would be able to know they can find "@username@people.myserver" and @username@groups.myserver".

                                  1 Reply Last reply
                                  0
                                  • RimuR Rimu

                                    https://github.com/LemmyNet/lemmy/issues/1922

                                    Unlikely to change. I found a more recent issue that was closed with a link going to that one, so they've been over this multiple times over the years and don't want to budge.

                                    PieFed will continue to disallow communities and feeds to have the same name as users, that will maximize compatibility.

                                    J This user is from outside of this forum
                                    J This user is from outside of this forum
                                    jakeroxs@sh.itjust.works
                                    wrote last edited by
                                    #26

                                    https://github.com/LemmyNet/lemmy/commit/ddabdc0a3cf30b132fe7c4c05ba155065b7b1f53

                                    1 Reply Last reply
                                    1
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • 1
                                    • 2
                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    Powered by NodeBB Contributors
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World