I want to add stories to a users newsfeed that will show up in the user's newsfeed but not in the news feeds of any of the users friends etc. Example: I want to create a story when the user receives a direct message so that the user is notified about this in the newsfeed, but of course no other users than the recipient should see this.
Is this possible somehow? Is it possible with the minifeed? In that case I guess I could get the desired actions from the minifeed and mux them into the newsfeed.
Of course I could filter out these stories when they are not for the logged in user, but post-filtering breaks all paging etc and can create some messy logic (if not enough items to show after filtering - get som more - filter - try again...)
I haven't play around NewsFeed module so much and haven't try approach I'm providing now, but maybe it's possible to publish "private" neews feed story by providing that logged-in user as story's target?
NewsFeedStory story = new NewsFeedStory();story.Targets.Add(CurrentUser);story = NewsFeedHandler.Instance.AddStory(story);
Yeah, I thought of something like that too. I add the story with the user as target, and don't publish the story on neither the newsfeed nor the minifeed. Then I can use the GetNewsFeedStoriesByTarget method to get them and mux them with the other newsfeed stories. I'll try it some time.
Cool. Please post results cause we'll need that soon as well.
Then I suggest you try it yourself because it was cut from my current sprint so I don't know when I will get time to test it.
However, I already have a similar workflow where users "follow" clubs. In that case news feed stories are added with the club as target and based on the users club "follows" I use GetNewsFeedStoriesByTarget to get those stories and mux them into the users newsfeed. It works, but of course thre's a risk it can be bad for performance if users follow many clubs.