]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showstream.php
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
[quix0rs-gnu-social.git] / actions / showstream.php
index 956c057415d0b27cbc7ecf8c933051efd16b4d24..dabdcd103c4b49551f894aed95be5d412c1c6054 100644 (file)
@@ -54,7 +54,6 @@ require_once INSTALLDIR.'/lib/feedlist.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-
 class ShowstreamAction extends ProfileAction
 {
     function isReadOnly($args)
@@ -64,27 +63,29 @@ class ShowstreamAction extends ProfileAction
 
     function title()
     {
-        if (!empty($this->profile->fullname)) {
-            $base = $this->profile->fullname . ' (' . $this->user->nickname . ') ';
-        } else {
-            $base = $this->user->nickname;
-        }
+        $base = $this->profile->getFancyName();
         if (!empty($this->tag)) {
-            $base .= sprintf(_(' tagged %s'), $this->tag);
-        }
-
-        if ($this->page == 1) {
-            return $base;
+            if ($this->page == 1) {
+                // TRANS: Page title showing tagged notices in one user's stream. Param 1 is the username, 2 is the hash tag.
+                return sprintf(_('%1$s tagged %2$s'), $base, $this->tag);
+            } else {
+                // TRANS: Page title showing tagged notices in one user's stream. Param 1 is the username, 2 is the hash tag, 3 is the page number.
+                return sprintf(_('%1$s tagged %2$s, page %3$d'), $base, $this->tag, $this->page);
+            }
         } else {
-            return sprintf(_('%1$s, page %2$d'),
-                           $base,
-                           $this->page);
+            if ($this->page == 1) {
+                return $base;
+            } else {
+                // TRANS: Extended page title showing tagged notices in one user's stream. Param 1 is the username, param 2 is the page number.
+                return sprintf(_('%1$s, page %2$d'),
+                               $base,
+                               $this->page);
+            }
         }
     }
 
     function handle($args)
     {
-
         // Looks like we're good; start output
 
         // For YADIS discovery, we also have a <meta> tag
@@ -166,12 +167,6 @@ class ShowstreamAction extends ProfileAction
             $this->element('meta', array('name' => 'microid',
                                          'content' => $id->toString()));
         }
-        if ($this->user->jabbermicroid && $this->user->jabber && $this->profile->profileurl) {
-            $id = new Microid('xmpp:'.$this->user->jabber,
-                              $this->selfUrl());
-            $this->element('meta', array('name' => 'microid',
-                                         'content' => $id->toString()));
-        }
 
         // See https://wiki.mozilla.org/Microsummaries
 
@@ -186,7 +181,6 @@ class ShowstreamAction extends ProfileAction
         $this->element('link', array('rel' => 'EditURI',
                                      'type' => 'application/rsd+xml',
                                      'href' => $rsd));
-
     }
 
     function showProfile()
@@ -204,11 +198,11 @@ class ShowstreamAction extends ProfileAction
             if ($this->user->id === $current_user->id) {
                 $message .= _('Seen anything interesting recently? You haven\'t posted any notices yet, now would be a good time to start :)');
             } else {
-                $message .= sprintf(_('You can try to nudge %1$s or [post something to their attention](%%%%action.newnotice%%%%?status_textarea=%2$s).'), $this->user->nickname, '@' . $this->user->nickname);
+                $message .= sprintf(_('You can try to nudge %1$s or [post something to them](%%%%action.newnotice%%%%?status_textarea=%2$s).'), $this->user->nickname, '@' . $this->user->nickname);
             }
         }
         else {
-            $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to their attention.'), $this->user->nickname);
+            $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->user->nickname);
         }
 
         $this->elementStart('div', 'guide');
@@ -222,7 +216,10 @@ class ShowstreamAction extends ProfileAction
           ? $this->user->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1)
             : $this->user->getTaggedNotices($this->tag, ($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1, 0, 0, null);
 
-        $pnl = new ProfileNoticeList($notice, $this);
+        $pnl = null;
+        if (Event::handle('ShowStreamNoticeList', array($notice, $this, &$pnl))) {
+            $pnl = new ProfileNoticeList($notice, $this);
+        }
         $cnt = $pnl->show();
         if (0 == $cnt) {
             $this->showEmptyListMessage();
@@ -272,7 +269,7 @@ class ProfileNoticeList extends NoticeList
     }
 }
 
-class ProfileNoticeListItem extends NoticeListItem
+class ProfileNoticeListItem extends DoFollowListItem
 {
     function showAuthor()
     {