public static function extendActivity(Notice $stored, Activity $act, Profile $scoped = null) { // the original notice id and type is still stored in the Notice table // so we use that information to describe the delete activity $act->target = new ActivityObject(); $act->target->id = $stored->getUri(); $act->target->type = $stored->getObjectType(); $act->objects = array(clone $act->target); $act->title = ActivityUtils::verbToTitle($act->verb); }
public static function extendActivity(Notice $stored, Activity $act, Profile $scoped = null) { $target = self::getTargetFromStored($stored); // The following logic was copied from StatusNet's Activity plugin if (ActivityUtils::compareTypes($target->verb, array(ActivityVerb::POST))) { // "I like the thing you posted" $act->objects = $target->asActivity()->objects; } else { // "I like that you did whatever you did" $act->target = $target->asActivityObject(); $act->objects = array(clone $act->target); } $act->context->replyToID = $target->getUri(); $act->context->replyToUrl = $target->getUrl(); $act->title = ActivityUtils::verbToTitle($act->verb); }