]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'nightly' into deletenotice_form_fix
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 11 Jul 2015 08:49:41 +0000 (10:49 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 11 Jul 2015 08:49:41 +0000 (10:49 +0200)
83 files changed:
actions/foaf.php
actions/subscriptions.php
actions/usergroups.php
avatar/.gitignore [changed mode: 0755->0644]
classes/Notice.php
classes/Subscription_queue.php
extlib/DB/DataObject.php [changed mode: 0755->0644]
extlib/DB/DataObject/Cast.php [changed mode: 0755->0644]
extlib/DB/DataObject/Error.php [changed mode: 0755->0644]
extlib/DB/DataObject/Generator.php [changed mode: 0755->0644]
extlib/Mail.php [changed mode: 0755->0644]
extlib/Mail/RFC822.php [changed mode: 0755->0644]
extlib/Mail/mail.php [changed mode: 0755->0644]
extlib/Mail/mock.php [changed mode: 0755->0644]
extlib/Mail/null.php [changed mode: 0755->0644]
extlib/Mail/sendmail.php [changed mode: 0755->0644]
extlib/Mail/smtp.php [changed mode: 0755->0644]
extlib/Mail/smtpmx.php [changed mode: 0755->0644]
extlib/Net/URL2.php [changed mode: 0755->0644]
js/util.js
lib/apiaction.php [changed mode: 0755->0644]
lib/framework.php
lib/profilelistitem.php
lib/tagcloudsection.php
lib/targetedrss10action.php [new file with mode: 0644]
plugins/AntiBrute/AntiBrutePlugin.php [changed mode: 0755->0644]
plugins/Directory/lib/sortablegrouplist.php
plugins/Directory/lib/sortablesubscriptionlist.php
plugins/DomainStatusNetwork/scripts/installforemail.php [changed mode: 0644->0755]
plugins/DomainStatusNetwork/scripts/proposesite.php [changed mode: 0644->0755]
plugins/DomainStatusNetwork/scripts/sitefordomain.php [changed mode: 0644->0755]
plugins/EmailRegistration/scripts/cancelemailregistration.php [changed mode: 0644->0755]
plugins/EmailRegistration/scripts/registeremailuser.php [changed mode: 0644->0755]
plugins/EmailReminder/scripts/sendemailreminder.php [changed mode: 0644->0755]
plugins/Favorite/actions/showfavorites.php
plugins/FeedPoller/scripts/pollfeed.php [changed mode: 0644->0755]
plugins/Mapstraction/OpenLayers/img/cloud-popup-relative.png [changed mode: 0755->0644]
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/extlib/phpseclib/Crypt/RC2.php [changed mode: 0755->0644]
plugins/OStatus/lib/magicenvelope.php
plugins/OStatus/scripts/fixup-shadow.php [changed mode: 0644->0755]
plugins/OStatus/scripts/gcfeeds.php [changed mode: 0644->0755]
plugins/OStatus/scripts/renew-feeds.php [changed mode: 0644->0755]
plugins/OStatus/scripts/resub-feed.php [changed mode: 0644->0755]
plugins/OStatus/scripts/rm_bad_feedsubs.php [changed mode: 0644->0755]
plugins/OStatus/scripts/testfeed.php [changed mode: 0644->0755]
plugins/OStatus/scripts/update-profile-data.php [changed mode: 0644->0755]
plugins/OStatus/scripts/update-profile.php [changed mode: 0644->0755]
plugins/OStatus/scripts/update_ostatus_profiles.php [changed mode: 0644->0755]
plugins/OStatus/tests/slap.php [changed mode: 0644->0755]
plugins/Realtime/scripts/cleanupchannels.php [changed mode: 0644->0755]
plugins/RequireValidatedEmail/scripts/registerbyemail.php [changed mode: 0644->0755]
plugins/SearchSub/actions/searchsubs.php
plugins/Sitemap/scripts/updatecounts.php [changed mode: 0644->0755]
plugins/TagSub/actions/tagsubs.php
plugins/TwitterBridge/daemons/twitterdaemon.php [changed mode: 0644->0755]
plugins/TwitterBridge/scripts/initialize_notice_to_status.php [changed mode: 0644->0755]
scripts/clearcache.php [changed mode: 0644->0755]
scripts/createsim.php [changed mode: 0644->0755]
scripts/dumpschema.php [changed mode: 0644->0755]
scripts/flushrouter.php [changed mode: 0644->0755]
scripts/flushsite.php [changed mode: 0644->0755]
scripts/gnusocialversion.php [changed mode: 0644->0755]
scripts/importtwitteratom.php [changed mode: 0644->0755]
scripts/make-release.php [changed mode: 0644->0755]
scripts/makegroupadmin.php [changed mode: 0644->0755]
scripts/registeruser.php [changed mode: 0644->0755]
scripts/sessiongc.php [changed mode: 0644->0755]
scripts/settag.php [changed mode: 0644->0755]
scripts/showcache.php [changed mode: 0644->0755]
scripts/showtable.php [changed mode: 0644->0755]
scripts/uncache_users.php [changed mode: 0644->0755]
scripts/updatelocation.php [changed mode: 0644->0755]
scripts/updateurls.php [changed mode: 0644->0755]
scripts/upgrade.php [changed mode: 0644->0755]
scripts/userrole.php [changed mode: 0644->0755]
tests/atompub/atompub_test.php [changed mode: 0644->0755]
tests/oauth/oauth_post_notice.php [changed mode: 0644->0755]
theme/neo-quitter/LICENSE [changed mode: 0755->0644]
theme/neo-quitter/default-avatar-mini.png [changed mode: 0755->0644]
theme/neo-quitter/default-avatar-profile.png [changed mode: 0755->0644]
theme/neo-quitter/default-avatar-stream.png [changed mode: 0755->0644]
theme/neo-quitter/favicon.ico [changed mode: 0755->0644]

index bcdc86d886c97348ce42d74c5280552a389654a9..260388ba447b72819ea0f908e4da35e9ade80391 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 define('LISTENER', 1);
 define('LISTENEE', -1);
 define('BOTH', 0);
 
 // @todo XXX: Documentation missing.
-class FoafAction extends Action
+class FoafAction extends ManagedAction
 {
     function isReadOnly($args)
     {
         return true;
     }
 
-    function prepare($args)
+    protected function doPreparation()
     {
-        parent::prepare($args);
-
         $nickname_arg = $this->arg('nickname');
 
         if (empty($nickname_arg)) {
@@ -69,10 +67,8 @@ class FoafAction extends Action
         return true;
     }
 
-    function handle($args)
+    public function showPage()
     {
-        parent::handle($args);
-
         header('Content-Type: application/rdf+xml');
 
         $this->startXML();
index 231a697230601822f3eaf3c4ff2f28fad80de05e..b5734b3747ee38900339a480fc2858b25190a1c7 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * A list of the user's subscriptions
@@ -60,7 +58,7 @@ class SubscriptionsAction extends GalleryAction
 
     function showPageNotice()
     {
-        if ($this->scoped instanceof Profile && $this->scoped->id === $this->target->id) {
+        if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
             $this->element('p', null,
                            // TRANS: Page notice for page with an overview of all subscriptions
                            // TRANS: of the logged in user's own profile.
index fd112ba8ecba7af85d714077deee3dbce97beee9..d4756dffb5914a995eaa0feac300b48a3ab86eb3 100644 (file)
@@ -52,12 +52,12 @@ class UsergroupsAction extends GalleryAction
         if ($this->page == 1) {
             // TRANS: Page title for first page of groups for a user.
             // TRANS: %s is a nickname.
-            return sprintf(_('%s groups'), $this->user->nickname);
+            return sprintf(_('%s groups'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Page title for all but the first page of groups for a user.
             // TRANS: %1$s is a nickname, %2$d is a page number.
             return sprintf(_('%1$s groups, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
@@ -82,14 +82,14 @@ class UsergroupsAction extends GalleryAction
             $offset = ($this->page-1) * GROUPS_PER_PAGE;
             $limit =  GROUPS_PER_PAGE + 1;
 
-            $groups = $this->user->getGroups($offset, $limit);
+            $groups = $this->getTarget()->getGroups($offset, $limit);
 
             if ($groups instanceof User_group) {
-                $gl = new GroupList($groups, $this->user, $this);
+                $gl = new GroupList($groups, $this->getTarget(), $this);
                 $cnt = $gl->show();
                 $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
                               $this->page, 'usergroups',
-                              array('nickname' => $this->user->nickname));
+                              array('nickname' => $this->getTarget()->getNickname()));
             } else {
                 $this->showEmptyListMessage();
             }
@@ -102,11 +102,11 @@ class UsergroupsAction extends GalleryAction
     {
         // TRANS: Text on group page for a user that is not a member of any group.
         // TRANS: %s is a user nickname.
-        $message = sprintf(_('%s is not a member of any group.'), $this->user->nickname) . ' ';
+        $message = sprintf(_('%s is not a member of any group.'), $this->getTarget()->getNickname()) . ' ';
 
         if (common_logged_in()) {
             $current_user = common_current_user();
-            if ($this->user->id === $current_user->id) {
+            if ($this->scoped->sameAs($this->getTarget())) {
                 // TRANS: Text on group page for a user that is not a member of any group. This message contains
                 // TRANS: a Markdown link in the form [link text](link) and a variable that should not be changed.
                 $message .= _('Try [searching for groups](%%action.groupsearch%%) and joining them.');
@@ -119,7 +119,7 @@ class UsergroupsAction extends GalleryAction
 
     function showProfileBlock()
     {
-        $block = new AccountProfileBlock($this, $this->profile);
+        $block = new AccountProfileBlock($this, $this->getTarget());
         $block->show();
     }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 5fefa6c4ef5a958190d166bb5787ba46eaf6505e..ae722138b33b91b4a7652dfed5ecb6330c104d55 100644 (file)
@@ -1230,7 +1230,7 @@ class Notice extends Managed_DataObject
         }
 
         $stream = new ConversationNoticeStream($this->conversation);
-        $notices = $stream->getNotices(/*offset*/ 1, /*limit*/ 1);
+        $notice = $stream->getNotices(/*offset*/ 1, /*limit*/ 1);
 
         // if our "offset 1, limit 1" query got a result, return true else false
         return $notice->N > 0;
index 878fcf5796968028b7464b441a00aeb9e1eaf2a2..a60293e2158e9bf8b42ff6f01ff079b1a9056c1b 100644 (file)
@@ -47,10 +47,10 @@ class Subscription_queue extends Managed_DataObject
         return $rq;
     }
 
-    public function exists(Profile $subscriber, Profile $other)
+    static function exists(Profile $subscriber, Profile $other)
     {
-        $sub = Subscription_queue::pkeyGet(array('subscriber' => $subscriber->id,
-                                                 'subscribed' => $other->id));
+        $sub = Subscription_queue::pkeyGet(array('subscriber' => $subscriber->getID(),
+                                                 'subscribed' => $other->getID()));
         return ($sub instanceof Subscription_queue);
     }
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index b0274a91bad4dfc6b1d75f77be76f8129696697e..cd982bbb179c279d50fe28945e23654a011b459d 100644 (file)
@@ -1081,12 +1081,12 @@ var SN = { // StatusNet
                 label.attr('title', label.text());
 
                 check.change(function () {
-                    if (check.prop('checked') === true || $.cookie(SN.C.S.NoticeDataGeoCookie) === null) {
+                    if (check.prop('checked') === true || $.cookie(SN.C.S.NoticeDataGeoCookie) === undefined) {
                         label
                             .attr('title', NoticeDataGeo_text.ShareDisable)
                             .addClass('checked');
 
-                        if ($.cookie(SN.C.S.NoticeDataGeoCookie) === null || $.cookie(SN.C.S.NoticeDataGeoCookie) == 'disabled') {
+                        if ($.cookie(SN.C.S.NoticeDataGeoCookie) === undefined || $.cookie(SN.C.S.NoticeDataGeoCookie) == 'disabled') {
                             if (navigator.geolocation) {
                                 SN.U.NoticeGeoStatus(form, 'Requesting location from browser...');
                                 navigator.geolocation.getCurrentPosition(
@@ -1297,7 +1297,7 @@ var SN = { // StatusNet
              * @fixme what is this?
              */
             Delete: function () {
-                $.cookie(SN.C.S.StatusNetInstance, null);
+                $.removeCookie(SN.C.S.StatusNetInstance);
             }
         },
 
old mode 100755 (executable)
new mode 100644 (file)
index 724447f..cd2207b
@@ -248,7 +248,7 @@ class ApiAction extends Action
 
         $twitter_user['friends_count'] = $profile->subscriptionCount();
 
-        $twitter_user['created_at'] = $this->dateTwitter($profile->created);
+        $twitter_user['created_at'] = self::dateTwitter($profile->created);
 
         $timezone = 'UTC';
 
@@ -322,7 +322,7 @@ class ApiAction extends Action
         $twitter_status = array();
         $twitter_status['text'] = $notice->content;
         $twitter_status['truncated'] = false; # Not possible on StatusNet
-        $twitter_status['created_at'] = $this->dateTwitter($notice->created);
+        $twitter_status['created_at'] = self::dateTwitter($notice->created);
         try {
             // We could just do $notice->reply_to but maybe the future holds a
             // different story for parenting.
@@ -440,8 +440,8 @@ class ApiAction extends Action
         $twitter_group['homepage'] = $group->homepage;
         $twitter_group['description'] = $group->description;
         $twitter_group['location'] = $group->location;
-        $twitter_group['created'] = $this->dateTwitter($group->created);
-        $twitter_group['modified'] = $this->dateTwitter($group->modified);
+        $twitter_group['created'] = self::dateTwitter($group->created);
+        $twitter_group['modified'] = self::dateTwitter($group->modified);
 
         return $twitter_group;
     }
@@ -1196,7 +1196,7 @@ class ApiAction extends Action
         $this->endDocument('xml');
     }
 
-    function dateTwitter($dt)
+    static function dateTwitter($dt)
     {
         $dateStr = date('d F Y H:i:s', strtotime($dt));
         $d = new DateTime($dateStr, new DateTimeZone('UTC'));
index da43297d1050222d0ec1b42f10ee33d601b44663..fec265fd1effd6ca81d52077de8fd60fedb505ed 100644 (file)
@@ -23,7 +23,7 @@ define('GNUSOCIAL_ENGINE', 'GNU social');
 define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/');
 
 define('GNUSOCIAL_BASE_VERSION', '1.2.0');
-define('GNUSOCIAL_LIFECYCLE', 'alpha1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
+define('GNUSOCIAL_LIFECYCLE', 'alpha2'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
 
 define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);
 
index e21ff04ebe29209812884756fef389398d2c1253..6fe7b99c7b3a967515815df5a3e1bde0c425fa04 100644 (file)
@@ -37,7 +37,8 @@ class ProfileListItem extends Widget
     /** Action object using us. */
     var $action = null;
 
-    function __construct(Profile $target, HTMLOutputter $action)
+    // FIXME: Directory plugin sends a User_group here, but should send a Profile and handle User_group specifics itself
+    function __construct($target, HTMLOutputter $action)
     {
         parent::__construct($action);
 
index 24a3bd98af96bf6c2baac39b53630217efe06a50..80a9042e0f1e0bac68016dabe147b2284b25e7b8 100644 (file)
@@ -115,11 +115,10 @@ class TagCloudSection extends Section
 
     function tagUrl($tag)
     {
-        if ('showstream' === $this->out->trimmed('action')) {
-            return common_local_url('showstream', array('nickname' => $this->out->profile->nickname, 'tag' => $tag));
-        } else {
-            return common_local_url('tag', array('tag' => $tag));
+        if ($this->out instanceof ShowstreamAction) {
+            return common_local_url('showstream', array('nickname' => $this->out->getTarget()->getNickname(), 'tag' => $tag));
         }
+        return common_local_url('tag', array('tag' => $tag));
     }
 
     function divId()
diff --git a/lib/targetedrss10action.php b/lib/targetedrss10action.php
new file mode 100644 (file)
index 0000000..c7615bd
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Base class for RSS 1.0 feed actions
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Mail
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Earle Martin <earle@downlode.org>
+ * @copyright 2008-9 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+class TargetedRss10Action extends Rss10Action
+{
+    protected $target = null;
+
+    protected function doStreamPreparation()
+    {
+        $this->target = User::getByNickname($this->trimmed('nickname'))->getProfile();
+    }
+
+    function getImage()
+    {
+        return $this->target->avatarUrl(AVATAR_PROFILE_SIZE);
+    }
+}
old mode 100755 (executable)
new mode 100644 (file)
index 7474d0daa608f9cfa9a037a8da1b4f71bf11e13a..ab00068f6d20a5f438794e1986dc3d07a98db8b8 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
-
-require_once INSTALLDIR . '/lib/subscriptionlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Widget to show a sortable list of subscriptions
@@ -44,16 +40,6 @@ require_once INSTALLDIR . '/lib/subscriptionlist.php';
  */
 class SortableGroupList extends SortableSubscriptionList
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner=null, $action=null)
-    {
-        parent::__construct($profile, $owner, $action);
-
-        $this->owner = $owner;
-    }
-
     function startList()
     {
         $this->out->elementStart('table', array('class' => 'profile_list xoxo'));
@@ -119,25 +105,14 @@ class SortableGroupList extends SortableSubscriptionList
         $this->out->elementStart('tbody');
     }
 
-    function newListItem($profile, $odd)
+    function newListItem($profile)
     {
-        return new SortableGroupListItem($profile, $this->owner, $this->action, $odd);
+        return new SortableGroupListItem($profile, $this->owner, $this->action);
     }
 }
 
 class SortableGroupListItem extends SortableSubscriptionListItem
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner, $action, $alt)
-    {
-        parent::__construct($profile, $owner, $action, $alt);
-
-        $this->alt   = $alt; // is this row alternate?
-        $this->owner = $owner;
-    }
-
     function showHomepage()
     {
         if (!empty($this->profile->homepage)) {
index d6df6c64cda02b44ba29ba0c94122b65cf7c68f8..719834bc917d3aa9c5e17a74c0e63e9470646725 100644 (file)
@@ -40,16 +40,6 @@ if (!defined('GNUSOCIAL')) { exit(1); }
  */
 class SortableSubscriptionList extends SubscriptionList
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner=null, $action=null)
-    {
-        parent::__construct($profile, $owner, $action);
-
-        $this->owner = $owner;
-    }
-
     function startList()
     {
         $this->out->elementStart('table', array('class' => 'profile_list xoxo'));
@@ -132,16 +122,6 @@ class SortableSubscriptionList extends SubscriptionList
 
 class SortableSubscriptionListItem extends SubscriptionListItem
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner, $action)
-    {
-        parent::__construct($profile, $owner, $action);
-
-        $this->owner = $owner;
-    }
-
     function startItem()
     {
         $attr = array(
index 98a6bfc5bfbe30dfb7a7e05903b0c446792fa470..cba29063c28b2de8787890db5c0920ac98ac5c8b 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/personalgroupnav.php';
-require_once INSTALLDIR.'/lib/noticelist.php';
-require_once INSTALLDIR.'/lib/feedlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * List of replies
@@ -44,119 +38,29 @@ 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 ShowfavoritesAction extends Action
+class ShowfavoritesAction extends ShowstreamAction
 {
-    /** User we're getting the faves of */
-    var $user = null;
-    /** Page of the faves we're on */
-    var $page = null;
-
-    /**
-     * Is this a read-only page?
-     *
-     * @return boolean true
-     */
-    function isReadOnly($args)
-    {
-        return true;
-    }
-
-    /**
-     * Title of the page
-     *
-     * Includes name of user and page number.
-     *
-     * @return string title of page
-     */
     function title()
     {
         if ($this->page == 1) {
             // TRANS: Title for first page of favourite notices of a user.
             // TRANS: %s is the user for whom the favourite notices are displayed.
-            return sprintf(_('%s\'s favorite notices'), $this->user->nickname);
+            return sprintf(_('%s\'s favorite notices'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Title for all but the first page of favourite notices of a user.
             // TRANS: %1$s is the user for whom the favourite notices are displayed, %2$d is the page number.
             return sprintf(_('%1$s\'s favorite notices, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
 
-    /**
-     * Prepare the object
-     *
-     * Check the input values and initialize the object.
-     * Shows an error page on bad input.
-     *
-     * @param array $args $_REQUEST data
-     *
-     * @return boolean success flag
-     */
-    function prepare($args)
+    public function getStream()
     {
-        parent::prepare($args);
-
-        $nickname = common_canonical_nickname($this->arg('nickname'));
-
-        $this->user = User::getKV('nickname', $nickname);
-
-        if (!$this->user) {
-            // TRANS: Client error displayed when trying to display favourite notices for a non-existing user.
-            $this->clientError(_('No such user.'));
-        }
-
-        $this->page = $this->trimmed('page');
-
-        if (!$this->page) {
-            $this->page = 1;
-        }
-
-        common_set_returnto($this->selfUrl());
-
-        $cur = common_current_user();
-
-        // Show imported/gateway notices as well as local if
-        // the user is looking at their own favorites, otherwise not.
-        $this->notice = Fave::stream($this->user->id,
-                                     ($this->page-1)*NOTICES_PER_PAGE,  // offset
-                                     NOTICES_PER_PAGE + 1,              // limit
-                                     (!empty($cur) && $cur->id == $this->user->id)  // own feed?
-                                    );
-
-        if (empty($this->notice)) {
-            // TRANS: Server error displayed when favourite notices could not be retrieved from the database.
-            $this->serverError(_('Could not retrieve favorite notices.'));
-        }
-
-        if($this->page > 1 && $this->notice->N == 0){
-            // TRANS: Client error when page not found (404)
-            $this->clientError(_('No such page.'), 404);
-        }
-
-        return true;
-    }
-
-    /**
-     * Handle a request
-     *
-     * Just show the page. All args already handled.
-     *
-     * @param array $args $_REQUEST data
-     *
-     * @return void
-     */
-    function handle($args)
-    {
-        parent::handle($args);
-        $this->showPage();
+        $own = $this->scoped instanceof Profile ? $this->scoped->sameAs($this->getTarget()) : false;
+        return new FaveNoticeStream($this->getTarget()->getID(), $own);
     }
 
-    /**
-     * Feeds for the <head> section
-     *
-     * @return array Feed objects to show
-     */
     function getFeeds()
     {
         return array(new Feed(Feed::JSON,
@@ -223,7 +127,7 @@ class ShowfavoritesAction extends Action
      *
      * @return void
      */
-    function showContent()
+    function showNotices()
     {
         $nl = new FavoritesNoticeList($this->notice, $this);
 
@@ -234,7 +138,7 @@ class ShowfavoritesAction extends Action
 
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
                           $this->page, 'showfavorites',
-                          array('nickname' => $this->user->nickname));
+                          array('nickname' => $this->getTarget()->getNickname()));
     }
 
     function showPageNotice() {
old mode 100644 (file)
new mode 100755 (executable)
index 2fd60ad65455d99968b0f01defc012fd1ddd28cd..0dace39db0a542da1031df2f40de0abe0560ee61 100644 (file)
@@ -1072,7 +1072,7 @@ class OStatusPlugin extends Plugin
             $action->elementStart('div', 'entity_actions');
             $action->elementStart('p', array('id' => 'entity_remote_subscribe',
                                              'class' => 'entity_subscribe'));
-            $action->element('a', array('href' => common_local_url($action->getTarget()),
+            $action->element('a', array('href' => common_local_url($target),
                                         'class' => 'entity_remote_subscribe'),
                                 // TRANS: Link text for link to remote subscribe.
                                 _m('Remote'));
old mode 100755 (executable)
new mode 100644 (file)
index 9e02f5eab5e3f8963ae7020bb3223058a86f8498..dfd3abaeabd401cc6852e6721b59474a19eddc17 100644 (file)
@@ -50,8 +50,8 @@ class MagicEnvelope
      */
     public function __construct($xml=null) {
         if (!empty($xml)) {
-            $dom = DOMDocument::loadXML($xml);
-            if (!$dom instanceof DOMDocument) {
+            $dom = new DOMDocument();
+            if (!$dom->loadXML($xml)) {
                 throw new ServerException('Tried to load malformed XML as DOM');
             } elseif (!$this->fromDom($dom)) {
                 throw new ServerException('Could not load MagicEnvelope from DOM');
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 54563ed0e7162c862092d9fd3fb004e081cbe9b8..fd89075032eedbe862499e173baa5fd2a81e7c78 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * A list of the user's subscriptions
@@ -48,20 +46,19 @@ class SearchSubsAction extends GalleryAction
         if ($this->page == 1) {
             // TRANS: Header for subscriptions overview for a user (first page).
             // TRANS: %s is a user nickname.
-            return sprintf(_m('%s\'s search subscriptions'), $this->user->nickname);
+            return sprintf(_m('%s\'s search subscriptions'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Header for subscriptions overview for a user (not first page).
             // TRANS: %1$s is a user nickname, %2$d is the page number.
             return sprintf(_m('%1$s\'s search subscriptions, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
 
     function showPageNotice()
     {
-        $user = common_current_user();
-        if ($user && ($user->id == $this->profile->id)) {
+        if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
             $this->element('p', null,
                            // TRANS: Page notice for page with an overview of all search subscriptions
                            // TRANS: of the logged in user's own profile.
@@ -71,7 +68,7 @@ class SearchSubsAction extends GalleryAction
                            // TRANS: Page notice for page with an overview of all subscriptions of a user other
                            // TRANS: than the logged in user. %s is the user nickname.
                            sprintf(_m('%s has subscribed to receive all notices on this site matching the following searches:'),
-                                   $this->profile->nickname));
+                                   $this->getTarget()->getNickname()));
         }
     }
 
@@ -86,12 +83,12 @@ class SearchSubsAction extends GalleryAction
             $cnt = 0;
 
             $searchsub = new SearchSub();
-            $searchsub->profile_id = $this->user->id;
+            $searchsub->profile_id = $this->getTarget()->getID();
             $searchsub->limit($limit, $offset);
             $searchsub->find();
 
             if ($searchsub->N) {
-                $list = new SearchSubscriptionsList($searchsub, $this->user, $this);
+                $list = new SearchSubscriptionsList($searchsub, $this->getTarget(), $this);
                 $cnt = $list->show();
                 if (0 == $cnt) {
                     $this->showEmptyListMessage();
@@ -102,7 +99,7 @@ class SearchSubsAction extends GalleryAction
 
             $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                               $this->page, 'searchsubs',
-                              array('nickname' => $this->user->nickname));
+                              array('nickname' => $this->getTarget()->getNickname()));
 
 
             Event::handle('EndShowTagSubscriptionsContent', array($this));
@@ -112,8 +109,7 @@ class SearchSubsAction extends GalleryAction
     function showEmptyListMessage()
     {
         if (common_logged_in()) {
-            $current_user = common_current_user();
-            if ($this->user->id === $current_user->id) {
+            if ($this->scoped->sameAs($this->getTarget())) {
                 // TRANS: Search subscription list text when the logged in user has no search subscriptions.
                 $message = _m('You are not subscribed to any text searches right now. You can push the "Subscribe" button ' .
                              'on any notice text search to automatically receive any public messages on this site that match that ' .
@@ -121,13 +117,13 @@ class SearchSubsAction extends GalleryAction
             } else {
                 // TRANS: Search subscription list text when looking at the subscriptions for a of a user other
                 // TRANS: than the logged in user that has no search subscriptions. %s is the user nickname.
-                $message = sprintf(_m('%s is not subscribed to any searches.'), $this->user->nickname);
+                $message = sprintf(_m('%s is not subscribed to any searches.'), $this->getTarget()->getNickname());
             }
         }
         else {
             // TRANS: Subscription list text when looking at the subscriptions for a of a user that has none
             // TRANS: as an anonymous user. %s is the user nickname.
-            $message = sprintf(_m('%s is not subscribed to any searches.'), $this->user->nickname);
+            $message = sprintf(_m('%s is not subscribed to any searches.'), $this->getTarget()->getNickname());
         }
 
         $this->elementStart('div', 'guide');
old mode 100644 (file)
new mode 100755 (executable)
index be195250f679027c715177dc6e1dc9c8cd0fe617..1e927b4fd175437133808b33fd04dd1885073366 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * A list of the user's subscriptions
@@ -48,20 +46,19 @@ class TagSubsAction extends GalleryAction
         if ($this->page == 1) {
             // TRANS: Header for subscriptions overview for a user (first page).
             // TRANS: %s is a user nickname.
-            return sprintf(_m('%s\'s tag subscriptions'), $this->user->nickname);
+            return sprintf(_m('%s\'s tag subscriptions'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Header for subscriptions overview for a user (not first page).
             // TRANS: %1$s is a user nickname, %2$d is the page number.
             return sprintf(_m('%1$s\'s tag subscriptions, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
 
     function showPageNotice()
     {
-        $user = common_current_user();
-        if ($user && ($user->id == $this->profile->id)) {
+        if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
             $this->element('p', null,
                            // TRANS: Page notice for page with an overview of all tag subscriptions
                            // TRANS: of the logged in user's own profile.
@@ -71,7 +68,7 @@ class TagSubsAction extends GalleryAction
                            // TRANS: Page notice for page with an overview of all subscriptions of a user other
                            // TRANS: than the logged in user. %s is the user nickname.
                            sprintf(_m('%s has subscribed to receive all notices on this site containing the following tags:'),
-                                   $this->profile->nickname));
+                                   $this->getTarget()->getNickname()));
         }
     }
 
@@ -86,12 +83,12 @@ class TagSubsAction extends GalleryAction
             $cnt = 0;
 
             $tagsub = new TagSub();
-            $tagsub->profile_id = $this->user->id;
+            $tagsub->profile_id = $this->getTarget()->getID();
             $tagsub->limit($limit, $offset);
             $tagsub->find();
 
             if ($tagsub->N) {
-                $list = new TagSubscriptionsList($tagsub, $this->user, $this);
+                $list = new TagSubscriptionsList($tagsub, $this->getTarget(), $this);
                 $cnt = $list->show();
                 if (0 == $cnt) {
                     $this->showEmptyListMessage();
@@ -102,7 +99,7 @@ class TagSubsAction extends GalleryAction
 
             $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                               $this->page, 'tagsubs',
-                              array('nickname' => $this->user->nickname));
+                              array('nickname' => $this->getTarget()->getNickname()));
 
 
             Event::handle('EndShowTagSubscriptionsContent', array($this));
@@ -112,8 +109,7 @@ class TagSubsAction extends GalleryAction
     function showEmptyListMessage()
     {
         if (common_logged_in()) {
-            $current_user = common_current_user();
-            if ($this->user->id === $current_user->id) {
+            if ($this->scoped->sameAs($this->getTarget())) {
                 // TRANS: Tag subscription list text when the logged in user has no tag subscriptions.
                 $message = _m('You are not listening to any hash tags right now. You can push the "Subscribe" button ' .
                               'on any hashtag page to automatically receive any public messages on this site that use that ' .
@@ -121,13 +117,13 @@ class TagSubsAction extends GalleryAction
             } else {
                 // TRANS: Tag subscription list text when looking at the subscriptions for a of a user other
                 // TRANS: than the logged in user that has no tag subscriptions. %s is the user nickname.
-                $message = sprintf(_m('%s is not following any tags.'), $this->user->nickname);
+                $message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname());
             }
         }
         else {
             // TRANS: Subscription list text when looking at the subscriptions for a of a user that has none
             // TRANS: as an anonymous user. %s is the user nickname.
-            $message = sprintf(_m('%s is not following any tags.'), $this->user->nickname);
+            $message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname());
         }
 
         $this->elementStart('div', 'guide');
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)