Built motion from commit (unavailable).|2.5.10
[motion2.git] / server / api / chatInternalMessage / chatInternalMessage.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x888c=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0x888c,0x73));var _0xc888=function(_0x3037c5,_0x1d7d08){_0x3037c5=_0x3037c5-0x0;var _0x15922e=_0x888c[_0x3037c5];return _0x15922e;};'use strict';var _=require(_0xc888('0x0'));var util=require(_0xc888('0x1'));var moment=require(_0xc888('0x2'));var BPromise=require('bluebird');var rs=require(_0xc888('0x3'));var fs=require('fs');var Redis=require(_0xc888('0x4'));var db=require(_0xc888('0x5'))['db'];var utils=require(_0xc888('0x6'));var logger=require(_0xc888('0x7'))(_0xc888('0x8'));var config=require(_0xc888('0x9'));var jayson=require(_0xc888('0xa'));var client=jayson[_0xc888('0xb')][_0xc888('0xc')]({'port':0x232a});config[_0xc888('0xd')]=_[_0xc888('0xe')](config[_0xc888('0xd')],{'host':_0xc888('0xf'),'port':0x18eb});var socket=require(_0xc888('0x10'))(new Redis(config['redis']));require(_0xc888('0x11'))[_0xc888('0x12')](socket);function respondWithRpcPromise(_0x13d5e8,_0x2bd425,_0x25c5ec){return new BPromise(function(_0x45a898,_0x332ec4){return client[_0xc888('0x13')](_0x13d5e8,_0x25c5ec)[_0xc888('0x14')](function(_0x3e88ef){logger[_0xc888('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2bd425,_0xc888('0x16'));logger[_0xc888('0x17')](_0xc888('0x18'),_0x2bd425,_0xc888('0x16'),JSON[_0xc888('0x19')](_0x3e88ef));if(_0x3e88ef[_0xc888('0x1a')]){if(_0x3e88ef[_0xc888('0x1a')][_0xc888('0x1b')]===0x1f4){logger[_0xc888('0x1a')](_0xc888('0x1c'),_0x2bd425,_0x3e88ef[_0xc888('0x1a')]['message']);return _0x332ec4(_0x3e88ef[_0xc888('0x1a')][_0xc888('0x1d')]);}logger[_0xc888('0x1a')](_0xc888('0x1c'),_0x2bd425,_0x3e88ef['error'][_0xc888('0x1d')]);return _0x45a898(_0x3e88ef['error'][_0xc888('0x1d')]);}else{logger[_0xc888('0x15')](_0xc888('0x1c'),_0x2bd425,_0xc888('0x16'));_0x45a898(_0x3e88ef[_0xc888('0x1e')][_0xc888('0x1d')]);}})[_0xc888('0x1f')](function(_0x1b0d42){logger[_0xc888('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x2bd425,_0x1b0d42);_0x332ec4(_0x1b0d42);});});}