[buddypress-trac] [BuddyPress] #5289: Single notifications not deleted from the unread or read notifications lists when the item in question is deleted in 1.9 beta 2

buddypress-trac noreply at wordpress.org
Sat Dec 14 12:17:48 UTC 2013


#5289: Single notifications not deleted from the unread or read notifications
lists when the item in question is deleted in 1.9 beta 2
---------------------------+------------------
 Reporter:  henrywright    |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  2.0
Component:  Notifications  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+------------------

Comment (by henrywright):

 In bp-messages-classes.php, would it be better to add the following
 directly before the check to see if any more recipients remain for this
 message:

 {{{
 $message_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM
 {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id )
 );

                 do_action_ref_array( 'messages_thread_deleted_thread',
 array( $message_id ) );
 }}}

 Then change the {{{bp_messages_message_delete_notification}}} function to:

 {{{
 function bp_messages_message_delete_notification( $message_id = 0 ) {
         if ( bp_is_active( 'notifications' ) && !empty( $message_id ) ) {
                 bp_notifications_delete_notifications_by_item_id(
 bp_loggedin_user_id(), $message_id, buddypress()->messages->id,
 'new_message' );
         }
 }
 add_action( 'messages_thread_deleted_thread',
 'bp_messages_message_delete_notification', 10, 1 );
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5289#comment:12>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list