~fabrixxm/friendly-core

35b5b4590ba210efb8aac8d8cedff23a2e68b9d7 — fabrixxm 2 years ago 14156a5 master
PM message reverse order
1 files changed, 4 insertions(+), 3 deletions(-)

M qml/models/PMConversationModel.qml
M qml/models/PMConversationModel.qml => qml/models/PMConversationModel.qml +4 -3
@@ 19,7 19,7 @@ ListModel {
        pmConvModel.reload();
    }

    function reload() {
    function reload(cbk) {
        console.log("PMConversationModel.reload()");
        var doc = new XMLHttpRequest();
        doc.onreadystatechange = function() {


@@ 32,14 32,15 @@ ListModel {
                    data = JSON.parse(data);
                    if (data.length > 0) {
                        //data.reverse();
                        var k;
                        var k, t = data.length-1;
                        for (k in data) {
                            var msg = data[k];
                            var msg = data[t-k];
                            pmConvModel.append(msg);
                        }
                        reply_id = data[0].id;
                    }
                    pmConvModel.status = "ready";
                    if (cbk) cbk();
                } else {
                    pmConvModel.status = "error";
                    console.log("PMConversationModel xhr error");