Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- action_transfer_ok = function(idChat, Support_transfer){
- var transfer_list_msg = $('.boxChatClient[idChat="' + idChat + '"] .box_transfer .transfer_list_msg').val();
- //debugjs(idChat);
- //debugjs(transfer_list_msg);
- if(transfer_list_msg != '' && Support_transfer != '' && Support_transfer != undefined){
- transfer_list_msg = transfer_list_msg.replace(/<br ?\/?>/g, '%@');
- var body_msg_t = [{"i": 1, "msg": transfer_list_msg , "img":""}];
- msg = {type:'transfer', body: body_msg_t, from: thisSupport_Id, to: idChat, employ:Support_transfer};
- //debugjs(msg);
- try {
- var account_type = $('.boxChatClient[idChat="' + idChat + '"]').attr('account_type');
- if(account_type == 'facebook'){
- var link = DOMAIN + '/api.php?mod=chat&cmd=transferNewSupport';
- $.post( link, {
- 'idChat': idChat,
- 'new_support': Support_transfer,
- 'project': thisProjectToken,
- 'msg': transfer_list_msg,
- }, function(data) {
- //debugjs(data);
- if(data.status == 1){
- removeConversationOnRedis(idChat, thisSupport_Id);
- }
- }, "json");
- } else {
- Action_Sent2(msg, idChat);
- transferEnd(idChat);
- removeConversationOnRedis(idChat, thisSupport_Id);
- }
- init_notify('Cảnh báo', 'Đã chuyển thành công', 3000);
- $('.chat_row[idChat="' + idChat + '"]').parents('li').remove();
- $('.boxChatClient[idChat="' + idChat + '"]').remove();
- $('#OpenBoxModal').modal('hide');
- } catch(err) {
- debugjs('[Error] ' + err);
- };
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement