public override void Execute() { // if (HandlePromptCommands()) // { // return; //special prompt handling // } base.Execute(); Logger.Instance.Debug($"action privacy is {activity.RawActivity.privacy} and given in parameter : {reqParams.auth_view}"); if (string.IsNullOrEmpty(activity.RawActivity.privacy)) { activity.RawActivity.privacy = reqParams.auth_view; //will fix this in fb posts activityModified = true; } HandleFBUserPosts(); HandleFBLinks(); HandleFBVideos(); //check if the post contain interesting source like fb page CheckForSources(); if (activityModified) { ActivityActions.Update(activity.RawActivity); } //return the feed Logger.Instance.Debug($"returning the feed"); GetFeedHandler getFeedHandler = new GetFeedHandler(userId, reqParams); getFeedHandler.Execute(); Response = getFeedHandler.Response; }
public override void Execute() { Logger.Instance.Debug($"Sharing activity {reqParams.action_id} by user:{userId}"); activity.Source.ActivityFeed.AdvanceActivity(activity); activity.RawActivity.modified_date = DateTime.Now; ActivityActions.Update(activity.RawActivity); if (activity.IsShare) { //we want to share the primary activity = activity.InnerActivity; } var share = CreateRefActivity(ActivityType.Share); userSource.ActivityFeed.AddActivity(share); SendNotifications(); LikeSourceIfPossible(activity.EffectiveSubjectId, activity.EffectiveSubjetType); }
public override void Execute() { SetReqParamsDefaults(); CheckIfRefExists(out ActivityAction refActivityAction, out object activityRecord); Activity refActivity = null; if (refActivityAction == null) { //adding new referenc activity IncreaseCount(); activity.Source.ActivityFeed.AdvanceActivity(activity); // advance the activity that is reference in it's ownr's feed activity.RawActivity.modified_date = DateTime.Now; ActivityActions.Update(activity.RawActivity); //update DB refActivity = CreateRefActivity(type); userSource.ActivityFeed.AddActivity(refActivity); AddUpdateRefItemToSource(refActivity.RawActivity, reqParams.reaction); AddRefToTable(); SendNotifications(); LikeSourceIfPossible(activity.EffectiveSubjectId, activity.EffectiveSubjetType); } else { //update content of existing activity reference Logger.Instance.Debug($"Update content of existing activity {refActivityAction.action_id}"); activity.Source.ActivityFeed.AdvanceActivity(activity); // advance the activity that is reference in it's ownr's feed activity.RawActivity.modified_date = DateTime.Now; ActivityActions.Update(activity.RawActivity); //update DB refActivity = ActivityCache.Instance.Get(refActivityAction.action_id); refActivity.RawActivity.body = GetRefBody(); AddUpdateRefItemToSource(refActivity.RawActivity, reqParams.reaction); UpdateActionInDB(refActivity.RawActivity); UpdateRefInTable((Like)activityRecord); } }
protected void UpdateActionInDB(ActivityAction rawActivity) { ActivityActions.Update(rawActivity); }