Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for comments based on ActivityPub (podcast:socialInteract) #7078

Open
4 tasks done
dellagustin opened this issue Apr 10, 2024 · 16 comments · May be fixed by #7127
Open
4 tasks done

Support for comments based on ActivityPub (podcast:socialInteract) #7078

dellagustin opened this issue Apr 10, 2024 · 16 comments · May be fixed by #7127
Assignees
Labels
Area: Podcast Index / Podcasting 2.0 Anything related to PodcastIndex.org and/or Podcasting 2.0 Needs: Triage The core team still needs to decide if this feature would get accepted Type: Feature request

Comments

@dellagustin
Copy link

dellagustin commented Apr 10, 2024

Checklist

  • I have used the search function for OPEN issues to see if someone else has already submitted the same feature request.
  • I have also used the search function for CLOSED issues to see if the feature was already implemented and is just waiting to be released, or if the feature was rejected.
  • I will describe the problem with as much detail as possible.
  • This request contains only one single feature, not a list of multiple (related) features.

App version

3.3.2

Where did you get the app from

Google Play

Problem you may be having, or feature you want

I would like be able to comments on podcast episodes and also see and reply to existing comments on podcast episodes.

Suggested solution

There are some existing support for comments on RSS 2.01 and RSS extension namespaces (reference needed). Most recently, the Podcasting 2.0 podcast namespace introduced the tag podcast:socialInteract2. Among other things, the main function of this tag is to enable support for distributed comments for episodes through the ActivityPub protocol. This enables listeners to comment on episodes from any ActivityPub enabled instance, such as Mastodon instances, meaning that podcast comments will be part of the so called Fediverse (https://fediverse.info/, https://axbom.com/fediverse/).

AntennaPod could use this to show comments for podcast episodes and also allow, with different functional degrees, that users would also author comments and reply to existing comments.

Screenshots / Drawings / Technical details

Screenshots

Comments shown on podcastindex.org for one of the episodes of the Podcasting 2.0 podcast:
image

Comments shown on Podverse for one of the episodes of the Podcasting 2.0 podcast:
image

Technical Details

The XML tag podcasting:socialInteract 2 can be used under the RSS <item> tag as in the example:

<podcast:socialInteract 
        uri="https://podcastindex.social/web/@dave/108013847520053258" 
        protocol="activitypub"
/>

Although there are other protocols that can be used, activitypub indicates that the URL indicated on the uri parameter points to an ActivityPub Activity, usually a Note. This Activity is considered a root comment, and all the other comments will be either replies to this comment, or replies to replies, forming a (possibly deep) tree.

A brief word on ActivityPub: It provides two APIs, a Client to Server (C2S) one and a Server to Server (S2S) one. The S2S one is predominantly more mature in the ecosystem, as it is required for interoperability between servers. The C2S is far less mature and, in certain aspects, underspecified. The interoperability between Clients and Servers often falls back to the Mastodon API. Nevertheless, a combination of ActivityPub C2S and Mastodon APIs is currently the only known way in use to generally fetch comments for a cross-app comments.

Fetching the comments

To fetch comments, one can fetch the Activity url of the root post, with the header Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams". Here is an example of a response body:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "ostatus": "http://ostatus.org#",
      "atomUri": "ostatus:atomUri",
      "inReplyToAtomUri": "ostatus:inReplyToAtomUri",
      "conversation": "ostatus:conversation",
      "sensitive": "as:sensitive",
      "toot": "http://joinmastodon.org/ns#",
      "votersCount": "toot:votersCount"
    }
  ],
  "id": "https://podcastindex.social/users/dave/statuses/110634382833124876",
  "type": "Note",
  "summary": null,
  "inReplyTo": null,
  "published": "2023-06-30T17:38:30Z",
  "url": "https://podcastindex.social/@dave/110634382833124876",
  "attributedTo": "https://podcastindex.social/users/dave",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "cc": [
    "https://podcastindex.social/users/dave/followers"
  ],
  "sensitive": false,
  "atomUri": "https://podcastindex.social/users/dave/statuses/110634382833124876",
  "inReplyToAtomUri": null,
  "conversation": "tag:podcastindex.social,2023-06-30:objectId=7365466:objectType=Conversation",
  "content": "<omitted>",
  "contentMap": {
    "en": "<omitted>"
  },
  "attachment": [],
  "tag": [],
  "replies": {
    "id": "https://podcastindex.social/users/dave/statuses/110634382833124876/replies",
    "type": "Collection",
    "first": {
      "type": "CollectionPage",
      "next": "https://podcastindex.social/users/dave/statuses/110634382833124876/replies?only_other_accounts=true&page=true",
      "partOf": "https://podcastindex.social/users/dave/statuses/110634382833124876/replies",
      "items": []
    }
  }
}

