Added attachment information to the json responses

This commit is contained in:
Craig Andrews 2009-07-15 10:37:50 -04:00
parent b05b998d68
commit 75545cdc07

View File

@ -186,6 +186,21 @@ class TwitterapiAction extends Action
$twitter_status['favorited'] = false; $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) { if ($include_user) {
# Don't get notice (recursive!) # Don't get notice (recursive!)
$twitter_user = $this->twitter_user_array($profile, false); $twitter_user = $this->twitter_user_array($profile, false);