w3c / activitystreams

Activity Streams 2.0
https://www.w3.org/TR/activitystreams-core/
Other
284 stars 60 forks source link

microsyntax examples should also include a mention #423

Closed nightpool closed 1 year ago

nightpool commented 7 years ago

Please Indicate One:

Please Describe the Issue:

When implementing microformat mentions for mastodon, we ran into the issue where we weren't sure if we were supposed to include BOTH the to-targeting and the mentions tag, because the examples were unclear. After talking with other implementors, it seems that the intent is that we should always include a Mentions tag, but the examples don't reflect this.

The first example in that section (157) should probably read:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "name": "A thank-you note",
  "type": "Note",
  "content": "Thank you <a href='http://sally.example.org'>@sally</a>
      for all your hard work!
      <a href='http://example.org/tags/givingthanks'>#givingthanks</a>",
  "to": {
    "name": "Sally",
    "type": "Person",
    "id": "http://example.org/people/sally"
  },
  "tag": [
    {
      "type": "Mention",
      "href": "http://example.org/people/sally",
      "name": "@sally"
    },
    {
      "id": "http://example.org/tags/givingthanks",
      "name": "#givingthanks"
    }
  ]
}

Is there a reason this shouldn't be included?

evanp commented 1 year ago

On re-reading the section, it seems that there are two distinct cases of using @-addressing for AS2.

  1. The @-address makes the addressed person one of the addressed accounts in the "to", "cc", ... properties.
  2. The @-address does not result in the person being added to the 'to', ... properties. Only in this case should the 'Mention' tag be used.

Since this is in the non-normative section of the spec, and since the use of this syntax apparently has different practice in the general implementation, I'd like to defer this to the wiki for further conversation.

https://www.w3.org/wiki/Activity_Streams/Primer/Microsyntax_for_Mentions

I added the text from the non-normative section, as well as the example from above.