]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/public.php
Merge branch 'master' of gitorious.org:statusnet/mainline
[quix0rs-gnu-social.git] / actions / public.php
index 847aba666e6c41d2e97856d90ad3e50e3de68e06..8c724466368624ab98932f9e6179852b70fd4876 100644 (file)
@@ -60,7 +60,6 @@ class PublicAction extends Action
     var $page = null;
     var $notice;
     var $userProfile = null;
-    var $mode = 'conversation';
 
     function isReadOnly($args)
     {
@@ -89,9 +88,9 @@ class PublicAction extends Action
 
         $this->userProfile = Profile::current();
 
-        $this->mode = $this->trimmed('mode', 'conversation');
+        $user = common_current_user();
 
-        if ($this->mode == 'stream') {
+        if (!empty($user) && $user->streamModeOnly()) {
             $stream = new PublicNoticeStream($this->userProfile);
         } else {
             $stream = new ThreadingPublicNoticeStream($this->userProfile);
@@ -160,6 +159,11 @@ class PublicAction extends Action
         $this->element('link', array('rel' => 'EditURI',
                                      'type' => 'application/rsd+xml',
                                      'href' => $rsd));
+
+        if ($this->page != 1) {
+            $this->element('link', array('rel' => 'canonical',
+                                         'href' => common_local_url('public')));
+        }
     }
 
     /**
@@ -220,7 +224,9 @@ class PublicAction extends Action
      */
     function showContent()
     {
-        if ($this->mode == 'stream') {
+        $user = common_current_user();
+
+        if (!empty($user) && $user->streamModeOnly()) {
             $nl = new NoticeList($this->notice, $this);
         } else {
             $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
@@ -254,7 +260,9 @@ class PublicAction extends Action
             $ibs->show();
         }
 
-        $pop = new PopularNoticeSection($this);
+        $p = Profile::current();
+
+        $pop = new PopularNoticeSection($this, $p);
         $pop->show();
         if (!common_config('performance', 'high')) {
             $cloud = new PublicTagCloudSection($this);