From 20e414665d418edd5d62f5863a36e38a6c2f2284 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 18 Feb 2011 09:29:49 -0800 Subject: [PATCH] Add tags to Activity Streams JSON --- lib/activity.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/activity.php b/lib/activity.php index 218c965c4d..25d70c982b 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -437,6 +437,15 @@ class Activity /* Purely extensions hereafter */ + $tags = array(); + + // Use an Activity Object for term? Which object? Note? + foreach ($this->categories as $cat) { + $tags[] = $cat->term; + } + + $activity['tags'] = $tags; + // XXX: a bit of a hack... Since JSON isn't namespaced we probably // shouldn't be using 'statusnet:notice_info', but this will work // for the moment. @@ -448,12 +457,11 @@ class Activity } } - /* more extensions */ // Context stuff. For now I'm just sticking most of it // in a property called "context" - if (!empty($this->context)) { + if (!empty($this->context)) { if (!empty($this->context->location)) { $loc = $this->context->location; -- 2.39.5