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

Add REST API for managing and posting to circles #14354

Closed
wants to merge 2 commits into from
Closed

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Jul 19, 2020

Circles are the conceptual opposite of lists. A list is a subdivision of your follows, a circle is a subdivision of your followers. Posting
to a circle means making content available to only some of your followers. Circles have been internally supported in Mastodon for
the purposes of federation since #8950, this adds the REST API necessary for making use of them in Mastodon itsef.

Side note: Regardless of whether or not #12385 will ever be implemented, this is a prerequisite for that kind of system. Technically people could manually manage paid tiers of content this way already...

Circles are the conceptual opposite of lists. A list is a subdivision
of your follows, a circle is a subdivision of your followers. Posting
to a circle means making content available to only some of your
followers. Circles have been internally supported in Mastodon for
the purposes of federation since #8950, this adds the REST API
necessary for making use of them in Mastodon itsef.
@Gargron Gargron added the api REST API, Streaming API, Web Push API label Jul 19, 2020
@trwnh
Copy link
Member

trwnh commented Jul 19, 2020

to avoid confusion, can they be called "audiences"?

@Gargron
Copy link
Member Author

Gargron commented Jul 19, 2020

I won't deny that both "circles" (popularized by Google Plus) and "aspects" (popularized by Diaspora) are not self-explanatory terms, so an alternative might be necessary. On the other hand, they did get popularized already (to some extent). I'm not a native English speaker but "audiences" sounds odd to me when pluralized. Perhaps something with more words would be easier to understand? Follower group? Follower bracket? Borrowing from Patreon, follower tier? Audience tier? (That one might get confused with public/unlisted/private/etc though)

@ClearlyClaire ClearlyClaire self-requested a review July 19, 2020 10:22
@trwnh
Copy link
Member

trwnh commented Jul 19, 2020

"Create an audience" and "Post to this audience" sound clear to me in English. "Audiences" doesn't sound weird to me as a native English speaker.

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's something I've been wanting to implement for a while but couldn't get what your stand on this was, but also I have a few other concerns with.

In addition to the few remarks (including one which I think points to a bug), I have a few concerns:

  • performances: storage-wise and federation-wise, posting a toot to a circle is functionally equivalent to writing a DM mentioning each of the circle's users, so i'm afraid this could be expensive with large circles
  • UX: clients will see such messages as followers-only, not knowing they were intended for a subset of the followers, which may or may not be fine (e.g. you don't necessarily want recipients to know which circles they are part of; but on the other hand, as a poster you may want to know who you have posted a toot to)
  • downgrade through reply: an extension of the issue above is that, since each client sees the toot as a followers-only toot, any reply to it will be sent as followers-only, effectively downgrading the privacy of the thread. This is similar to the issue we have with followers-only, except this time even a self-reply or a round-trip is, by default, a downgrade.
  • compatibility with Pleroma: I think a while ago, Pleroma started implementing something similar. I think it worked in much the same way, but repurposed lists instead, and had special visibility to list:id instead of a new circle attribute
  • API: which makes me think of, the circle being an extra parameter plays weridly with visibility scopes. furthermore, this doesn't seem to be part of the reblog endpoints either

Comment on lines +25 to +27
def set_follow
self.follow = Follow.find_by!(target_account_id: circle.account_id, account_id: account.id)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If follow is deleted, this record will also be deleted

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right, it's not null and on_delete: cascade in the SQL… though… why is it marked as optional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... maybe that’s a mistake.

@@ -67,7 +70,7 @@ def process_status!
end

process_hashtags_service.call(@status)
process_mentions_service.call(@status)
process_mentions_service.call(@status, @circle)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly awkward, at first I thought this didn't make sense, but given that we're implementing that through “silent mentions”… i guess this does make sense.

Comment on lines +45 to +49
if circle.present?
circle.accounts.find_each do |target_account|
status.mentions.create(silent: true, account: target_account)
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this fail if someone from the circle is also explicitly mentioned? Because of the uniqueness constraint to mentions.

Copy link
Contributor

@noellabo noellabo Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is not added to the mentions, it will not be create_notification().

mention = target_account.mentions.new(status: status, silent: true)
mentions << mention if mention.save

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. In addition, create_notification is kind of a misnomer because it handles both notifications and AP federation. In this case we probably do not want notifications (unless explicit mention), but we want to federate through AP.

@noellabo
Copy link
Contributor

CIrcleSerializer is missing. b83e87a655aa5907ad9d076fac1da9fcf9c37c99

@noellabo
Copy link
Contributor

After thinking for a while, I put together my thoughts.

Mastodon, which does not support reply to limited visibility, has no choice but to allow downgrade to private. Pleroma recognizes it as direct visibility.

I think it is possible to build a mechanism to forward and redistribute a reply tree to limited status in Mastodon in the future, but it is a little complicated and it is difficult to make it compatible with Fediverse.

In that case, I think it is correct to handle the reply to limited status as direct visibility in Composer of WebUI and move to DM.

We changed the API to report limited visibility to clients as direct, and the limited flag compensates for this. Unlike direct, it will deliver to the home timeline instead of conversations.

In summary, the circle feature can deliver messages and content to a wider area than DM without revealing the destination. And you can receive the reaction directly by DM. It will be useful because it has different conveniences from DM.

On the other hand, the mechanism for sharing the member list and posting to all members can be covered by the group feature centered on the Group Actor. Group features and circle features are similar, but we should use them properly.

For circles, design decisions should be made about what to do and what not to do. I think keeping each function simple will be more widely accepted and used.

@ClearlyClaire
Copy link
Contributor

Yeah, I basically see two ways to move forward with circles:

  • handle replies as DMs, as you suggested: it's not super satisfactory because Circles are then completely one-way. Furthermore, current Mastodon versions will handle such toots as followers-only, not DMs. Finally, receiving a DM-like object without being in the explicit mentions reveals that you're in a Circle.
  • handle circles as “anonymous groups”: followers-only and circle posts would be addressed to anonymous groups owned by the original author, and replies would be (by default) addressed to the group. Participants know who owns the group, and know that the group stay the same along a thread, but nobody but the group owner knows who's in the group. This means groups-based followers-only posts and circle-posts are indistinguishable, and that the audience is not accidentally widened (and when it is widened, people can easily notice). However, people replying cannot know who they are replying to and cannot restrict that to fewer people than who's in the original group (or at least, I do not know how we could do that). How, technically, to forward the toot to the group's members isn't technically obvious either (LDSigning would work, but it means the message would carry a proof of authorship which is not easily revokable, so that's something we want to avoid if possible).

@noellabo
Copy link
Contributor

The circle_id is not recorded in the status, so the circle cannot be reselected during redraft or self reply.
I think it's better to save the circle_id in the owned status.

@noellabo
Copy link
Contributor

Circle.title is only used visually, but I think it should be unique for identification purposes.

@stale
Copy link

stale bot commented Nov 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/wontfix This will not be worked on label Nov 23, 2020
@Gargron
Copy link
Member Author

Gargron commented Nov 23, 2020

Un-stale it, bot.

Base automatically changed from master to main January 20, 2021 10:31
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/wontfix This will not be worked on label Jun 2, 2021
@stale stale bot closed this Jun 9, 2021
@Gargron Gargron deleted the feature-circles branch August 10, 2023 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api REST API, Streaming API, Web Push API status/wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants