]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorpostblue <postblue+git@postblue.info>
Sat, 25 Oct 2014 16:44:32 +0000 (18:44 +0200)
committerpostblue <postblue+git@postblue.info>
Sat, 25 Oct 2014 16:44:32 +0000 (18:44 +0200)
22 files changed:
README.md
actions/deleteuser.php
actions/newgroup.php
classes/File.php
classes/Notice.php
js/util.js
lib/apiaction.php [changed mode: 0644->0755]
lib/framework.php
lib/groupaction.php
lib/menu.php
lib/peopletaggroupnav.php
lib/searchgroupnav.php
lib/subgroupnav.php
plugins/Bookmark/classes/Bookmark.php
plugins/Directory/DirectoryPlugin.php
plugins/Directory/actions/userdirectory.php
plugins/Directory/lib/sortablesubscriptionlist.php
plugins/Favorite/actions/favor.php
plugins/GroupFavorited/GroupFavoritedPlugin.php
plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
plugins/InfiniteScroll/infinitescroll.js
plugins/OStatus/OStatusPlugin.php

index 7101371ba6009acf91438d79f4fa4e9a4f4c93e1..c705dd54125d6b3985a1ae422f1c0f5176921e00 100644 (file)
--- a/README.md
+++ b/README.md
@@ -102,10 +102,15 @@ for additional terms.
 
 ## New this version
 
-This is a security fix and bug fix release since 1.1.0,
-released 2 July 2012. All 1.1.0 sites should upgrade to this version.
+This is a security fix and bug fix release since 1.1.1-alpha2.
+The current release base version, 1.1.2, began work on 2014-10-25.
+All 1.1.1 sites should upgrade to this version.
 
