Skip to:
Content

BuddyPress.org

Changeset 13308


Ignore:
Timestamp:
08/08/2022 08:14:57 PM (2 years ago)
Author:
imath
Message:

Activity: restrict rich logging items to the site-wide stream

10.0.0 introduced richer activities about user's interaction with their profile or with groups (eg: user A changed their profile image). Displaying these richer activities into the self user or self group streams is less helpful and we are now restricting this extended version of these activity types to the site-wide activity stream.

Props dcavins

Fixes #8604

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-template.php

    r13299 r13308  
    14601460            $activity          = $activities_template->activity;
    14611461            $user_id           = $activity->user_id;
     1462            $personal_types    = array( 'new_avatar', 'new_member', 'updated_profile' );
     1463
     1464            // Do not use generated-content activities when displaying a personal activity stream.
     1465            if ( (int) $user_id === (int) bp_displayed_user_id() && in_array( $activity_type, $personal_types, true ) ) {
     1466                return false;
     1467            }
    14621468
    14631469            // Set generated content properties.
     
    15641570
    15651571            if ( 'created_group' === $activity_type || 'joined_group' === $activity_type ) {
    1566                 $group = bp_get_group( $activity->item_id );
     1572                $group         = bp_get_group( $activity->item_id );
     1573                $current_group = groups_get_current_group();
     1574
     1575                // Do not use generated-content activities when displaying a group activity stream.
     1576                if ( (int) $group->id === (int) $current_group->id ) {
     1577                    return false;
     1578                }
    15671579
    15681580                if ( isset( $bp->avatar->show_avatars ) && $bp->avatar->show_avatars && ! bp_disable_group_avatar_uploads() ) {
Note: See TracChangeset for help on using the changeset viewer.