add displayName and targetUrl to activity JSON

This commit is contained in:
Evan Prodromou 2012-01-21 21:12:20 -05:00
parent 71fa1d2462
commit b475c871a4

View File

@ -572,4 +572,20 @@ class BookmarkPlugin extends MicroAppPlugin
$notice->update($original);
}
}
public function activityObjectOutputJson(ActivityObject $obj, array &$out)
{
assert($obj->type == ActivityObject::BOOKMARK);
$bm = Bookmark::staticGet('uri', $obj->id);
if (empty($bm)) {
throw new ServerException("Unknown bookmark: " . $obj->id);
}
$out['displayName'] = $bm->title;
$out['targetUrl'] = $bm->url;
return true;
}
}