Try our conversational search powered by Generative AI!

"Private" NewsFeedStory - possible?

Vote:
 

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...)

#56024
Dec 30, 2011 11:02
Vote:
 

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);
 

#56462
Jan 21, 2012 22:39
Vote:
 

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.

#56463
Jan 23, 2012 8:53
Vote:
 

Cool. Please post results cause we'll need that soon as well.

#56464
Jan 23, 2012 9:09
Vote:
 

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.

#56465
Jan 23, 2012 9:19
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.