diff --git a/static/js/check_new_messages.js b/static/js/check_new_messages.js index 7380d9c..1d364dd 100644 --- a/static/js/check_new_messages.js +++ b/static/js/check_new_messages.js @@ -29,7 +29,7 @@ function check_new_messages_timeout(){ check_new_messages(window,it) } }, - 10000) + 60000) } var data = null diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index c0f8706..3ba761c 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -143,13 +143,24 @@ function createTicket (el) { } -function selectedUserMessenger (el,ticket_id){ - let data = { - 'ticket_id': ticket_id +function selectedUserMessenger (ticket_id=null,user_id=null){ + let data = null + let url = null + if (ticket_id !== null){ + data = { + 'ticket_id': ticket_id + } + url = 'support_show_chat_by_ticket/' + } else if (user_id !== null){ + data = { + 'user_id': user_id + } + url = 'show_chat_w_user/' } + $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/messages/support_show_chat_by_ticket/', + url: '/ru/messages/' + url, type: "POST", // async: true, cache: false, diff --git a/templates/blocks/profile/b_chats.html b/templates/blocks/profile/b_chats.html index c6f5b37..220acc3 100644 --- a/templates/blocks/profile/b_chats.html +++ b/templates/blocks/profile/b_chats.html @@ -69,7 +69,7 @@