Skip to:
Content

BuddyPress.org

Changeset 7652


Ignore:
Timestamp:
12/07/2013 09:27:45 PM (13 years ago)
Author:
r-a-y
Message:

Groups: Fix invalid arguments for new notification function calls.

See #5266, #5282.

Props imath.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-notifications.php

    r7624 r7652  
    6060
    6161        if ( bp_is_active( 'notifications' ) ) {
    62                 bp_notifications_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
     62                bp_notifications_add_notification( array(
     63                        'user_id'           => $admin_id,
     64                        'item_id'           => $requesting_user_id,
     65                        'secondary_item_id' => $group_id,
     66                        'component_name'    => buddypress()->groups->id,
     67                        'component_action'  => 'new_membership_request'
     68                ) );
    6369        }
    6470
     
    111117        // Post a screen notification first.
    112118        if ( bp_is_active( 'notifications' ) ) {
    113                 if ( $accepted ) {
    114                         bp_notifications_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_accepted' );
    115                 } else {
    116                         bp_notifications_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' );
    117                 }
     119
     120                $type = ! empty( $accepted ) ? 'membership_request_accepted' : 'membership_request_rejected' ;
     121
     122                bp_notifications_add_notification( array(
     123                        'user_id'           => $requesting_user_id,
     124                        'item_id'           => $group_id,
     125                        'component_name'    => buddypress()->groups->id,
     126                        'component_action'  => $type
     127                ) );
    118128        }
    119129
     
    182192        // Post a screen notification first.
    183193        if ( bp_is_active( 'notifications' ) ) {
    184                 bp_notifications_add_notification( $group_id, $user_id, 'groups', $type );
     194                bp_notifications_add_notification( array(
     195                        'user_id'           => $user_id,
     196                        'item_id'           => $group_id,
     197                        'component_name'    => buddypress()->groups->id,
     198                        'component_action'  => $type,
     199                        'date_notified'     => bp_core_current_time(),
     200                        'is_new'            => 1,
     201                ) );
    185202        }
    186203
     
    235252                // Post a screen notification first.
    236253                if ( bp_is_active( 'notifications' ) ) {
    237                         bp_notifications_add_notification( $group->id, $invited_user_id, 'groups', 'group_invite' );
     254                        bp_notifications_add_notification( array(
     255                                'user_id'           => $invited_user_id,
     256                                'item_id'           => $group->id,
     257                                'component_name'    => buddypress()->groups->id,
     258                                'component_action'  => 'group_invite'
     259                        ) );
    238260                }
    239261
     
    593615function bp_groups_screen_group_admin_requests_mark_notifications( $group_id ) {
    594616        if ( bp_is_active( 'notifications' ) ) {
    595                 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $group_id, 'new_membership_request' );
     617                bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'new_membership_request' );
    596618        }
    597619}
Note: See TracChangeset for help on using the changeset viewer.