Changeset 7530
- Timestamp:
- 11/08/2013 05:20:46 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/bp-friends-functions.php
r7110 r7530 90 90 91 91 // Remove the friend request notice 92 bp_core_ delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );92 bp_core_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 93 93 94 94 // Add a friend accepted notice for the initiating user … … 134 134 135 135 if ( !$friendship->is_confirmed && BP_Friends_Friendship::reject( $friendship_id ) ) { 136 136 137 // Remove the friend request notice 137 bp_core_ delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );138 bp_core_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 138 139 139 140 do_action_ref_array( 'friends_friendship_rejected', array( $friendship_id, &$friendship ) ); -
trunk/bp-groups/bp-groups-functions.php
r7501 r7530 697 697 */ 698 698 function groups_accept_invite( $user_id, $group_id ) { 699 global $bp;700 699 701 700 // If the user is already a member (because BP at one point allowed two invitations to … … 724 723 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 725 724 726 bp_core_ delete_notifications_by_item_id( $user_id, $group_id, $bp->groups->id, 'group_invite' );725 bp_core_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' ); 727 726 728 727 do_action( 'groups_accept_invite', $user_id, $group_id ); … … 740 739 741 740 function groups_delete_invite( $user_id, $group_id ) { 742 global $bp;743 741 744 742 $delete = BP_Groups_Member::delete_invite( $user_id, $group_id ); 745 743 746 if ( $delete ) 747 bp_core_delete_notifications_by_item_id( $user_id, $group_id, $bp->groups->id, 'group_invite' ); 744 if ( !empty( $delete ) ) { 745 bp_core_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' ); 746 } 748 747 749 748 return $delete; -
trunk/bp-members/bp-members-notifications.php
r7529 r7530 100 100 } 101 101 102 /** Delete ********************************************************************/ 103 102 104 /** 103 105 * Delete notifications for a user by type … … 163 165 } 164 166 167 /** Mark **********************************************************************/ 168 169 /** 170 * Delete notifications for a user by type 171 * 172 * Used when clearing out notifications for a specific component when the user 173 * has visited that component. 174 * 175 * @since BuddyPress (1.0) 176 * @param int $user_id 177 * @param string $component_name 178 * @param string $component_action 179 * @param int $is_new 180 * @return boolean True on success, false on fail 181 */ 182 function bp_core_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new = false ) { 183 184 // Bail if notifications is not active 185 if ( ! bp_is_active( 'notifications' ) ) { 186 return false; 187 } 188 189 return bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new ); 190 } 191 192 /** 193 * Delete notifications for an item ID 194 * 195 * Used when clearing out notifications for a specific component when the user 196 * has visited that component. 197 * 198 * @since BuddyPress (1.0) 199 * @param int $user_id 200 * @param string $component_name 201 * @param string $component_action 202 * @param int $is_new 203 * @return boolean True on success, false on fail 204 */ 205 function bp_core_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false, $is_new = false ) { 206 207 // Bail if notifications is not active 208 if ( ! bp_is_active( 'notifications' ) ) { 209 return false; 210 } 211 212 return bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id, $is_new ); 213 } 214 165 215 /** 166 216 * Mark all notifications read/unread for by type -
trunk/bp-messages/bp-messages-template.php
r7439 r7530 186 186 } else { 187 187 if ( bp_is_current_action( 'inbox' ) ) { 188 bp_core_ delete_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' );188 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' ); 189 189 } 190 190
Note: See TracChangeset
for help on using the changeset viewer.