diff --git src/bp-templates/bp-nouveau/includes/messages/ajax.php src/bp-templates/bp-nouveau/includes/messages/ajax.php
index fbca07eb2..c66c40ba6 100644
|
|
|
function bp_nouveau_ajax_messages_send_message() { |
| 107 | 107 | */ |
| 108 | 108 | function bp_nouveau_ajax_messages_send_reply() { |
| 109 | 109 | $response = array( |
| 110 | | 'feedback' => __( 'There was a problem sending your reply. Please try again.', 'buddypress' ), |
| | 110 | 'feedback' => '<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>' . __( 'There was a problem sending your reply. Please try again.', 'buddypress' ) . '</p></div>', |
| 111 | 111 | 'type' => 'error', |
| 112 | 112 | ); |
| 113 | 113 | |
| … |
… |
function bp_nouveau_ajax_messages_send_reply() { |
| 197 | 197 | function bp_nouveau_ajax_get_user_message_threads() { |
| 198 | 198 | global $messages_template; |
| 199 | 199 | |
| 200 | | if ( empty( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'bp_nouveau_messages' ) ) { |
| | 200 | if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'bp_nouveau_messages' ) ) { |
| 201 | 201 | wp_send_json_error( array( |
| 202 | 202 | 'feedback' => '<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>' . __( 'Unauthorized request.', 'buddypress' ) . '</p></div>', |
| 203 | 203 | 'type' => 'error' |
diff --git src/bp-templates/bp-nouveau/js/buddypress-messages.js src/bp-templates/bp-nouveau/js/buddypress-messages.js
index 902215e2b..e706a69f7 100644
|
|
|
window.bp = window.bp || {}; |
| 1209 | 1209 | this.views.add( '#bp-message-thread-header', new bp.Views.userMessagesHeader( { model: this.options.thread } ) ); |
| 1210 | 1210 | }, |
| 1211 | 1211 | |
| 1212 | | messagesFetchError: function( collection ) { |
| 1213 | | console.log( collection ); |
| | 1212 | messagesFetchError: function( collection, response ) { |
| | 1213 | if ( response.feedback && response.type ) { |
| | 1214 | bp.Nouveau.Messages.displayFeedback( response.feedback, response.type ); |
| | 1215 | } |
| 1214 | 1216 | }, |
| 1215 | 1217 | |
| 1216 | 1218 | addMessage: function( message ) { |
| … |
… |
window.bp = window.bp || {}; |
| 1252 | 1254 | }, |
| 1253 | 1255 | |
| 1254 | 1256 | replyError: function( response ) { |
| 1255 | | console.log( response ); |
| | 1257 | if ( response.feedback && response.type ) { |
| | 1258 | bp.Nouveau.Messages.displayFeedback( response.feedback, response.type ); |
| | 1259 | } |
| 1256 | 1260 | } |
| 1257 | 1261 | } ); |
| 1258 | 1262 | |