Skip to:
Content

BuddyPress.org

Ticket #2068: 2068.001.patch

File 2068.001.patch, 954 bytes (added by r-a-y, 16 years ago)
  • buddypress/bp-messages.php

     
    464464                require_once( BP_PLUGIN_DIR . '/bp-messages/bp-messages-notifications.php' );
    465465
    466466                // Send screen notifications to the recipients
    467                 foreach ( (array)$message->recipients as $recipient )
     467                foreach ( (array)$message->recipients as $recipient ) {
     468                        // remove sender from notifications list
     469                        if ( $recipient->user_id == $message->sender_id )
     470                                unset($recipient);
     471
    468472                        bp_core_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message' );
     473                }
    469474
    470475                // Send email notifications to the recipients
    471476                messages_notification_new_message( array( 'message_id' => $message->id, 'sender_id' => $message->sender_id, 'subject' => $message->subject, 'content' => $message->message, 'recipients' => $message->recipients, 'thread_id' => $message->thread_id) );