Skip to:
Content

BuddyPress.org

Changeset 3166


Ignore:
Timestamp:
08/09/2010 08:33:16 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2568 props jeffsayre

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-messages.php

    r3157 r3166  
    155155    messages_remove_callback_values();
    156156
    157     /* Check if the message form has been submitted */
     157    // Check if the message form has been submitted
    158158    if ( isset( $_POST['send'] ) ) {
    159159
    160         /* Check the nonce */
     160        // Check the nonce
    161161        check_admin_referer( 'messages_send_message' );
    162162
    163         /* Check we have what we need */
     163        // Check we have what we need
    164164        if ( empty( $_POST['subject'] ) || empty( $_POST['content'] ) ) {
    165165            bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' );
    166166        } else {
    167             /* If this is a notice, send it */
     167            // If this is a notice, send it
    168168            if ( isset( $_POST['send-notice'] ) ) {
    169169                if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) {
     
    174174                }
    175175            } else {
    176                 /* Filter recipients into the format we need - array( 'username/userid', 'username/userid' ) */
     176                // Filter recipients into the format we need - array( 'username/userid', 'username/userid' )
    177177                $autocomplete_recipients = explode( ',', $_POST['send-to-input'] );
    178                 $typed_recipients = explode( ' ', $_POST['send_to_usernames'] );
    179                 $recipients = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients );
    180 
    181                 /* Send the message */
     178                $typed_recipients        = explode( ' ', $_POST['send_to_usernames'] );
     179                $recipients              = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients );
     180                $recipients              = apply_filters( 'bp_messages_recipients', $recipients );
     181
     182                // Send the message
    182183                if ( $thread_id = messages_new_message( array( 'recipients' => $recipients, 'subject' => $_POST['subject'], 'content' => $_POST['content'] ) ) ) {
    183184                    bp_core_add_message( __( 'Message sent successfully!', 'buddypress' ) );
     
    188189            }
    189190        }
    190 
    191191    }
    192192
Note: See TracChangeset for help on using the changeset viewer.