]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
had the order of <status> and <retweeted_status> wrong in api output
authorEvan Prodromou <evan@status.net>
Mon, 14 Dec 2009 22:11:34 +0000 (17:11 -0500)
committerEvan Prodromou <evan@status.net>
Mon, 14 Dec 2009 22:11:34 +0000 (17:11 -0500)
lib/api.php
lib/noticelist.php

index 833bc1c5fcc7f66c4d16c644e43d01cb94f53379..4ed49e45293197f790d167f9a8da24e882ce4b98 100644 (file)
@@ -220,18 +220,15 @@ class ApiAction extends Action
     {
         $base = $this->twitterSimpleStatusArray($notice, $include_user);
 
-        if (empty($notice->repeat_of)) {
-            return $base;
-        } else {
+        if (!empty($notice->repeat_of)) {
             $original = Notice::staticGet('id', $notice->repeat_of);
-            if (empty($original)) {
-                return $base;
-            } else {
+            if (!empty($original)) {
                 $original_array = $this->twitterSimpleStatusArray($original, $include_user);
-                $original_array['retweeted_status'] = $base;
-                return $original_array;
+                $base['retweeted_status'] = $original_array;
             }
         }
+
+        return $base;
     }
 
     function twitterSimpleStatusArray($notice, $include_user=true)
index 85e1befccfabf3b9f46e7028e24120acdf6d9c19..3ccb502306cd352ce8de840f98e253b8b8d3629d 100644 (file)
@@ -601,11 +601,13 @@ class NoticeListItem extends Widget
     {
         $user = common_current_user();
 
+        $todel = (empty($this->repeat)) ? $this->notice : $this->repeat;
+
         if (!empty($user) &&
-            ($this->notice->profile_id == $user->id || $user->hasRight(Right::DELETEOTHERSNOTICE))) {
+            ($todel->profile_id == $user->id || $user->hasRight(Right::DELETEOTHERSNOTICE))) {
 
             $deleteurl = common_local_url('deletenotice',
-                                          array('notice' => $this->notice->id));
+                                          array('notice' => $todel->id));
             $this->out->element('a', array('href' => $deleteurl,
                                            'class' => 'notice_delete',
                                            'title' => _('Delete this notice')), _('Delete'));