From b475c871a4a6b50e270a128fd16146893cbf68a7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 21 Jan 2012 21:12:20 -0500 Subject: [PATCH] add displayName and targetUrl to activity JSON --- plugins/Bookmark/BookmarkPlugin.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; + } } -- 2.39.5