Adding tags to existing notes


#1

We recently discovered that Friendica does have just another content that needs to be transmitted via AP :wink:

Friendica users do have the ability to add tags to a note from another user (if that user allows it). Question is, how a fitting AP message could look like. The message has to contain this data:

  • A reference to the original message
  • The tag

How could the message look alike?


#2

For S2S I could imagine the other user’s home-server sending an https://www.w3.org/ns/activitystreams#Add with an Tag object to the owning user’s inbox. The home-server then decides whether this is allowed and sends an https://www.w3.org/ns/activitystreams#Update to the owning user’s followers as required. :slight_smile:


#3

Trying to adapt the Add example below.

Not sure if Tag or Note is the object, but the description of Add says the following, which sounds to me like Tag is the object and Note that target.

[Add:] Indicates that the actor has added the object to the target . […]

So, maybe like this?

{
  "@context": {
     "@vocab": "https://www.w3.org/ns/activitystreams",
     "tag": "https://tag.ns/"
  },
  "summary": "$OTHER_USER tagged $OWNING_USERS note",
  "type": "Add",
  "actor": {
    "type": "Person",
    "name": "$OTHER_USER"
  },
  "object": {
    "type": ["Object", "tag:Tag"],
    "name": "iamtag",
    "tag:foo": "bar"
  },
  "target": {
    # "id": ...?
    "type": "Note",
    "name": "Random Note"
  }
}

#4

I will now do it this way:

Array
(
    [@context] => Array
        (
            [0] => https://www.w3.org/ns/activitystreams
            [1] => https://w3id.org/security/v1
            [2] => Array
                (
                    [vcard] => http://www.w3.org/2006/vcard/ns#
                    [dfrn] => http://purl.org/macgirvin/dfrn/1.0/
                    [diaspora] => https://diasporafoundation.org/ns/
                    [litepub] => http://litepub.social/ns#
                    [manuallyApprovesFollowers] => as:manuallyApprovesFollowers
                    [sensitive] => as:sensitive
                    [Hashtag] => as:Hashtag
                    [directMessage] => litepub:directMessage
                )

        )

    [id] => https://pirati.ca/objects/ec054ce7-145c-e97c-a866-859124298411#Add
    [type] => Add
    [actor] => https://pirati.ca/profile/heluecht
    [published] => 2019-05-25T17:34:32Z
    [instrument] => Array
        (
            [type] => Service
            [name] => Friendica 'Dalmatian Bellflower' 2019.06-rc-1313
            [url] => https://pirati.ca
        )

    [to] => Array
        (
            [0] => https://squeet.me/profile/test1
        )

    [cc] => Array
        (
        )

    [inReplyTo] => https://squeet.me/objects/962c3e10-105c-e940-83a2-40d233933395
    [diaspora:guid] => ec054ce7-965c-e97c-a866-8a2646485868
    [target] => https://squeet.me/objects/962c3e10-105c-e940-83a2-40d233933395
    [summary] => Michael Vogelhat -test1-s Statusmit ⌗test1getaggt
    [object] => Array
        (
            [id] => https://pirati.ca/search?tag=test1
            [type] => tag
            [name] => test1
            [content] => test1
        )

    [signature] => Array
        (
            [type] => RsaSignature2017
            [nonce] => b5576b0ea031eabefdc3f07244f5e05fa6a4444193c32879c4629ead094dd604
            [creator] => https://pirati.ca/profile/heluecht#main-key
            [created] => 2019-05-25T19:21:38Z
            [signatureValue] => exA9zCgo6AcemBqzR0SB7Tpm9NzWQsD/64ABOkXqQy6KcIUoxzzHMLkCIYHOoQ2eQ+SQ+KKxqFThT6AzuAvMVCrDm481dQBVqposKac62g/LNrIDMZOqr9IDBIAs9hHWZdd9IRxKksVaxGA2CueRdMEP68bRGlAfMlSYawhPLtiCl1Ln1WK2WTVYtxXtOX1UB7XvhISlCirMx/Tp1bzzPpH8UI14If6gd7nlbQWtuT5qAxIBGudsX7Jwp/jeEuYdfcq6ZKZ3cGpBExF+ksTNIUdApemRHYEIELRHvIAY7xWJpRjiIBr6A7Gv52labdb5mFiPxQPdMW2TNC/xlm1hWL0Jf8c4+OCqynHcw2tNSQGcXhQnWfSFt9Oqiy8/E0pGP8lQtRg3uL7/TzDKETTBQkYyHX+7D4NU+kITa7/Pq3A1QG2gZsrbhUMBY4VSnVatH3v158WgEm5fm2F9EqGShOh2pY0fRGHH2pKlDLyDVaXQO2ZbIFu6VaIKcn52WpdRpevqUWLHPkJRIuu+8c7jZEk5Ac/kWbz2xQ6ib0QT5iJeP2yYH6mVdwKJyoERSOH+9AqtMGBmjnJI7zgpMUGLbKOlEPlInA/mSg2wRkLFRw1qA/3RUwWbsaCcbXtedvPJU/Pb4J9W3bdeSq7D9CoGhzBWJ4NjKrvJLYfBal07XfA=
        )
)