stream-laravel icon indicating copy to clipboard operation
stream-laravel copied to clipboard

adding to diffrent feeds

Open maidul98 opened this issue 6 years ago • 3 comments

I know that when you create a new post, it adds to the user feed by default. When the post is created, I also want to add it to certin categories. For instance, if the post they are creating is under under catifgory X, I want to add to the feed of category X. This way peopel can follows categories. How would I do this? Thank you.

maidul98 avatar Dec 30 '18 01:12 maidul98

Ha, I'm trying to figure out the same thing and it's really unclear. I can only see information about doing that manually.

ow avatar Jan 09 '19 13:01 ow

You can do this with the activity to targeting field. If you use the activity trait you can get that done by implementing the activityNotify method and return the list of feeds the activity should be copied.


public function activityNotify()
    {
        if (...) {
            return ['category:1', 'category:2', ...];
        }
    }

tbarbugli avatar Jan 10 '19 08:01 tbarbugli

@tbarbugli thanks - I had figured this out after writing the comment. What's still remains unclear to me is whether this should be a second activity add being fired, or if it should be on the initial one where it's added to the user timeline? I'm firing two activity add events, setting the foreign keys on both, but seeing duplicates when the user subscribes to follow both a user and category.

ow avatar Jan 10 '19 08:01 ow