Built motion from commit b0a9a629.|2.6.33
[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 _0xc57c=['../../config/environment','client','http','defaults','redis','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc57c,0x9f));var _0xcc57=function(_0x2933ca,_0x56a372){_0x2933ca=_0x2933ca-0x0;var _0x53f0bc=_0xc57c[_0x2933ca];return _0x53f0bc;};'use strict';var _=require(_0xcc57('0x0'));var util=require('util');var moment=require(_0xcc57('0x1'));var BPromise=require(_0xcc57('0x2'));var rs=require(_0xcc57('0x3'));var fs=require('fs');var Redis=require(_0xcc57('0x4'));var db=require(_0xcc57('0x5'))['db'];var utils=require(_0xcc57('0x6'));var logger=require(_0xcc57('0x7'))(_0xcc57('0x8'));var config=require(_0xcc57('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcc57('0xa')][_0xcc57('0xb')]({'port':0x232a});config['redis']=_[_0xcc57('0xc')](config[_0xcc57('0xd')],{'host':_0xcc57('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc57('0xd')]));require(_0xcc57('0xf'))[_0xcc57('0x10')](socket);function respondWithRpcPromise(_0x3e6fcf,_0x16f4c0,_0xfe023b){return new BPromise(function(_0x1bbfdc,_0x5c6e53){return client[_0xcc57('0x11')](_0x3e6fcf,_0xfe023b)[_0xcc57('0x12')](function(_0x1a3e10){logger[_0xcc57('0x13')](_0xcc57('0x14'),_0x16f4c0,_0xcc57('0x15'));logger[_0xcc57('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x16f4c0,_0xcc57('0x15'),JSON[_0xcc57('0x17')](_0x1a3e10));if(_0x1a3e10[_0xcc57('0x18')]){if(_0x1a3e10[_0xcc57('0x18')][_0xcc57('0x19')]===0x1f4){logger[_0xcc57('0x18')](_0xcc57('0x14'),_0x16f4c0,_0x1a3e10['error'][_0xcc57('0x1a')]);return _0x5c6e53(_0x1a3e10[_0xcc57('0x18')][_0xcc57('0x1a')]);}logger[_0xcc57('0x18')](_0xcc57('0x14'),_0x16f4c0,_0x1a3e10[_0xcc57('0x18')][_0xcc57('0x1a')]);return _0x1bbfdc(_0x1a3e10[_0xcc57('0x18')]['message']);}else{logger[_0xcc57('0x13')](_0xcc57('0x14'),_0x16f4c0,_0xcc57('0x15'));_0x1bbfdc(_0x1a3e10['result'][_0xcc57('0x1a')]);}})[_0xcc57('0x1b')](function(_0x4df3c2){logger[_0xcc57('0x18')](_0xcc57('0x14'),_0x16f4c0,_0x4df3c2);_0x5c6e53(_0x4df3c2);});});}