Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / chatGroup / chatGroup.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 _0x088f=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0xc3f291,_0x9b52e9){var _0x11e318=function(_0x355318){while(--_0x355318){_0xc3f291['push'](_0xc3f291['shift']());}};_0x11e318(++_0x9b52e9);}(_0x088f,0x152));var _0xf088=function(_0x1f82a1,_0x2324f4){_0x1f82a1=_0x1f82a1-0x0;var _0x5772d2=_0x088f[_0x1f82a1];return _0x5772d2;};'use strict';var _=require(_0xf088('0x0'));var util=require(_0xf088('0x1'));var moment=require('moment');var BPromise=require(_0xf088('0x2'));var rs=require(_0xf088('0x3'));var fs=require('fs');var Redis=require(_0xf088('0x4'));var db=require(_0xf088('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf088('0x6'));var config=require(_0xf088('0x7'));var jayson=require(_0xf088('0x8'));var client=jayson[_0xf088('0x9')][_0xf088('0xa')]({'port':0x232a});config[_0xf088('0xb')]=_[_0xf088('0xc')](config[_0xf088('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf088('0xb')]));require(_0xf088('0xd'))[_0xf088('0xe')](socket);function respondWithRpcPromise(_0x3e1b80,_0x24770c,_0x2e8b97){return new BPromise(function(_0x563515,_0x4d8e32){return client[_0xf088('0xf')](_0x3e1b80,_0x2e8b97)['then'](function(_0x4a95b9){logger[_0xf088('0x10')](_0xf088('0x11'),_0x24770c,_0xf088('0x12'));logger[_0xf088('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x24770c,_0xf088('0x12'),JSON[_0xf088('0x14')](_0x4a95b9));if(_0x4a95b9[_0xf088('0x15')]){if(_0x4a95b9[_0xf088('0x15')][_0xf088('0x16')]===0x1f4){logger[_0xf088('0x15')](_0xf088('0x11'),_0x24770c,_0x4a95b9[_0xf088('0x15')][_0xf088('0x17')]);return _0x4d8e32(_0x4a95b9[_0xf088('0x15')][_0xf088('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x24770c,_0x4a95b9[_0xf088('0x15')][_0xf088('0x17')]);return _0x563515(_0x4a95b9['error'][_0xf088('0x17')]);}else{logger[_0xf088('0x10')]('ChatGroup,\x20%s,\x20%s',_0x24770c,_0xf088('0x12'));_0x563515(_0x4a95b9[_0xf088('0x18')][_0xf088('0x17')]);}})[_0xf088('0x19')](function(_0x2a3451){logger[_0xf088('0x15')](_0xf088('0x11'),_0x24770c,_0x2a3451);_0x4d8e32(_0x2a3451);});});}