forked from GNUsocial/gnu-social
Converted all ActivityObject::fromProfile to $profile->asActivityObject
This commit is contained in:
parent
1d981b826a
commit
b63f6e949c
@ -168,7 +168,7 @@ class Group_member extends Managed_DataObject
|
||||
|
||||
$act->id = $this->getURI();
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($member);
|
||||
$act->actor = $member->asActivityObject();
|
||||
$act->verb = ActivityVerb::JOIN;
|
||||
$act->objects[] = ActivityObject::fromGroup($group);
|
||||
|
||||
|
@ -183,7 +183,7 @@ class Message extends Managed_DataObject
|
||||
throw new Exception(sprintf("Sender profile not found: %d", $this->from_profile));
|
||||
}
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->actor->extra[] = $profile->profileInfo(null);
|
||||
|
||||
$act->verb = ActivityVerb::POST;
|
||||
|
@ -1782,7 +1782,7 @@ class Notice extends Managed_DataObject
|
||||
|
||||
$profile = $this->getProfile();
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->actor->extra[] = $profile->profileInfo($cur);
|
||||
|
||||
$act->verb = $this->verb;
|
||||
|
@ -267,8 +267,8 @@ class Subscription extends Managed_DataObject
|
||||
$subscriber->getBestName(),
|
||||
$subscribed->getBestName());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($subscriber);
|
||||
$act->objects[] = ActivityObject::fromProfile($subscribed);
|
||||
$act->actor = $subscriber->asActivityObject();
|
||||
$act->objects[] = $subscribed->asActivityObject();
|
||||
|
||||
$url = common_local_url('AtomPubShowSubscription',
|
||||
array('subscriber' => $subscriber->id,
|
||||
|
@ -990,7 +990,7 @@ class User extends Managed_DataObject
|
||||
|
||||
$act = new Activity();
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->verb = ActivityVerb::JOIN;
|
||||
|
||||
$act->objects[] = $service;
|
||||
|
@ -457,11 +457,6 @@ class ActivityObject
|
||||
return $object;
|
||||
}
|
||||
|
||||
static function fromProfile(Profile $profile)
|
||||
{
|
||||
return $profile->asActivityObject();
|
||||
}
|
||||
|
||||
static function fromGroup(User_group $group)
|
||||
{
|
||||
$object = new ActivityObject();
|
||||
|
@ -62,7 +62,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
|
||||
|
||||
$profile = $user->getProfile();
|
||||
|
||||
$ao = ActivityObject::fromProfile($profile);
|
||||
$ao = $profile->asActivityObject();
|
||||
|
||||
array_push($ao->extra, $profile->profileInfo($cur));
|
||||
|
||||
|
@ -390,7 +390,7 @@ class ActivityPlugin extends Plugin
|
||||
if (!empty($sub)) {
|
||||
$profile = Profile::getKV('id', $sub->subscribed);
|
||||
if (!empty($profile)) {
|
||||
$activity->objects = array(ActivityObject::fromProfile($profile));
|
||||
$activity->objects = array($profile->asActivityObject());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -157,7 +157,7 @@ class Fave extends Managed_DataObject
|
||||
$profile->getBestName(),
|
||||
$notice->getUrl());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->objects[] = ActivityObject::fromNotice($notice);
|
||||
|
||||
$url = common_local_url('AtomPubShowFavorite',
|
||||
|
@ -691,8 +691,8 @@ class OStatusPlugin extends Plugin
|
||||
$profile->getBestName(),
|
||||
$other->getBestName());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->object = ActivityObject::fromProfile($other);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->object = $other->asActivityObject();
|
||||
|
||||
$oprofile->notifyActivity($act, $profile);
|
||||
|
||||
@ -728,7 +728,7 @@ class OStatusPlugin extends Plugin
|
||||
$group->id,
|
||||
common_date_iso8601(time()));
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->verb = ActivityVerb::JOIN;
|
||||
$act->object = $oprofile->asActivityObject();
|
||||
|
||||
@ -782,7 +782,7 @@ class OStatusPlugin extends Plugin
|
||||
$group->id,
|
||||
common_date_iso8601(time()));
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($member);
|
||||
$act->actor = $member->asActivityObject();
|
||||
$act->verb = ActivityVerb::LEAVE;
|
||||
$act->object = $oprofile->asActivityObject();
|
||||
|
||||
@ -828,7 +828,7 @@ class OStatusPlugin extends Plugin
|
||||
$peopletag->id,
|
||||
common_date_iso8601(time()));
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($sub);
|
||||
$act->actor = $sub->asActivityObject();
|
||||
$act->verb = ActivityVerb::FOLLOW;
|
||||
$act->object = $oprofile->asActivityObject();
|
||||
|
||||
@ -880,7 +880,7 @@ class OStatusPlugin extends Plugin
|
||||
$peopletag->id,
|
||||
common_date_iso8601(time()));
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($member);
|
||||
$act->actor = $member->asActivityObject();
|
||||
$act->verb = ActivityVerb::UNFOLLOW;
|
||||
$act->object = $oprofile->asActivityObject();
|
||||
|
||||
@ -973,8 +973,8 @@ class OStatusPlugin extends Plugin
|
||||
$tagged->getBestName(),
|
||||
$plist->getBestName());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($tagger);
|
||||
$act->objects = array(ActivityObject::fromProfile($tagged));
|
||||
$act->actor = $tagger->asActivityObject();
|
||||
$act->objects = array($tagged->asActivityObject());
|
||||
$act->target = ActivityObject::fromPeopletag($plist);
|
||||
|
||||
$oprofile->notifyDeferred($act, $tagger);
|
||||
@ -1024,8 +1024,8 @@ class OStatusPlugin extends Plugin
|
||||
$tagged->getBestName(),
|
||||
$plist->getBestName());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($tagger);
|
||||
$act->objects = array(ActivityObject::fromProfile($tagged));
|
||||
$act->actor = $tagger->asActivityObject();
|
||||
$act->objects = array($tagged->asActivityObject());
|
||||
$act->target = ActivityObject::fromPeopletag($plist);
|
||||
|
||||
$oprofile->notifyDeferred($act, $tagger);
|
||||
@ -1073,7 +1073,7 @@ class OStatusPlugin extends Plugin
|
||||
$profile->getBestName(),
|
||||
$notice->getUrl());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->object = ActivityObject::fromNotice($notice);
|
||||
|
||||
$oprofile->notifyActivity($act, $profile);
|
||||
@ -1191,7 +1191,7 @@ class OStatusPlugin extends Plugin
|
||||
$act->content = sprintf(_m('%s has updated their profile page.'),
|
||||
$profile->getBestName());
|
||||
|
||||
$act->actor = ActivityObject::fromProfile($profile);
|
||||
$act->actor = $profile->asActivityObject();
|
||||
$act->object = $act->actor;
|
||||
|
||||
while ($oprofile->fetch()) {
|
||||
|
@ -132,7 +132,7 @@ class Ostatus_profile extends Managed_DataObject
|
||||
} else if ($this->isPeopletag()) {
|
||||
return ActivityObject::fromPeopletag($this->localPeopletag());
|
||||
} else {
|
||||
return ActivityObject::fromProfile($this->localProfile());
|
||||
return $this->localProfile()->asActivityObject();
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ class Ostatus_profile extends Managed_DataObject
|
||||
$noun = ActivityObject::fromPeopletag($this->localPeopletag());
|
||||
return $noun->asString('activity:' . $element);
|
||||
} else {
|
||||
$noun = ActivityObject::fromProfile($this->localProfile());
|
||||
$noun = $this->localProfile()->asActivityObject();
|
||||
return $noun->asString('activity:' . $element);
|
||||
}
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ class OfflineBackupQueueHandler extends QueueHandler
|
||||
|
||||
$profile = $user->getProfile();
|
||||
|
||||
$author = ActivityObject::fromProfile($profile);
|
||||
$author = $profile->asActivityObject();
|
||||
|
||||
$xs = new XMLStringer();
|
||||
$author->outputTo($xs, 'author');
|
||||
|
Loading…
Reference in New Issue
Block a user