Helge's blog

by helge@mymath.rocks

Powered by longhorn, an ActivityPub Client based blog. This means an existing Fediverse account is used to federate blog entries. The entire thing is based on bovine and the corresponding ActivityPub server.

Atom Feed

Posts

BIN-4 Quotes

In this new Bovine Implementation Note, I will discuss how I’m handling quotes in longhorn, the ActivityPub Client this blog runs on. This discussion is based on my thoughts in Thoughts on oEmbed and quoting. In particular, I will disucss how the quoting notification problem is solved in longhorn. One issue that is not solved by this implementation is enabling posters to mark their posts as not quotable. This cannot be solved here, as first such a mark must be set by the posters. Finally, I only ensured that this implementation works well together with Mastodon so far.

Demonstration

I will start by demonstrating the feature:

This should show an embedding of a post, I made with one of my Mastodon accounts.

The above paragraph was generated by the code:

I will start by demonstrating the feature:

{{https://mas.to/@themilkman/110168493759260914}}

This should show an embedding of a post, I made with one of my Mastodon accounts.

If you view this on a FediVerse application (other than my longhorn blog), what you will see is

I will start by demonstrating the feature:

RE: https://mas.to/@themilkman/110168493759260914

This should show an embedding of a post, I made with one of my Mastodon accounts.

Furthermore, the ActivityPub object will contain an object link as defined in FEP-e232. This means the tag contains:

      {
        "type": "Link",
        "mediaType": "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
        "href": "https://mas.to/users/themilkman/statuses/110168493759260914",
        "name": "RE: https://mas.to/@themilkman/110168493759260914"
      }

Finally, my account themilkman@mas.to will receive a message such as:

You have been quoted

Your post https://mas.to/@themilkman/110168493759260914 has been quoted on
https://blog.mymath.rocks/2023-04-09/bin4-quotes.

This Event was generated by longhorn
(https://codeberg.org/helge/longhorn) to inform you.

https://blog.mymath.rocks/2023-04-09/bin4-quotes

This is all that happens. I will now go over it, explaining the process that happens.

The quoting process

First, publishing something in longhorn takes a markdown file as input. The markdown is then transformed into the published post on my blog, and the federated Article object, that you can view on your FediVerse service. So the first step is just parsing the double braced link from the markdown file into quotes to replace. I haven’t gotten around to write a python-markdown extension to do this yet. That’s why written double braces not turning into quotes is awkward at the moment.

Second, a MastodonQuoter is created for each found quote url. For each url the following steps are taken:

Third, the replacements in the formatted text are made. For this, in the HTML shown on longhorn the double braced url is replaced by the oEmbed HTML, for the Article object that is being federated, the double braced url is replaced by RE: <url>.

Fourth, the objects are being federated. This means both the Article object and the Events.

Next steps

I have not investigated how most FediVerse applications render Article objects, it might be that some already transform objects containing RE: <url> into an embedded toot. If not, this would be the next step towards interoperability of this approach to quoting. I hope that by providing one possible solution on how quoting might work, more people will continue to explore it to arrive at a good solution. Furthermore, I now have a new way to reply to single or multiple posts on the FediVerse in longform.

@silverpill@mitra.social wrote at 2023-04-09 13:22 UTC
@h

>An Event Object notifying the author is created.

Event object type is used by software like Mobilizon to represent meetings, conferences etc. Not sure what other platforms do, but I transform incoming Event into a post with a link to the original object.
helge@mymath.rocks wrote at 2023-04-09 14:31 UTC
This currently is not a problem as the oembed API this feature is only supported by Mastodon. It also seems relatively old. I'm not sure how much interest there is in it as a feature.

The optimal solution here would be to have a Notify type activity. Introducing it is not an option if one wants to be compatible with the current FediVerse. It should probably done, once this type of feature gains momentum.

You can reply to this post using your favorite FediVerse Application. For this look up the object
https://mymath.rocks/objects/c668df4b-ddeb-4ab6-993d-fc3d1fc861e0
in it and just reply. Depending on how your FediVerse Application handles Articles, this post may appear different.