From: Evan Prodromou Date: Sun, 22 Jan 2012 02:12:20 +0000 (-0500) Subject: add displayName and targetUrl to activity JSON X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b475c871a4a6b50e270a128fd16146893cbf68a7;p=quix0rs-gnu-social.git add displayName and targetUrl to activity JSON --- diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index ff68917bcc..319366c19b 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -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; + } }