Skip to:
Content

BuddyPress.org

Ticket #7807: 7807.patch

File 7807.patch, 2.3 KB (added by imath, 8 years ago)
  • src/bp-templates/bp-nouveau/includes/messages/ajax.php

    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() { 
    107107 */
    108108function bp_nouveau_ajax_messages_send_reply() {
    109109        $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>',
    111111                'type'     => 'error',
    112112        );
    113113
    function bp_nouveau_ajax_messages_send_reply() { 
    197197function bp_nouveau_ajax_get_user_message_threads() {
    198198        global $messages_template;
    199199
    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' ) ) {
    201201                wp_send_json_error( array(
    202202                        'feedback' => '<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>' . __( 'Unauthorized request.', 'buddypress' ) . '</p></div>',
    203203                        'type'     => 'error'
  • src/bp-templates/bp-nouveau/js/buddypress-messages.js

    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 || {}; 
    12091209                        this.views.add( '#bp-message-thread-header', new bp.Views.userMessagesHeader( { model: this.options.thread } ) );
    12101210                },
    12111211
    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                        }
    12141216                },
    12151217
    12161218                addMessage: function( message ) {
    window.bp = window.bp || {}; 
    12521254                },
    12531255
    12541256                replyError: function( response ) {
    1255                         console.log( response );
     1257                        if ( response.feedback && response.type ) {
     1258                                bp.Nouveau.Messages.displayFeedback( response.feedback, response.type );
     1259                        }
    12561260                }
    12571261        } );
    12581262