From: Craig Andrews Date: Wed, 15 Jul 2009 14:37:50 +0000 (-0400) Subject: Added attachment information to the json responses X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=75545cdc07db0e12a351ed0f519675626dd2e7bd;p=quix0rs-gnu-social.git Added attachment information to the json responses --- diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 655b6c7778..749083c7c5 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -186,6 +186,21 @@ class TwitterapiAction extends Action $twitter_status['favorited'] = false; } + # Enclosures + $attachments = $notice->attachments(); + $twitter_status['attachments']=array(); + if($attachments){ + foreach($attachments as $attachment){ + if ($attachment->isEnclosure()) { + $enclosure=array(); + $enclosure['url']=$attachment->url; + $enclosure['mimetype']=$attachment->mimetype; + $enclosure['size']=$attachment->size; + $twitter_status['attachments'][]=$enclosure; + } + } + } + if ($include_user) { # Don't get notice (recursive!) $twitter_user = $this->twitter_user_array($profile, false);