- $sub = $user->getProfile();
- $tagger = Profile::staticGet($peopletag->tagger);
-
- $act = new Activity();
- $act->id = TagURI::mint('subscribe_peopletag:%d:%d:%s',
- $sub->id,
- $peopletag->id,
- common_date_iso8601(time()));
-
- $act->actor = ActivityObject::fromProfile($sub);
- $act->verb = ActivityVerb::FOLLOW;
- $act->object = $oprofile->asActivityObject();
-
- $act->time = time();
- // TRANS: Title for following a remote list.
- $act->title = _m('TITLE','Follow list');
- // TRANS: Success message for remote list follow through OStatus.
- // TRANS: %1$s is the subscriber name, %2$s is the list, %3$s is the lister's name.
- $act->content = sprintf(_m('%1$s is now following people listed in %2$s by %3$s.'),
- $sub->getBestName(),
- $oprofile->getBestName(),
- $tagger->getBestName());
-
- if ($oprofile->notifyActivity($act, $sub)) {
- return true;
- } else {
- $oprofile->garbageCollect();
- // TRANS: Exception thrown when subscription to remote list fails.
- throw new Exception(_m('Failed subscribing to remote list.'));
- }
+ $oprofile->subscribe();
+
+ $sub = $user->getProfile();
+ $tagger = Profile::getKV($peopletag->tagger);
+
+ $act = new Activity();
+ $act->id = TagURI::mint('subscribe_peopletag:%d:%d:%s',
+ $sub->id,
+ $peopletag->id,
+ common_date_iso8601(time()));
+
+ $act->actor = ActivityObject::fromProfile($sub);
+ $act->verb = ActivityVerb::FOLLOW;
+ $act->object = $oprofile->asActivityObject();
+
+ $act->time = time();
+ // TRANS: Title for following a remote list.
+ $act->title = _m('TITLE','Follow list');
+ // TRANS: Success message for remote list follow through OStatus.
+ // TRANS: %1$s is the subscriber name, %2$s is the list, %3$s is the lister's name.
+ $act->content = sprintf(_m('%1$s is now following people listed in %2$s by %3$s.'),
+ $sub->getBestName(),
+ $oprofile->getBestName(),
+ $tagger->getBestName());
+
+ if ($oprofile->notifyActivity($act, $sub)) {
+ return true;
+ } else {
+ $oprofile->garbageCollect();
+ // TRANS: Exception thrown when subscription to remote list fails.
+ throw new Exception(_m('Failed subscribing to remote list.'));