From d22364b35e33982b2f95146f9ac290a3606da28b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 14 Dec 2009 17:11:34 -0500 Subject: had the order of and wrong in api output --- lib/api.php | 13 +++++-------- lib/noticelist.php | 6 ++++-- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/api.php b/lib/api.php index 833bc1c5f..4ed49e452 100644 --- a/lib/api.php +++ b/lib/api.php @@ -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) diff --git a/lib/noticelist.php b/lib/noticelist.php index 85e1befcc..3ccb50230 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -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')); -- cgit v1.2.3-54-g00ecf