Built motion from commit (unavailable).|2.5.25
[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 _0xc805=['request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info'];(function(_0x25f0eb,_0x2fd9d0){var _0x3e3803=function(_0x52cec4){while(--_0x52cec4){_0x25f0eb['push'](_0x25f0eb['shift']());}};_0x3e3803(++_0x2fd9d0);}(_0xc805,0x171));var _0x5c80=function(_0x2be240,_0x1e119d){_0x2be240=_0x2be240-0x0;var _0x123543=_0xc805[_0x2be240];return _0x123543;};'use strict';var _=require('lodash');var util=require(_0x5c80('0x0'));var moment=require(_0x5c80('0x1'));var BPromise=require(_0x5c80('0x2'));var rs=require(_0x5c80('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c80('0x4'))['db'];var utils=require(_0x5c80('0x5'));var logger=require(_0x5c80('0x6'))(_0x5c80('0x7'));var config=require(_0x5c80('0x8'));var jayson=require(_0x5c80('0x9'));var client=jayson[_0x5c80('0xa')][_0x5c80('0xb')]({'port':0x232a});config['redis']=_[_0x5c80('0xc')](config[_0x5c80('0xd')],{'host':_0x5c80('0xe'),'port':0x18eb});var socket=require(_0x5c80('0xf'))(new Redis(config[_0x5c80('0xd')]));require(_0x5c80('0x10'))[_0x5c80('0x11')](socket);function respondWithRpcPromise(_0x38b953,_0xf4f218,_0x2f233a){return new BPromise(function(_0x194969,_0x1c2185){return client[_0x5c80('0x12')](_0x38b953,_0x2f233a)[_0x5c80('0x13')](function(_0x1cff74){logger[_0x5c80('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0xf4f218,_0x5c80('0x15'));logger['debug'](_0x5c80('0x16'),_0xf4f218,_0x5c80('0x15'),JSON[_0x5c80('0x17')](_0x1cff74));if(_0x1cff74[_0x5c80('0x18')]){if(_0x1cff74[_0x5c80('0x18')][_0x5c80('0x19')]===0x1f4){logger['error'](_0x5c80('0x1a'),_0xf4f218,_0x1cff74['error'][_0x5c80('0x1b')]);return _0x1c2185(_0x1cff74[_0x5c80('0x18')][_0x5c80('0x1b')]);}logger['error'](_0x5c80('0x1a'),_0xf4f218,_0x1cff74[_0x5c80('0x18')][_0x5c80('0x1b')]);return _0x194969(_0x1cff74[_0x5c80('0x18')][_0x5c80('0x1b')]);}else{logger[_0x5c80('0x14')](_0x5c80('0x1a'),_0xf4f218,_0x5c80('0x15'));_0x194969(_0x1cff74[_0x5c80('0x1c')]['message']);}})[_0x5c80('0x1d')](function(_0x44e6b0){logger[_0x5c80('0x18')](_0x5c80('0x1a'),_0xf4f218,_0x44e6b0);_0x1c2185(_0x44e6b0);});});}