Fetching the replies recursively, it is possible to build the full tree of comments.
The comments are public and do not require authentication.

Known quirks:

  • Pleroma does not return replies with the AP C2S API, but it does with the Mastodon API3
  • Older versions of Mastodon will "loop" around the responses, so it is necessary to have a stop criteria when it starts a new loop (back again to the first item)4

References

Footnotes

  1. Embeddable comments defined in RSS 2.0: https://www.rssboard.org/rss-weblog-comments-use-case

  2. podcasting:socialInteract tag specification - https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#social-interact 2

  3. Pleroma issue about empty replies on ActivityPub C2S API Chttps://git.pleroma.social/pleroma/pleroma/-/issues/3061

  4. Mastodon issue https://github.com/mastodon/mastodon/issues/17442 (list item 4 describes the infinite loop)

@dellagustin dellagustin added Needs: Triage The core team still needs to decide if this feature would get accepted Type: Feature request labels Apr 10, 2024
@dellagustin

This comment was marked as resolved.

@keunes keunes added the Area: Podcast Index / Podcasting 2.0 Anything related to PodcastIndex.org and/or Podcasting 2.0 label Apr 10, 2024
@keunes
Copy link
Member

keunes commented Apr 12, 2024

Thanks for posting this @dellagustin. Some discussions on the approach are to be had, I think. One approach is AntennaPod becoming an AP client, another is to recognise the existence of the tag and opening it in dedicated apps.

And a key point is Google's requirements when UGC is concerned: Tunous/Dawn#642

@dellagustin
Copy link
Author

Thanks for posting this @dellagustin. Some discussions on the approach are to be had, I think. One approach is AntennaPod becoming an AP client, another is to recognise the existence of the tag and opening it in dedicated apps.

And a key point is Google's requirements when UGC is concerned: Tunous/Dawn#642

Thank you for the reply. Sure, I suppose we will need a lot of discussion on many aspects of this feature. I'm hoping that we will be able to enable Antennapod as a AP client, but let's see. I'll check the UGC topic, I need to learn more about that.

@tonytamsf
Copy link
Member

@keunes I am interested in working on this feature.

What do you think of

Phase 1:

  1. Displaying comments only threaded mode

Phase 2:

  1. Allow to jump to an external website for posting comments, no need for auth inside of AP

Phase 3:

  1. Allow for posting comments directly inside of AP, figure out a way to store login credentials in AP

@ByteHamster
Copy link
Member

To be honest, in order to hopefully get fewer problems with UGC things on Google Play, I would just open that URL in a web browser instead of showing user comments directly inside AntennaPod

@dellagustin
Copy link
Author

dellagustin commented Apr 20, 2024

@tonytamsf , @keunes , @ByteHamster , I can't comment on the do's and don'ts of User Generated Content (UGC) at the moment due to lack of knowledge and experience with the topic, but I'm hoping to familiarize myself with it in the near future.

That said, and assuming we eventually conclude there is a safe way to show UGC in the app, my suggestion for the phased approach would be:

  1. Phase 1: Show the link to navigate to comments (no issue with UGC)
    • For this phase we could support both <podcast:socialInteract> and the RSS 2.0 native <comments>1 tags.
  2. Phase 2: Show the comments thread in AntennaPod + a link to open the links and comment outside of AntennaPod
    • There is an optional workflow here that would make easier to comment, but I'll need to elaborate how it works later
  3. Phase 3 Allow posting comments directly from AntennaPod

I'd be already happy with Phase 1, as it would raise awareness and curiosity towards ActivityPub based comments and the Fediverse, which I think resonates very well with the distributed and open nature of the podcasting ecosystem.

