]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
work in progress
authorBrion Vibber <brion@pobox.com>
Thu, 17 Mar 2011 20:25:20 +0000 (13:25 -0700)
committerBrion Vibber <brion@pobox.com>
Thu, 17 Mar 2011 20:25:20 +0000 (13:25 -0700)
lib/threadednoticelist.php

index 1328ff74dc70c0dc8cab82a8f01c503db7dd2a9d..6fb059491a28be0b708ca67a0be097ae1f688c4f 100644 (file)
@@ -183,7 +183,7 @@ class ThreadedNoticeListItem extends NoticeListItem
 
             if ($notices) {
                 $this->out->elementStart('ul', 'notices threaded-replies xoxo');
-                $item = new ThreadedNoticeListFavesItem($notice, $this->out);
+                $item = new ThreadedNoticeListFavesItem($this->notice, $this->out);
                 $hasFaves = $item->show();
                 if ($moreCutoff) {
                     $item = new ThreadedNoticeListMoreItem($moreCutoff, $this->out);
@@ -196,7 +196,7 @@ class ThreadedNoticeListItem extends NoticeListItem
                 // @fixme do a proper can-post check that's consistent
                 // with the JS side
                 if (common_current_user()) {
-                    $item = new ThreadedNoticeListReplyItem($notice, $this->out);
+                    $item = new ThreadedNoticeListReplyItem($this->notice, $this->out);
                     $item->show();
                 }
                 $this->out->elementEnd('ul');
@@ -327,13 +327,6 @@ class ThreadedNoticeListFavesItem extends NoticeListItem
 {
     function show()
     {
-        return $this->showFaves();
-    }
-
-    function showFaves()
-    {
-        $this->out->text('(QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ)');
-        return 0;
         // @fixme caching & scalability!
         $fave = new Fave();
         $fave->notice_id = $this->notice->id;
@@ -366,7 +359,13 @@ class ThreadedNoticeListFavesItem extends NoticeListItem
 
         if ($links) {
             $count = count($links);
-            $msg = _m('%1$s has favored this notice', '%1$s have favored this notice', $count);
+            if ($count == 1 && $you) {
+                // darn first person being different from third person!
+                $msg = _m('FAVELIST', 'You have favored this notice');
+            } else {
+                // if 'you' is the first item...
+                $msg = _m('FAVELIST', '%1$s has favored this notice', '%1$s have favored this notice', $count);
+            }
             $out = sprintf($msg, implode(', ', $links));
 
             $this->out->elementStart('li', array('class' => 'notice-faves'));