From f200d708bdafc5f25cf8e49c02242526d616d7aa Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 28 Jun 2014 11:47:02 +0200 Subject: [PATCH] Simplify NoticeSimpleStatusArray inclusion in lib/apiaction.php --- lib/apiaction.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/apiaction.php b/lib/apiaction.php index 36ccc82135..6de9c0b632 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -295,17 +295,12 @@ class ApiAction extends Action function twitterStatusArray($notice, $include_user=true) { - // The event call to handle NoticeSimpleStatusArray lets plugins add data to the output array $base = $this->twitterSimpleStatusArray($notice, $include_user); - Event::handle('NoticeSimpleStatusArray', array($notice, &$base, $this->scoped, - array('include_user'=>$include_user))); if (!empty($notice->repeat_of)) { $original = Notice::getKV('id', $notice->repeat_of); if ($original instanceof Notice) { $orig_array = $this->twitterSimpleStatusArray($original, $include_user); - Event::handle('NoticeSimpleStatusArray', array($original, &$orig_array, $this->scoped, - array('include_user'=>$include_user))); $base['retweeted_status'] = $orig_array; } } @@ -411,6 +406,10 @@ class ApiAction extends Action $twitter_status['statusnet_html'] = $notice->rendered; $twitter_status['statusnet_conversation_id'] = intval($notice->conversation); + // The event call to handle NoticeSimpleStatusArray lets plugins add data to the output array + Event::handle('NoticeSimpleStatusArray', array($notice, &$twitter_status, $this->scoped, + array('include_user'=>$include_user))); + return $twitter_status; }