I can confirm that the solution posted by e.mont01 works. However, it’s not advisable to edit the BuddyPress plugin files directly, so the following snippet can be used until such time as BuddyPress adopts the change – though given that the default code works on all sites that do not have EM present, I reckon that’s unlikely to happen. Anyway, here’s the code:
/**
* Amended copy of messages_add_autocomplete_js()
*/
function my_messages_add_autocomplete_js() {
// Include the autocomplete JS for composing a message.
if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) {
// ditch previously queued scripts
wp_dequeue_script( 'bp-jquery-autocomplete' );
wp_dequeue_script( 'bp-jquery-autocomplete-fb' );
wp_dequeue_script( 'bp-jquery-bgiframe' );
wp_dequeue_script( 'bp-jquery-dimensions' );
// requeue scripts in footer
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.autocomplete{$min}.js", array( 'jquery' ), bp_get_version(), true );
wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.autocompletefb{$min}.js", array(), bp_get_version(), true );
wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.bgiframe{$min}.js", array(), bp_get_version(), true );
wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.dimensions{$min}.js", array(), bp_get_version(), true );
}
}
// hook in after BuddyPress
add_action( 'bp_actions', 'my_messages_add_autocomplete_js', 11 );
Cheers, Christian