function newMessage(message, messageClass, failed = 0) {
        $('.messenger-body').append('\
            <div class="row message-row">\
                <p class="' + messageClass + '">' + message.message + '</p>\
                '+ newMenu(messageClass, message.id) +'\
            </div>\
        ');
        if (failed) {
            $('.messenger-body').append('\
                <a class="unsent">\
                    <small>\
                        This message didn\'t send. Check your internet connection and try again.\
                    </small>\
                </a><br>\
            ');
        } else {
            $('#message-body').val('');
        }
        scrollMessagesDown();
    }
/**
     * Append a new message to chat body.
     */
Append a new message to chat body.
Append a new message to chat body .
function newMessage(message, messageClass, failed = 0) {
        $('.messenger-body').append('\
            <div class="row message-row">\
                <p class="' + messageClass + '">' + message.message + '</p>\
                '+ newMenu(messageClass, message.id) +'\
            </div>\
        ');
        if (failed) {
            $('.messenger-body').append('\
                <a class="unsent">\
                    <small>\
                        This message didn\'t send. Check your internet connection and try again.\
                    </small>\
                </a><br>\
            ');
        } else {
            $('#message-body').val('');
        }
        scrollMessagesDown();
    }
function newMessage ( message , messageClass , failed = 0 ) { $ ( '.messenger-body' ) . append ( '\
            <div class="row message-row">\
                <p class="' + messageClass + '">' + message . message + '</p>\
                ' + newMenu ( messageClass , message . id ) + '\
            </div>\
        ' ) ; if ( failed ) { $ ( '.messenger-body' ) . append ( '\
                <a class="unsent">\
                    <small>\
                        This message didn\'t send. Check your internet connection and try again.\
                    </small>\
                </a><br>\
            ' ) ; } else { $ ( '#message-body' ) . val ( '' ) ; } scrollMessagesDown ( ) ; }
Append a new message to chat body.
Append a new message to chat body .