Creating private and public content with Stream Feeds is simple enough, but requires diving private and public content between two feeds and controlling who views and follows different content.
Create a Public, Private, and User Feed Group
You'll need three feed groups here to separate the content of the feeds and help to organise the activities. It will also allow us to add different permissions to the feed groups so that content is not exposed where it shouldn't be.
- Private Feed will be only readable by the User and will contain the content deemed to be private
- Public Feed will contain content that is deemed viewable globally
- User Feed will also be private because it will contain both the Private and Public feed content.
Learn more about Permissions with Feeds here.
This tutorial will explain two follow relationships.
- In order for the user to be able to view both their private and public content, the User feed should follow both the Private and Public Feeds
- Another user who wishes to follow a user should follow their Public feed only. This way, any content added to the Public feed is fanned out to the followers, but never private content.
Toggling Private <> Public content
When changing an activity from Private to Public, it can be done so with a simple update to the activity, specifically to the TO field. By adding the Public feed to the TO field when switching an activity from Private to Public, it will copy the activity from the Private to the Public feed and will trigger fan-out processes in the Public Feed.
Fortunately, due to the de-dup logic with Stream, the content will not appear in the User feed twice.
Here is the documentation on targeting with the TO field.
Please sign in to leave a comment.