Try our conversational search powered by Generative AI!

Wrong NewsFeedStory returned by NewsFeedHandler

Vote:
 

The problem accurs when i try to get the storys of the current users friends by using NewsFeedHandler.GetNewsFeed. This i what I do:

First I remove all previous storeys like this: 

int totalItems;

 

NewsFeedStoryCollection newsFeedStories2 = NewsFeedHandler.GetNewsFeed(DisplayUser, null, startTime, stopTime, 1, 200, out totalItems);

foreach (var storey in newsFeedStories2)
{
NewsFeedHandler.RemoveStory(storey);
}
 Then I  add a new story with an attachment to a friend of "displayuser"  like this:
var storyAttachments = new EntityCollection();
storyAttachments.Add(ForumHandler.GetTopic(587));
NewsFeedStory story =
new NewsFeedStory(NewsFeedHandler.GetAction(Web.Properties.Settings.Default.ActionForumTopicReply), testUser,
storyAttachments, ClubHandler.GetClub(26));
story.ActionDate = DateTime.Now;
NewsFeedStory storytest = NewsFeedHandler.AddStoryToActorFeed(story);
int id = storytest.ID;

The last line returns an id of 1230.

Then I get all storeys for friends of "displayuser" like this:

NewsFeedHandler.GetNewsFeed(DisplayUser, null, startTime, stopTime, 1, 200, out totalItems);
The collection returned contains one story with the correct Club, but the id of the story is now 1233 and it does not have any attachments. If I get the story directly by using "NewsFeedHandler.GetStory(1230);" it returns the story with the correct club and attachment. 
Any help is appreciated,
Regards,
Mikael
 

 

#32798
Sep 17, 2009 22:34
Vote:
 

Which version is this? I know some version had an issue with attachments not being properly associated with aggregated stories.

 

With regard to  the differing IDs, I think that is normal. The story in that user's Newsfeed is a (potentially) aggregated version of the story you added to the actor feed ("mini feed") of one of their friends.

#32806
Sep 18, 2009 9:12
Vote:
 

 

Hi Håkan,
It is version 3.2.0.191 of the community. We will try to update to the latest sp during next week to see if that helps.

I have a similar problem when I am trying to put attributes on the newsFeedStorey. I can access the attribute if I fetch the storey directly. But when using the method getNewsFeed() to get the storey I cannot access the attribute. It is most probably related to the same issue.

Thx for your help,
/Mikael

 

#32815
Sep 18, 2009 13:55
Vote:
 

Yes, upgrading to the current version should resolve the issue you are experiencing with the attachments.

Regarding the attributes, that is different situation. It is in fact not the same story that you get out of the aggregated newsfeed as you originally added to the actor feed (mini feed) and thus it does not share the attributes.

#32879
Sep 22, 2009 14:45
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.