Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. action_transfer_ok = function(idChat, Support_transfer){
  2. var transfer_list_msg = $('.boxChatClient[idChat="' + idChat + '"] .box_transfer .transfer_list_msg').val();
  3. //debugjs(idChat);
  4. //debugjs(transfer_list_msg);
  5. if(transfer_list_msg != '' && Support_transfer != '' && Support_transfer != undefined){
  6. transfer_list_msg = transfer_list_msg.replace(/<br ?\/?>/g, '%@');
  7. var body_msg_t = [{"i": 1, "msg": transfer_list_msg , "img":""}];
  8. msg = {type:'transfer', body: body_msg_t, from: thisSupport_Id, to: idChat, employ:Support_transfer};
  9. //debugjs(msg);
  10. try {
  11.  
  12. var account_type = $('.boxChatClient[idChat="' + idChat + '"]').attr('account_type');
  13. if(account_type == 'facebook'){
  14. var link = DOMAIN + '/api.php?mod=chat&cmd=transferNewSupport';
  15. $.post( link, {
  16. 'idChat': idChat,
  17. 'new_support': Support_transfer,
  18. 'project': thisProjectToken,
  19. 'msg': transfer_list_msg,
  20. }, function(data) {
  21. //debugjs(data);
  22. if(data.status == 1){
  23. removeConversationOnRedis(idChat, thisSupport_Id);
  24. }
  25. }, "json");
  26. } else {
  27. Action_Sent2(msg, idChat);
  28. transferEnd(idChat);
  29. removeConversationOnRedis(idChat, thisSupport_Id);
  30. }
  31.  
  32.  
  33. init_notify('Cảnh báo', 'Đã chuyển thành công', 3000);
  34.  
  35. $('.chat_row[idChat="' + idChat + '"]').parents('li').remove();
  36. $('.boxChatClient[idChat="' + idChat + '"]').remove();
  37. $('#OpenBoxModal').modal('hide');
  38. } catch(err) {
  39. debugjs('[Error] ' + err);
  40. };
  41.  
  42. }
  43. return false;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement