
function update_chat_html (data,msg_cont) {
    if (data.chat_html){
        if (msg_cont !== null){
            if (msg_cont.dataset['curReceiver'] === ""){
                document.querySelector(".fotter-chat")
                if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
                    msg_cont.innerHTML = data.chat_html
                }
            } else {
                // что бы не выводился левый чат
                if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
                    msg_cont.innerHTML = data.chat_html
                }
            }
        }
    }
}


function update_list_w_users (data,old_item_tab_user,el_tab) {
    let list_of_users = document.querySelector(".block-list-of-users")
    if (list_of_users) {

        if (data.users_list_html){
            list_of_users.innerHTML = data.users_list_html
            if (el_tab !== null){
                document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).classList.add("select")
            }
        }

    }
}
