$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);
$group->id,
common_date_iso8601(time()));
- $act->actor = ActivityObject::fromProfile($profile);
+ $act->actor = $profile->asActivityObject();
$act->verb = ActivityVerb::JOIN;
$act->object = $oprofile->asActivityObject();
$group->id,
common_date_iso8601(time()));
- $act->actor = ActivityObject::fromProfile($member);
+ $act->actor = $member->asActivityObject();
$act->verb = ActivityVerb::LEAVE;
$act->object = $oprofile->asActivityObject();
$peopletag->id,
common_date_iso8601(time()));
- $act->actor = ActivityObject::fromProfile($sub);
+ $act->actor = $sub->asActivityObject();
$act->verb = ActivityVerb::FOLLOW;
$act->object = $oprofile->asActivityObject();
$peopletag->id,
common_date_iso8601(time()));
- $act->actor = ActivityObject::fromProfile($member);
+ $act->actor = $member->asActivityObject();
$act->verb = ActivityVerb::UNFOLLOW;
$act->object = $oprofile->asActivityObject();
$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);
$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);
$profile->getBestName(),
$notice->getUrl());
- $act->actor = ActivityObject::fromProfile($profile);
+ $act->actor = $profile->asActivityObject();
$act->object = ActivityObject::fromNotice($notice);
$oprofile->notifyActivity($act, $profile);
$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()) {
return true;
}
+
+ public function onGetLocalAttentions(Profile $actor, array $attention_uris, array &$mentions, array &$groups)
+ {
+ list($mentions, $groups) = Ostatus_profile::filterAttention($actor, $attention_uris);
+ }
+
+ // FIXME: Maybe this shouldn't be so authoritative that it breaks other remote profile lookups?
+ static public function onCheckActivityAuthorship(Activity $activity, Profile &$profile)
+ {
+ try {
+ $oprofile = Ostatus_profile::getFromProfile($profile);
+ $oprofile = $oprofile->checkAuthorship($activity);
+ $profile = $oprofile->localProfile();
+ } catch (Exception $e) {
+ common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'")');
+ $profile = null;
+ return false;
+ }
+ return true;
+ }
}