Nevertheless, I think it would be great if we could go beyond and also support Phase 2 and 3 eventually.

Footnotes

  1. RSS 2.0 Specification - Elements of

@tonytamsf tonytamsf self-assigned this Apr 20, 2024
@tonytamsf
Copy link
Member

To be honest, in order to hopefully get fewer problems with UGC things on Google Play, I would just open that URL in a web browser instead of showing user comments directly inside AntennaPod

If it's simply displaying a link to the commenting, I can work on this. @keunes thoughts on where to put the link? next to the Transcript and favorite icons on the player screen? Or off to a menu drop down?

@keunes
Copy link
Member

keunes commented Apr 21, 2024

next to the Transcript and favorite icons on the player screen?

Sounds good. I think we should also add it to the podcast detail view, somehow. Maybe in the top app bar as well?

What might be cool (but no idea how complex this is) is to show a bubble with a number, indicating the number of replies.

@tonytamsf
Copy link
Member

Sounds good. I think we should also add it to the podcast detail view, somehow. Maybe in the top app bar as well?

Where would you place the link? I can show you a work in progress soon.

@dellagustin
Copy link
Author

dellagustin commented Apr 21, 2024

I think the link should be:

  • On the player view, I don't know exactly where, without cramming it. Perhaps as a new icon on the top. Where is the transcript currently show? I could not find that.
  • AND On the episode view, ideally somewhat prominently, either an icon on the top or a new button together with Stream / Download?

Sorry, I'm not familiar yet with the terminology used in AntennaPod for the UI elements.

I think we should also add it to the podcast detail view, somehow

To the podcast detail view? I'm not sure I understood, but comments are so far are on episode levels, not podcast level. Nevertheless, in the future I hope that there will be a tag pointing to the ActivityPub Actor that represents the podcast.

What might be cool (but no idea how complex this is) is to show a bubble with a number, indicating the number of replies

It would be cool, but not practical to implement. To get the number of comments would mean fetching and counting all replies, that would require a good number of HTTP requests.

@keunes
Copy link
Member

keunes commented Apr 21, 2024

Where would you place the link? I can show you a work in progress soon.

To the podcast detail view? I'm not sure I understood, but comments are so far are on episode levels, not podcast level.

Sorry, I meant episode detail view indeed. Same icon and placing as in the player.

@tonytamsf
Copy link
Member

Where would you place the link? I can show you a work in progress soon.
To the podcast detail view? I'm not sure I understood, but comments are so far are on episode levels, not podcast level.

Sorry, I meant episode detail view indeed. Same icon and placing as in the player.

@dellagustin FYI I have started a PR for this feature #7127

@ByteHamster
Copy link
Member

We have to come up with a different way to access the comments. We can't just keep adding more and more icons to the toolbar (both for the player and the episode details page). With two more buttons (transcripts, comments), we already have too many buttons to display them on smaller screens.

Currently, the metadata (chapters, description) is displayed as buttons below the cover. I think comments (and transcripts) would better fit there as buttons. Currently the buttons in the top are control buttons, not really metadata display buttons.

@keunes
Copy link
Member

keunes commented Apr 22, 2024

We have to come up with a different way to access the comments. We can't just keep adding more and more icons to the toolbar (both for the player and the episode details page).

I would agree, but that I think would require a big UI restructuring. I did make a proposal for the player screen in the past, based on user feedback: https://forum.antennapod.org/t/user-feedback-swipe-navigation-from-player-screen-2-3-beta/1119

Maybe it's time to look at this again?

@dellagustin
Copy link
Author

Currently, the metadata (chapters, description) is displayed as buttons below the cover. I think comments (and transcripts) would better fit there as buttons. Currently the buttons in the top are control buttons, not really metadata display buttons.

One remark, as I user I sometimes would like to access these type of metadata without being listening to the episode, so it would be good if I could somehow reach it from the episode view, as well as from the player.

@tonytamsf
Copy link
Member

Makes sense, the link is in both views in my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Podcast Index / Podcasting 2.0 Anything related to PodcastIndex.org and/or Podcasting 2.0 Needs: Triage The core team still needs to decide if this feature would get accepted Type: Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants