]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Simplify NoticeSimpleStatusArray inclusion in lib/apiaction.php
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 28 Jun 2014 09:47:02 +0000 (11:47 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 28 Jun 2014 09:52:51 +0000 (11:52 +0200)
lib/apiaction.php

index 36ccc82135f734299a586b9ef6cce226cdabe7a2..6de9c0b63270c9c08f405be939511b3ab10f252a 100644 (file)
@@ -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;
     }