-It includes the following changes:
+So far it includes the following changes:
+
+- XSS security fix (thanks Simon Waters, https://www.surevine.com/ )
+
+Upgrades from _StatusNet_ 1.1.1 will also experience these improvements:
 
 - Fixes for SQL injection errors in profile lists.
 - Improved ActivityStreams JSON representation of activities and objects.
@@ -114,6 +119,7 @@ It includes the following changes:
 - Fix error in OStatus subscription for remote groups.
 - Fix error in XMPP distribution.
 
+
 ### Troubleshooting
 
 The primary output for GNU social is syslog,
@@ -130,36 +136,34 @@ conflicts in your code.
 ### Unstable version
 
 If you're adventurous or impatient, you may want
-to install the development version of
-StatusNet. To get it, use the git version control
-tool <http://git-scm.com/> like so:
+to install the development version of GNU social.
+To get it, use the git version control tool
+<http://git-scm.com/> like so:
 
     git clone git@gitorious.org:social/mainline.git
 
-Using it is a mixed bag. On the positive side, it
-usually includes the latest security and bug fix
-patches. On the downside, it may also include
-changes that require admin intervention (like
-running a script or even raw SQL!) that may not be
-documented yet. It may be a good idea to test this
-version before installing it on your production
-machines.
+In the current phase of development it is probably
+recommended to use git as a means to stay up to date
+with the source code. You can choose between these
+branches:
+- 1.1.x     "stable", few updates, well tested code
+- master    "testing", more updates, usually working well
+- nightly   "unstable", most updates, not always working
 
-To keep it up-to-date, use 'git pull'. Watch for
-conflicts!
+To keep it up-to-date, use 'git pull'. Watch for conflicts!
 
 ## Further information
 
-There are several ways to get more information
-about GNU social.
+There are several ways to get more information about GNU social.
 
 * The #social IRC channel on freenode.net <http://www.freenode.net/>.
 * The GNU social website
 * Following us on GNU social -- http://quitter.se/gnusocial
-* Following us on Twitter -- https://twitter.com/gnusocial
 
 * GNU social has a bug tracker for any defects you may find, or ideas for
   making things better. http://bugz.foocorp.net/
+* Patches are welcome, either on the bug tracker or our repository at
+  Gitorious. https://gitorious.org/social/mainline
 
 Credits
 =======
@@ -218,6 +222,7 @@ Thanks to all of the StatusNet developers:
 * Brion Vibber, StatusNet, Inc.
 * James Walker, StatusNet, Inc.
 * Samantha Doherty, designer, StatusNet, Inc.
+* Simon Waters, Surevine
 
 ### Extra special thanks to the GNU socialites
 
index 48ad9272e04b8a10f30caef25edadda02fdb6385..6b74575ab435e0d149b53ef788ca4fafde95c4d5 100644 (file)
@@ -101,6 +101,8 @@ class DeleteuserAction extends ProfileFormAction
 
     function showContent() {
         $this->areYouSureForm();
+        $block = new AccountProfileBlock($this, $this->profile);
+        $block->show();        
     }
 
     function title() {
index b20267a4968fd3c14a6f5f6df86a3beabcc5d42d..07a302ef45befda654a12e088ec8839fe6e2a044 100644 (file)
@@ -46,6 +46,12 @@ if (!defined('STATUSNET')) {
  */
 class NewgroupAction extends FormAction
 {
+    protected $group;
+
+    function getGroup() {
+        return $this->group;
+    }
+
     function title()
     {
         // TRANS: Title for form to create a group.
index 210e758419570c8044bba27429f0ca5ecdb1dde8..8eff7d61823986655a42f65bdbe1b7377894914b 100644 (file)
@@ -356,7 +356,7 @@ class File extends Managed_DataObject
             $enclosure->$key = $this->$key;
         }
 
-        $needMoreMetadataMimetypes = array(null, 'text/html', 'application/xhtml+xml');
+        $needMoreMetadataMimetypes = array(null, 'application/xhtml+xml');
 
         if (!isset($this->filename) && in_array(common_bare_mime($enclosure->mimetype), $needMoreMetadataMimetypes)) {
             // This fetches enclosure metadata for non-local links with unset/HTML mimetypes,
index b6f480ed5ef2ce9a8860cd0f797bf0e04e97df5f..f2a746a8449ec5f393d5057a44593b2f2a994771 100644 (file)
@@ -2101,6 +2101,18 @@ class Notice extends Managed_DataObject
                            $author->getNickname(),
                            $this->content);
 
+        $maxlen = self::maxContent();
+        if ($maxlen > 0 && mb_strlen($content) > $maxlen) {
+            // Web interface and current Twitter API clients will
+            // pull the original notice's text, but some older
+            // clients and RSS/Atom feeds will see this trimmed text.
+            //
+            // Unfortunately this is likely to lose tags or URLs
+            // at the end of long notices.
+            $content = mb_substr($content, 0, $maxlen - 4) . ' ...';
+        }     
+
+
         // Scope is same as this one's
         return self::saveNew($repeater->id,
                              $content,
index c300a0d93edf792547f0cbd4ff22114c2682b41a..82ca6e4bcec149bb118742e0915b629c82c8dac7 100644 (file)
@@ -749,8 +749,7 @@ var SN = { // StatusNet
                     SN.U.NoticeInlineReplyTrigger(notice);
                     return false;
                 });
-            $('li.notice-reply-comments a')
-                .on('click', function () {
+            $(document).on('click', 'li.notice-reply-comments a', function () {
                     var url = $(this).attr('href');
                     var area = $(this).closest('.threaded-replies');
                     $.get(url, {ajax: 1}, function (data, textStatus, xhr) {
@@ -857,18 +856,16 @@ var SN = { // StatusNet
                 return;
             }
 
-            var attachment_more = notice.find('.attachment.more');
-            if (attachment_more.length > 0) {
-                $(attachment_more[0]).click(function () {
-                    var m = $(this);
-                    m.addClass(SN.C.S.Processing);
-                    $.get(m.attr('href'), {ajax: 1}, function (data) {
-                        m.parent('.e-content').html($(data).find('#attachment_view .e-content').html());
-                    });
+                       $(document).on('click','.attachment.more',function () {
+                               var m = $(this);
+                               m.addClass(SN.C.S.Processing);
+                               $.get(m.attr('href'), {ajax: 1}, function (data) {
+                                       m.parent('.e-content').html($(data).find('#attachment_view .e-content').html());
+                               });
+
+                               return false;
+                       });
 
-                    return false;
-                }).attr('title', SN.msg('showmore_tooltip'));
-            }
         },
 
         /**
old mode 100644 (file)
new mode 100755 (executable)
index b55647e..4b4c94a
@@ -580,13 +580,16 @@ class ApiAction extends Action
     {
         $details = array();
 
+               $source_profile = $source->getProfile();
+               $target_profile = $target->getProfile();                
+
         $details['screen_name'] = $source->nickname;
-        $details['followed_by'] = $target->isSubscribed($source);
-        $details['following'] = $source->isSubscribed($target);
+        $details['followed_by'] = $target->isSubscribed($source_profile);
+        $details['following'] = $source->isSubscribed($target_profile);
 
         $notifications = false;
 
-        if ($source->isSubscribed($target)) {
+        if ($source->isSubscribed($target_profile)) {
             $sub = Subscription::pkeyGet(array('subscriber' =>
                 $source->id, 'subscribed' => $target->id));
 
@@ -596,7 +599,7 @@ class ApiAction extends Action
         }
 
         $details['notifications_enabled'] = $notifications;
-        $details['blocking'] = $source->hasBlocked($target);
+        $details['blocking'] = $source->hasBlocked($target_profile);
         $details['id'] = intval($source->id);
 
         return $details;
index 3c96f7c39b11728a54b07120cc3c24bb0c30a8cc..379da9692c22d2f09a719842d06ca04d71b7f994 100644 (file)
@@ -22,8 +22,8 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 define('GNUSOCIAL_ENGINE', 'GNU social');
 define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/');
 
-define('GNUSOCIAL_BASE_VERSION', '1.1.1');
-define('GNUSOCIAL_LIFECYCLE', 'alpha2'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
+define('GNUSOCIAL_BASE_VERSION', '1.1.2');
+define('GNUSOCIAL_LIFECYCLE', 'alpha1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
 
 define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);
 
index a0141a83b94e80a573cd440f53e6bb6eba570373..5d11e6acddc7e2cdeeee5ae5c4e85ae82acf1f13 100644 (file)
@@ -284,6 +284,11 @@ class GroupAction extends Action
 
         return $options;
     }
+
+    function getGroup()
+    {
+        return $this->group;
+    }
 }
 
 class GroupAdminSection extends ProfileSection
index 281ef7797be7c4af1c9aa2179cbd4df59ebbaf13..27503aa06bf59d4e48dc67e1dd57909342031680 100644 (file)
@@ -56,7 +56,7 @@ class Menu extends Widget
      *
      * @param Action $action current action, used for output
      */
-    function __construct($action=null)
+    function __construct(Action $action=null)
     {
         parent::__construct($action);
 
@@ -104,7 +104,7 @@ class Menu extends Widget
         }
     }
     
-    function item($actionName, $args, $label, $description, $id=null, $cls=null)
+    function item($actionName, array $args, $label, $description, $id=null, $cls=null)
     {
         if (empty($id)) {
             $id = $this->menuItemID($actionName, $args);
@@ -120,7 +120,7 @@ class Menu extends Widget
                              $cls);
     }
 
-    function isCurrent($actionName, $args)
+    function isCurrent($actionName, array $args)
     {
         if ($actionName != $this->actionName) {
             return false;
index bbfe4eca7e082711a74c52b821341a432a1ea535..212a90586b096e4289c79f461c6ea72a7e6c3a5d 100644 (file)
@@ -61,7 +61,7 @@ class PeopletagGroupNav extends Widget
      *
      * @param Action $action current action, used for output
      */
-    function __construct($action=null)
+    function __construct(Action $action=null)
     {
         parent::__construct($action);
         $this->action = $action;
index 40fe6a63754f587051a7173409ee5f076871a769..8481380acfd052b05d1740b77fbd1d884e822891 100644 (file)
@@ -51,7 +51,7 @@ class SearchGroupNav extends Menu
      *
      * @param Action $action current action, used for output
      */
-    function __construct($action=null, $q = null)
+    function __construct(Action $action=null, $q = null)
     {
         parent::__construct($action);
         $this->q = $q;
index 9fc5cd9e0972630402e362ef07d4b24571d1b951..40447dd41a26a7a599abf3df8776771795f8dd95 100644 (file)
@@ -50,8 +50,9 @@ class SubGroupNav extends Menu
      * Construction
      *
      * @param Action $action current action, used for output
+     * @param User   $user   Current user or NULL if "guest"
      */
-    function __construct($action=null, $user=null)
+    function __construct(Action $action=null, User $user=null)
     {
         parent::__construct($action);
         $this->user = $user;
index 65c767efddaffc36212daa00707d2cd8df6babb2..a99df87ee3d7da8da3a2117839f9d4d3a96d7a58 100644 (file)
@@ -134,6 +134,10 @@ class Bookmark extends Managed_DataObject
     static function saveNew($profile, $title, $url, $rawtags, $description,
                             $options=null)
     {
+        if (!common_valid_http_url($url)) {
+            throw new ClientException(_m('Only web bookmarks can be posted (HTTP or HTTPS).'));
+        }
+
         $nb = self::getByURL($profile, $url);
 
         if (!empty($nb)) {
index e061b89e467ea61215af4b70a4eeca880db0de76..caf137c29ec6ad0d171248d5a457d5caa9b1f45e 100644 (file)
@@ -79,11 +79,40 @@ class DirectoryPlugin extends Plugin
     function onRouterInitialized($m)
     {
 
+        $m->connect(
+            'directory/users/:filter/sort_by/:sort/reverse/:reverse',
+            array('action' => 'userdirectory'),
+            array('filter' => '[0-9a-zA-Z]|(0-9)'),            
+            array('sort' => '[a-z]+'),
+            array('reverse' => '[0-9]')                        
+        );
+
+        $m->connect(
+            'directory/users/:filter/sort_by/:sort',
+            array('action' => 'userdirectory'),
+            array('filter' => '[0-9a-zA-Z]|(0-9)'),            
+            array('sort' => '[a-z]+')            
+        );  
+
+
         $m->connect(
             'directory/users/:filter',
             array('action' => 'userdirectory'),
             array('filter' => '[0-9a-zA-Z]|(0-9)')
         );
+        
+        $m->connect(
+            'directory/users/sort_by/:sort/reverse/:reverse',
+            array('action' => 'userdirectory'),
+            array('sort' => '[a-z]+'),
+            array('reverse' => '[0-9]')                        
+        );
+
+        $m->connect(
+            'directory/users/sort_by/:sort',
+            array('action' => 'userdirectory'),
+            array('sort' => '[a-z]+')            
+        );        
 
         $m->connect(
             'directory/users',
@@ -101,6 +130,12 @@ class DirectoryPlugin extends Plugin
             array('action' => 'groupdirectory')
         );
 
+        $m->connect(
+            'groups/all',
+            array('action' => 'groupdirectory')
+        );
+
+
         return true;
     }
 
index 2a4bc7c76b640adce3a58e048d591075fb04b613..77ffb5206b22ee24d33930cdd1050110e2ec43ed 100644 (file)
@@ -233,6 +233,13 @@ class UserdirectoryAction extends Action
         } elseif (isset($this->filter) && $this->filter != 'all') {
             $args['filter'] = $this->filter;
         }
+        
+        if (isset($this->sort)) {
+            $args['sort'] = $this->sort;
+        }        
+        if (!empty($this->reverse)) {
+            $args['reverse'] = $this->reverse;
+        }
 
         $this->pagination(
             $this->page > 1,
index 4a9d50110b55e2d81a6f01e4d1645378352b0d91..75c42a5fdfc06fd254d6aca69b482295d0822dcc 100644 (file)
@@ -207,6 +207,18 @@ class SortableSubscriptionListItem extends SubscriptionListItem
 
     function endActions()
     {
+               
+               // delete button
+               $cur = common_current_user();
+        list($action, $r2args) = $this->out->returnToArgs();
+        $r2args['action'] = $action;        
+               if ($cur instanceof User && $cur->hasRight(Right::DELETEUSER)) {
+                       $this->out->elementStart('li', 'entity_delete');
+                       $df = new DeleteUserForm($this->out, $this->profile, $r2args);
+                       $df->show();            
+                       $this->out->elementEnd('li');
+               }
+                       
         $this->out->elementEnd('ul');
         $this->out->elementEnd('td');
     }
index 5b73ae20bfbdfa4a6c0f686c6a3dff34e824f9eb..37668c989cf017caa39382449f4510f11e88e5a8 100644 (file)
@@ -74,28 +74,13 @@ class FavorAction extends FormAction
             throw new AlreadyFulfilledException(_('You have already favorited this!'));
         }
 
-        $now = common_sql_now();
+        $fave = Fave::addNew($this->scoped, $this->target);
 
-        $act = new Activity();
-        $act->id = Fave::newUri($this->scoped, $this->target, $now);
-        $act->type = Fave::getObjectType();
-        $act->actor = $this->scoped->asActivityObject();
-        $act->target = $this->target->asActivityObject();
-        $act->objects = array(clone($act->target));
-        $act->verb = ActivityVerb::FAVORITE;
-        $act->title = ActivityUtils::verbToTitle($act->verb);
-        $act->time = strtotime($now);
-        // TRANS: Notification given when a user marks a notice as favorite.
-        // TRANS: %1$s is a user name or full name, %2$s is a notice URI, %3$s the link to the user's profile.
-        $act->content = sprintf(_('<a href="%3$s">%1$s</a> marked notice <a href="%2$s">%2$s</a> as a favorite.'),
-                                htmlspecialchars($this->scoped->getBestName()),
-                                htmlspecialchars($this->target->getUrl()),
-                                htmlspecialchars($this->scoped->getUrl()));
-
-
-        $stored = Notice::saveActivity($act, $this->scoped,
-                                        array('uri'=>$act->id));
+        if (empty($fave)) {
+            $this->serverError(_('Could not create favorite.'));
+        }
 
+        $this->notify($fave, $this->target, $this->scoped);
         Fave::blowCacheForProfileId($this->scoped->id);
 
         return _('Favorited the notice');
@@ -108,4 +93,25 @@ class FavorAction extends FormAction
             $disfavor->show();
         }
     }
+
+    /**
+     * Notify the author of the favorite that the user likes their notice
+     *
+     * @param Favorite $fave   the favorite in question
+     * @param Notice   $notice the notice that's been faved
+     * @param User     $user   the user doing the favoriting
+     *
+     * @return void
+     */
+    function notify($fave, $notice, $user)
+    {
+        $other = User::getKV('id', $notice->profile_id);
+        if ($other && $other->id != $user->id && !empty($other->email)) {
+            require_once INSTALLDIR.'/lib/mail.php';
+
+            mail_notify_fave($other, $user->getProfile(), $notice);
+            // XXX: notify by IM
+            // XXX: notify by SMS
+        }
+    }    
 }
index 944a7251050a11e5058dfca143c1ac6b4de9a79c..90a1fe5ca04ddd94a054ce0ee1f9bf29b2197c2f 100644 (file)
@@ -32,7 +32,7 @@ class GroupFavoritedPlugin extends Plugin
      * @param Net_URL_Mapper $m path-to-action mapper
      * @return boolean hook return
      */
-    function onRouterInitialized($m)
+    function onRouterInitialized(Net_URL_Mapper $m)
     {
         $m->connect('group/:nickname/favorited',
                     array('action' => 'groupfavorited'),
@@ -41,7 +41,7 @@ class GroupFavoritedPlugin extends Plugin
         return true;
     }
 
-    function onEndGroupGroupNav(GroupNav $nav)
+    function onEndGroupGroupNav(Menu $nav)
     {
         $action_name = $nav->action->trimmed('action');
         $nickname = $nav->group->nickname;
@@ -65,7 +65,7 @@ class GroupFavoritedPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:GroupFavorited';
 
index 28a1ab989e8785640b4ce446ef32db368cfeb395..2fd9e3ef429b71ea211a3d8e978d21ec9133062e 100644 (file)
@@ -101,7 +101,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @see Action
      */
-    function onEndGroupGroupNav($groupnav)
+    function onEndGroupGroupNav(Menu $groupnav)
     {
         $action = $groupnav->action;
         $group  = $groupnav->group;
@@ -146,7 +146,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @param GroupEditForm $form form being shown
      */
-    function onEndGroupEditFormData($form)
+    function onEndGroupEditFormData(GroupEditForm $form)
     {
         $gps = null;
 
@@ -187,19 +187,22 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onEndGroupSaveForm($action)
+    function onEndGroupSaveForm(Action $action)
     {
+        // The Action class must contain this method
+        assert(is_callable(array($action, 'getGroup')));
+
         $gps = null;
 
-        if (!empty($action->group)) {
-            $gps = Group_privacy_settings::getKV('group_id', $action->group->id);
+        if ($action->getGroup() instanceof User_group) {
+            $gps = Group_privacy_settings::getKV('group_id', $action->getGroup()->id);
         }
 
         $orig = null;
 
         if (empty($gps)) {
             $gps = new Group_privacy_settings();
-            $gps->group_id = $action->group->id;
+            $gps->group_id = $action->getGroup()->id;
         } else {
             $orig = clone($gps);
         }
@@ -230,7 +233,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onStartInterpretCommand($cmd, $arg, $user, &$result)
+    function onStartInterpretCommand($cmd, $arg, User $user, &$result)
     {
         if ($cmd == 'd' || $cmd == 'dm') {
 
@@ -264,7 +267,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndGroupActionsList($widget, $group)
+    function onEndGroupActionsList(Widget $widget, User_group $group)
     {
         $cur = common_current_user();
         $action = $widget->out;
@@ -299,7 +302,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @param
      */
-    function onStartNoticeSave(&$notice) {
+    function onStartNoticeSave(Notice &$notice) {
         // Look for group tags
         // FIXME: won't work for remote groups
         // @fixme if Notice::saveNew is refactored so we can just pull its list
@@ -378,7 +381,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndGroupProfileElements($action, $group)
+    function onEndGroupProfileElements(Action $action, User_group $group)
     {
         $gps = Group_privacy_settings::forGroup($group);
 
@@ -390,10 +393,10 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onStartShowExportData($action)
+    function onStartShowExportData(Action $action)
     {
         if ($action instanceof ShowgroupAction) {
-            $gps = Group_privacy_settings::forGroup($action->group);
+            $gps = Group_privacy_settings::forGroup($action->getGroup());
 
             if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
                 return false;
index 6fcf098dfe6e169aa99e6a2eb5261c723901311d..b00445ee34d797bb54614263eff1f5d2e8b01236 100644 (file)
@@ -1,3 +1,5 @@
+
+// notices
 jQuery(document).ready(function($){
   $('notices_primary').infinitescroll({
     debug: false,
@@ -23,5 +25,137 @@ jQuery(document).ready(function($){
             SN.U.NoticeReplyTo($(this));
             SN.U.NoticeWithAttachment($(this));
         });
+
+        // moving the loaded notices out of their container
+               $('#infscr-loading').remove();  
+               var ids_to_append = Array(); var i=0;
+               $.each($('.infscr-pages').children('.notice'),function(){
+                       
+                       // remove dupes
+                       if($('.threaded-notices > #' + $(this).attr('id')).length > 0) {
+                               $(this).remove();
+                               }
+                       
+                       // keep new unique notices
+                       else {
+                               ids_to_append[i] = $(this).attr('id');                          
+                               i++;
+                               }
+                       });
+               var loaded_html = $('.infscr-pages').html();
+               $('.infscr-pages').remove();
+
+               // no results
+               if(loaded_html == '') { 
+                       }
+               // append
+               else {
+                       $('#notices_primary ol.notices').append(loaded_html);
+                       }
+        
     });
 });
+
+
+// users
+jQuery(document).ready(function($){
+  $('profile_list').infinitescroll({
+    debug: false,
+    infiniteScroll  : !infinite_scroll_on_next_only,
+    nextSelector    : 'body#subscribers li.nav_next a, body#subscriptions li.nav_next a',
+    loadingImg      : ajax_loader_url,
+    text            : "<em>Loading the next set of users...</em>",
+    donetext        : "<em>Congratulations, you\'ve reached the end of the Internet.</em>",
+    navSelector     : "#pagination",
+    contentSelector : "#content_inner ul.profile_list",
+    itemSelector    : "#content_inner ul.profile_list > li"
+    },function(){
+        // Reply button and attachment magic need to be set up
+        // for each new notice.
+        // DO NOT run SN.Init.Notices() which will duplicate stuff.
+        $(this).find('.profile').each(function() {
+            SN.U.NoticeReplyTo($(this));
+            SN.U.NoticeWithAttachment($(this));
+        });
+
+        // moving the loaded notices out of their container
+               $('#infscr-loading').remove();  
+               var ids_to_append = Array(); var i=0;
+               $.each($('.infscr-pages').children('.profile'),function(){
+                       
+                       // remove dupes
+                       if($('.profile_list > #' + $(this).attr('id')).length > 0) {
+                               $(this).remove();
+                               }
+                       
+                       // keep new unique notices
+                       else {
+                               ids_to_append[i] = $(this).attr('id');                          
+                               i++;
+                               }
+                       });
+               var loaded_html = $('.infscr-pages').html();
+               $('.infscr-pages').remove();
+
+               // no results
+               if(loaded_html == '') { 
+                       }
+               // append
+               else {
+                       $('#content_inner ul.profile_list').append(loaded_html);
+                       }
+        
+    });
+});
+
+
+// user directory
+jQuery(document).ready(function($){
+  $('profile_list').infinitescroll({
+    debug: false,
+    infiniteScroll  : !infinite_scroll_on_next_only,
+    nextSelector    : 'body#userdirectory li.nav_next a',
+    loadingImg      : ajax_loader_url,
+    text            : "<em>Loading the next set of users...</em>",
+    donetext        : "<em>Congratulations, you\'ve reached the end of the Internet.</em>",
+    navSelector     : "#pagination",
+    contentSelector : "#profile_directory table.profile_list tbody",
+    itemSelector    : "#profile_directory table.profile_list tbody tr"
+    },function(){
+        // Reply button and attachment magic need to be set up
+        // for each new notice.
+        // DO NOT run SN.Init.Notices() which will duplicate stuff.
+        $(this).find('.profile').each(function() {
+            SN.U.NoticeReplyTo($(this));
+            SN.U.NoticeWithAttachment($(this));
+        });
+
+        // moving the loaded notices out of their container
+               $('#infscr-loading').remove();  
+               var ids_to_append = Array(); var i=0;
+               $.each($('.infscr-pages').children('.profile'),function(){
+                       
+                       // remove dupes
+                       if($('.profile_list > #' + $(this).attr('id')).length > 0) {
+                               $(this).remove();
+                               }
+                       
+                       // keep new unique notices
+                       else {
+                               ids_to_append[i] = $(this).attr('id');                          
+                               i++;
+                               }
+                       });
+               var loaded_html = $('.infscr-pages').html();
+               $('.infscr-pages').remove();
+
+               // no results
+               if(loaded_html == '') { 
+                       }
+               // append
+               else {
+                       $('#profile_directory table.profile_list tbody').append(loaded_html);
+                       }
+        
+    });
+});
\ No newline at end of file
index f78c156a7c44f1008098969ae80460eb20589d1b..a57074036abbb4c6c2eb6a10564e135094a81460 100644 (file)
@@ -1344,7 +1344,7 @@ class OStatusPlugin extends Plugin
             $oprofile = $oprofile->checkAuthorship($activity);
             $profile = $oprofile->localProfile();
         } catch (Exception $e) {
-            common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'")');
+            common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'") for activity ID: '.$activity->id);
             $profile = null;
             return false;
         }