0

I plan on adding visibility to posts with values (private, friends, public) to allow users to keep posts private, share with friends or share them publicly. Visibility must be used for filtering activities before pagination.

Where does the visibility property go, on the activity or on the model or both? if on both, how are edits to visibility handled?

SimoAmi
  • 1,696
  • 14
  • 13

1 Answers1

0

You could send the visibility in the metadata of the activity as you sent it to Stream. If you also include a foreign ID (an ID value that means something to your application), then you can perform an update on that activity later to change its visibility.

iandouglas
  • 4,146
  • 2
  • 33
  • 33
  • 1
    Thanks @iandouglas, so basically you're saying to have the visibility on both the foreign model if any and the activity. Then on edit, update the model and its corresponding activity? btw, it's confusing to me why someone would need a foreign model to map to an activity. – SimoAmi Jan 08 '17 at 23:56
  • It depends on which SDK you're using from Stream. Some of them handle the update (those with ORM support built in like stream-rails, stream-laravel, etc), some have to be done manually (usually the lower-level language-based libraries like stream-python, stream-ruby, stream-php, etc). – iandouglas Jan 09 '17 at 01:16
  • Would it be possible for Stream to filter by visibility? the idea is for timeline feeds to return public, friends and private activities for owners, public and friends activities from friends (followers), and only public for the rest. It seems to me like this is important functionality for a framework to have. – SimoAmi Jan 09 '17 at 02:26