- if (Event::handle('StartFavorNotice', array($profile, $notice, &$fave))) {
+ $act = new Activity();
+ $act->type = ActivityObject::ACTIVITY;
+ $act->verb = ActivityVerb::FAVORITE;
+ $act->time = time();
+ $act->id = self::newUri($actor, $target, common_sql_date($act->time));
+ $act->title = _("Favor");
+ // TRANS: Message that is the "content" of a favorite (%1$s is the actor's nickname, %2$ is the favorited
+ // notice's nickname and %3$s is the content of the favorited notice.)
+ $act->content = sprintf(_('%1$s favorited something by %2$s: %3$s'),
+ $actor->getNickname(), $target->getProfile()->getNickname(),
+ $target->rendered ?: $target->content);
+ $act->actor = $actor->asActivityObject();
+ $act->target = $target->asActivityObject();
+ $act->objects = array(clone($act->target));
+
+ $url = common_local_url('AtomPubShowFavorite', array('profile'=>$actor->id, 'notice'=>$target->id));
+ $act->selfLink = $url;
+ $act->editLink = $url;