Built motion from commit (unavailable).|2.5.31
[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 _0x1bc8=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis'];(function(_0x12036f,_0x58f4e4){var _0x1216a6=function(_0x397fa9){while(--_0x397fa9){_0x12036f['push'](_0x12036f['shift']());}};_0x1216a6(++_0x58f4e4);}(_0x1bc8,0xa3));var _0x81bc=function(_0x5b96f6,_0x26fe54){_0x5b96f6=_0x5b96f6-0x0;var _0xe67cd8=_0x1bc8[_0x5b96f6];return _0xe67cd8;};'use strict';var _=require(_0x81bc('0x0'));var util=require(_0x81bc('0x1'));var moment=require(_0x81bc('0x2'));var BPromise=require(_0x81bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81bc('0x4'));var db=require(_0x81bc('0x5'))['db'];var utils=require(_0x81bc('0x6'));var logger=require(_0x81bc('0x7'))('rpc');var config=require(_0x81bc('0x8'));var jayson=require(_0x81bc('0x9'));var client=jayson[_0x81bc('0xa')][_0x81bc('0xb')]({'port':0x232a});config['redis']=_[_0x81bc('0xc')](config[_0x81bc('0xd')],{'host':_0x81bc('0xe'),'port':0x18eb});var socket=require(_0x81bc('0xf'))(new Redis(config[_0x81bc('0xd')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x2bfebc,_0x3abda4,_0x2dbe69){return new BPromise(function(_0x4c4991,_0x3e83c1){return client[_0x81bc('0x10')](_0x2bfebc,_0x2dbe69)[_0x81bc('0x11')](function(_0x1a72ab){logger['info'](_0x81bc('0x12'),_0x3abda4,_0x81bc('0x13'));logger[_0x81bc('0x14')](_0x81bc('0x15'),_0x3abda4,_0x81bc('0x13'),JSON[_0x81bc('0x16')](_0x1a72ab));if(_0x1a72ab['error']){if(_0x1a72ab[_0x81bc('0x17')][_0x81bc('0x18')]===0x1f4){logger[_0x81bc('0x17')](_0x81bc('0x12'),_0x3abda4,_0x1a72ab[_0x81bc('0x17')][_0x81bc('0x19')]);return _0x3e83c1(_0x1a72ab[_0x81bc('0x17')][_0x81bc('0x19')]);}logger[_0x81bc('0x17')](_0x81bc('0x12'),_0x3abda4,_0x1a72ab[_0x81bc('0x17')][_0x81bc('0x19')]);return _0x4c4991(_0x1a72ab[_0x81bc('0x17')][_0x81bc('0x19')]);}else{logger[_0x81bc('0x1a')](_0x81bc('0x12'),_0x3abda4,_0x81bc('0x13'));_0x4c4991(_0x1a72ab[_0x81bc('0x1b')][_0x81bc('0x19')]);}})['catch'](function(_0x32caea){logger[_0x81bc('0x17')]('ChatGroup,\x20%s,\x20%s',_0x3abda4,_0x32caea);_0x3e83c1(_0x32caea);});});}