summaryrefslogtreecommitdiff
path: root/plugins/Realtime/RealtimePlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-15 15:47:37 -0500
committerEvan Prodromou <evan@status.net>2009-12-15 15:47:37 -0500
commitd6873beb9b2f17d62b90933e5974117a2fd713f1 (patch)
tree730c865ff400583d8f34630bc3c4039cf0231cc9 /plugins/Realtime/RealtimePlugin.php
parent80b5a7fe600e9e30021f33e58cde7906e79663eb (diff)
make realtime plugin grok repeats
Diffstat (limited to 'plugins/Realtime/RealtimePlugin.php')
-rw-r--r--plugins/Realtime/RealtimePlugin.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php
index d57438de2..a810b7165 100644
--- a/plugins/Realtime/RealtimePlugin.php
+++ b/plugins/Realtime/RealtimePlugin.php
@@ -267,6 +267,24 @@ class RealtimePlugin extends Plugin
$profile = $notice->getProfile();
$arr['user']['profile_url'] = $profile->profileurl;
+ // Add needed repeat data
+
+ if (!empty($notice->repeat_of)) {
+ $original = Notice::staticGet('id', $notice->repeat_of);
+ if (!empty($original)) {
+ $arr['retweeted_status']['url'] = $original->bestUrl();
+ $arr['retweeted_status']['html'] = htmlspecialchars($original->rendered);
+ $arr['retweeted_status']['source'] = htmlspecialchars($original->source);
+ $originalProfile = $original->getProfile();
+ $arr['retweeted_status']['user']['profile_url'] = $originalProfile->profileurl;
+ if (!empty($original->reply_to)) {
+ $originalReply = Notice::staticGet('id', $original->reply_to);
+ $arr['retweeted_status']['in_reply_to_status_url'] = $originalReply->bestUrl();
+ }
+ }
+ $original = null;
+ }
+
return $arr;
}