Introduce 'inviter_id' and 'invite_sent' params to BP_Group_Member_Query

These additional parameters make it possible to use BP_Group_Member_Query for
unconfirmed group memberships, as in the case of invitations and requests. This
will allow it to be swapped for the internals of bp_group_has_members(). See

Props dcavins for an initial patch

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8044 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Swap bp_group_has_invites() internals for BP_Group_Member_Query, and introduce pagination arguments

See #5423

Props boonebgorges, dcavins

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8045 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8045

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8046 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add object caching when fetching a single user's last activity.

Previously, BP_Core_User::get_last_activity() was not being cached.
This resulted in an unnecessary query being run on every page load due
to the usage of bp_core_record_activity() on the 'wp_head' action.

This commit caches calls to BP_Core_User::get_last_activity() when a
single user ID is passed and resets the cache when the user's last
activity is updated on BP_Core_User::update_last_activity().

See #5128

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8047 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Prevent the last displayed activity on stream to be reloaded after a posted update

Since the introduction of the heartbeat feature to automatically check for new activities, when posting an update: an offset argument is used to load all new activities. This offset is given by the last activity id displayed on the stream, to be sure that specific activity is not reloaded, we need to increment this id by 1.

Fixes #5447

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8048 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Make sure a deleted message thread is no more viewable by the user

When a user deletes a message thread, the message is no more shown in its inbox or outbox, but typing the url of the message thread will load the message giving the impression, it has not been deleted. Reason is a message is completely deleted as soon as all recipients and senders deleted it. So we need to make sure the user will be redirected to his inbox if he tries to view a message thread he deleted.

Props henrywright

Fixes #5254

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8049 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Do not query for a group unnecessarily if we're on a group page.

If we're on a group page, the group object is already queried in
the BP_Groups_Component::setup_globals() method.  However,
BP_Groups_Template requeries for the group object even when we're on a
single group page.

This commit changes BP_Groups_Template to use the already-queried
group object to prevent these unnecessary queries.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8050 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Introduce new filters to add a custom column to BP_Groups_List_Table()

In Group Administration screen, plugins/themes can now use these filters to add a custom column to the groups list table.

Props shanebp

Fixes #5287

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8051 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
bp-legacy: When bulk-deleting message threads, use messages_delete_thread().

Previously, a foreach loop and a call to BP_Messages_Thread::delete()
was used to bulk-delete message threads from the inbox with AJAX.

This commit:
- Gets rid of the foreach loop and replaces the direct BP_Messages_Thread::delete() call with BP's messages_delete_thread() function.
- Properly sanitizes the posted 'thread_ids' with wp_parse_id_list().

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8052 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Cache the unread inbox count for a user.

This commit:
- Caches calls to BP_Messages_Thread::get_inbox_count()
- Invalidates the cache when a new message is sent or deleted
- Adds a unit test

See #5414

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8053 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Ensure that a last_activity value is set for each user in BP_User_Query::populate_extras()

This helps to avoid PHP notices when directly accessing this value for a user
who has not yet logged activity.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8054 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8054

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8055 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Groups: When fetching a new group object, default 'populate_extras' to false.

In r7934, the 'populate_extras' parameter was set to true.  This
parameter queries additional info about the group including group
admins, moderators and member status.

There are very few instances where we need this extra information.  We
only need this data when on a single group or in a group loop.

Therefore, this commit sets the 'populate_extras' parameter to false
by default and sets it to true when setting up the current group
object.

Fixes #5411

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8056 cdf35c40-ae34-48e0-9cc9-0c9da1808c22