getAcctUri function added with related exception

Used in ActivityObject for Atom Title generation.

New events:
    * StartGetProfileAcctUri
    * EndGetProfileAcctUri
This commit is contained in:
Mikael Nordfeldth
2013-10-28 18:01:39 +01:00
parent addd84aa22
commit 9ea57e5cb2
4 changed files with 92 additions and 2 deletions

View File

@@ -438,8 +438,12 @@ class ActivityObject
$object->type = (empty($notice->object_type)) ? ActivityObject::NOTE : $notice->object_type;
$object->id = $notice->uri;
$object->title = 'New ' . ActivityObject::canonicalType($notice->object_type)
. ' by ' . $notice->getProfile()->nickname;
$object->title = 'New ' . ActivityObject::canonicalType($object->type) . ' by ';
try {
$object->title .= $notice->getProfile()->getAcctUri();
} catch (ProfileNoAcctUriException $e) {
$object->title .= $e->profile->nickname;
}
$object->content = $notice->rendered;
$object->link = $notice->bestUrl();