summaryrefslogtreecommitdiff
path: root/lib/api.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-12 16:18:55 -0500
committerEvan Prodromou <evan@status.net>2009-12-12 16:18:55 -0500
commita5a89f50b8e3f9b99d8ea3a7eff378637b149c7f (patch)
tree771b39f50b6272f62d08902d25b9fb54eb11937d /lib/api.php
parentcc063aedccd614d6e486d88921c7752ec5750551 (diff)
parent1ec54d3433a79f56c14c0a99114bb1e607348899 (diff)
Merge branch 'forward' into 0.9.x
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/api.php b/lib/api.php
index 7ebe65dbb..b7ab407a1 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -216,6 +216,20 @@ class ApiAction extends Action
function twitterStatusArray($notice, $include_user=true)
{
+ $base = $this->twitterSimpleStatusArray($notice, $include_user);
+
+ if (empty($notice->repeat_of)) {
+ return $base;
+ } else {
+ $original = Notice::staticGet('id', $notice->repeat_of);
+ $original_array = $this->twitterSimpleStatusArray($original, $include_user);
+ $original_array['retweeted_status'] = $base;
+ return $original_array;
+ }
+ }
+
+ function twitterSimpleStatusArray($notice, $include_user=true)
+ {
$profile = $notice->getProfile();
$twitter_status = array();
@@ -448,9 +462,9 @@ class ApiAction extends Action
}
}
- function showTwitterXmlStatus($twitter_status)
+ function showTwitterXmlStatus($twitter_status, $tag='status')
{
- $this->elementStart('status');
+ $this->elementStart($tag);
foreach($twitter_status as $element => $value) {
switch ($element) {
case 'user':
@@ -465,11 +479,14 @@ class ApiAction extends Action
case 'geo':
$this->showGeoRSS($value);
break;
+ case 'retweeted_status':
+ $this->showTwitterXmlStatus($value, 'retweeted_status');
+ break;
default:
$this->element($element, null, $value);
}
}
- $this->elementEnd('status');
+ $this->elementEnd($tag);
}
function showTwitterXmlGroup($twitter_group)