]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'nightly' of gitorious.org:social/mainline into nightly
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 21 Jan 2015 22:45:49 +0000 (23:45 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 21 Jan 2015 22:45:49 +0000 (23:45 +0100)
1  2 
actions/apiaccountverifycredentials.php
actions/public.php
classes/Profile.php
lib/default.php
lib/router.php
theme/neo-quitter/css/display.css

index 6cc61cf6da7f62bd4ea300ac910e4af10dd742d9,6cc61cf6da7f62bd4ea300ac910e4af10dd742d9..9b98fa6d810ba384fbea24599c7f47ae4285c3bc
@@@ -48,18 -48,18 +48,9 @@@ if (!defined('STATUSNET')) 
   */
  class ApiAccountVerifyCredentialsAction extends ApiAuthAction
  {
--    /**
--     * Handle the request
--     *
--     * Check whether the credentials are valid and output the result
--     *
--     * @param array $args $_REQUEST data (unused)
--     *
--     * @return void
--     */
--    function handle($args)
++    protected function handle()
      {
--        parent::handle($args);
++        parent::handle();
  
          if (!in_array($this->format, array('xml', 'json'))) {
              // TRANS: Client error displayed when coming across a non-supported API method.
index 6ebd48ba12cdd5e6a7d5652dbc81aa15868c383a,6ebd48ba12cdd5e6a7d5652dbc81aa15868c383a..52bab072aec60ea5172f0e432e3a9829b3218383
@@@ -53,7 -53,7 +53,8 @@@ class PublicAction extends Actio
  
      var $page = null;
      var $notice;
--    var $userProfile = null;
++
++    protected $stream = null;
  
      function isReadOnly($args)
      {
@@@ -67,7 -67,7 +68,7 @@@
       *
       * @return boolean success value
       */
--    function prepare($args)
++    protected function prepare(array $args=array())
      {
          parent::prepare($args);
          $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
  
          common_set_returnto($this->selfUrl());
  
--        $this->userProfile = Profile::current();
--
--        $user = common_current_user();
--
--        if (!empty($user) && $user->streamModeOnly()) {
--            $stream = new PublicNoticeStream($this->userProfile);
--        } else {
--            $stream = new ThreadingPublicNoticeStream($this->userProfile);
--        }
++        $this->streamPrepare();
  
--        $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
++        $this->notice = $this->stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
                                              NOTICES_PER_PAGE + 1);
  
          if (!$this->notice) {
@@@ -98,7 -98,7 +91,7 @@@
              $this->serverError(_('Could not retrieve public timeline.'));
          }
  
--        if($this->page > 1 && $this->notice->N == 0){
++        if ($this->page > 1 && $this->notice->N == 0){
              // TRANS: Server error when page not found (404).
              $this->serverError(_('No such page.'),$code=404);
          }
          return true;
      }
  
++    protected function streamPrepare()
++    {
++        if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
++            $this->stream = new PublicNoticeStream($this->scoped);
++        } else {
++            $this->stream = new ThreadingPublicNoticeStream($this->scoped);
++        }
++    }
++
      /**
       * handle request
       *
       *
       * @return void
       */
--    function handle($args)
++    protected function handle()
      {
--        parent::handle($args);
++        parent::handle();
  
          $this->showPage();
      }
          if (!empty($user) && $user->streamModeOnly()) {
              $nl = new PrimaryNoticeList($this->notice, $this, array('show_n'=>NOTICES_PER_PAGE));
          } else {
--            $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
++            $nl = new ThreadedNoticeList($this->notice, $this, $this->scoped);
          }
  
          $cnt = $nl->show();
index e850b629d41c28e2aaaf9ba823782ae263e1f9c0,00a457a5c9c2062aa9163373fddb4bc170fe65e3..8352861fe63089cb187f92d1cbf3bf67b1baeaee
@@@ -1565,12 -1565,8 +1565,17 @@@ class Profile extends Managed_DataObjec
          return $this->getUser()->shortenLinks($text, $always);
      }
  
 +    public function delPref($namespace, $topic) {
 +        return Profile_prefs::setData($this, $namespace, $topic, null);
 +    }
 +
      public function getPref($namespace, $topic, $default=null) {
--        return Profile_prefs::getData($this, $namespace, $topic, $default);
++        // If you want an exception to be thrown, call Profile_prefs::getData directly
++        try {
++            return Profile_prefs::getData($this, $namespace, $topic, $default);
++        } catch (NoResultException $e) {
++            return null;
++        }
      }
  
      public function setPref($namespace, $topic, $data) {
diff --cc lib/default.php
index de07a8ee47c946d6c1f1c9b24e249b2993d14ff8,d442e1a85af11f8955283359fa8bcdee26824976..465a5142a3bcb55ee2795a8a249e5c0f60297e79
@@@ -144,7 -144,7 +144,7 @@@ $default 
                'path' => $_path . '/background/',
                'ssl' => null),
          'public' =>
--        array('localonly' => true,
++        array('localonly' => false,
                'blacklist' => array(),
                'autosource' => array()),
          'theme' =>
diff --cc lib/router.php
index 8260cb3e2e8cffa99b0290f3d346548f40a23c6a,8260cb3e2e8cffa99b0290f3d346548f40a23c6a..a3be38ebbdf3804c7f1db26e549ade8a22ded8be
@@@ -163,6 -163,6 +163,9 @@@ class Route
                  $m->connect('main/'.$a, array('action' => $a));
              }
  
++            $m->connect('main/public', array('action' => 'public'));
++            $m->connect('main/all', array('action' => 'networkpublic'));
++
              $m->connect('main/tagprofile/:id', array('action' => 'tagprofile'),
                                                 array('id' => '[0-9]+'));
  
                                  array('tag' => self::REGEX_TAG));
                  }
              } else {
++                $m->connect('main/public', array('action' => 'public'));
                  $m->connect('', array('action' => 'public'));
++                $m->connect('main/all', array('action' => 'networkpublic'));
                  $m->connect('rss', array('action' => 'publicrss'));
                  $m->connect('featuredrss', array('action' => 'featuredrss'));
                  $m->connect('featured/', array('action' => 'featured'));
index 22a477a49f52c6304278c55db0c8da43ffed2ead,22a477a49f52c6304278c55db0c8da43ffed2ead..3532e9dd1f27bff0ca4504ddab4d0398e3eb5968
@@@ -1720,7 -1720,7 +1720,6 @@@ ul.messages .notice .p-author 
        }       
  
  #content .threaded-replies .notice-options {
--      position:absolute;
        bottom:0;
        right:0px;
        height:25px;