Built motion from commit (unavailable).|2.5.16
[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 _0x76cb=['util','moment','bluebird','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash'];(function(_0x39db7c,_0xa42077){var _0x5a11f7=function(_0x518409){while(--_0x518409){_0x39db7c['push'](_0x39db7c['shift']());}};_0x5a11f7(++_0xa42077);}(_0x76cb,0x6b));var _0xb76c=function(_0x4f3242,_0x391954){_0x4f3242=_0x4f3242-0x0;var _0x49844f=_0x76cb[_0x4f3242];return _0x49844f;};'use strict';var _=require(_0xb76c('0x0'));var util=require(_0xb76c('0x1'));var moment=require(_0xb76c('0x2'));var BPromise=require(_0xb76c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb76c('0x4'))(_0xb76c('0x5'));var config=require(_0xb76c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb76c('0x7')][_0xb76c('0x8')]({'port':0x232a});config['redis']=_[_0xb76c('0x9')](config['redis'],{'host':_0xb76c('0xa'),'port':0x18eb});var socket=require(_0xb76c('0xb'))(new Redis(config[_0xb76c('0xc')]));require(_0xb76c('0xd'))[_0xb76c('0xe')](socket);function respondWithRpcPromise(_0xf55b93,_0x274a3a,_0x2d4da0){return new BPromise(function(_0x686cf,_0x177744){return client[_0xb76c('0xf')](_0xf55b93,_0x2d4da0)[_0xb76c('0x10')](function(_0x58e891){logger[_0xb76c('0x11')]('ChatGroup,\x20%s,\x20%s',_0x274a3a,'request\x20sent');logger[_0xb76c('0x12')](_0xb76c('0x13'),_0x274a3a,_0xb76c('0x14'),JSON[_0xb76c('0x15')](_0x58e891));if(_0x58e891[_0xb76c('0x16')]){if(_0x58e891['error'][_0xb76c('0x17')]===0x1f4){logger[_0xb76c('0x16')](_0xb76c('0x18'),_0x274a3a,_0x58e891[_0xb76c('0x16')][_0xb76c('0x19')]);return _0x177744(_0x58e891[_0xb76c('0x16')]['message']);}logger[_0xb76c('0x16')]('ChatGroup,\x20%s,\x20%s',_0x274a3a,_0x58e891[_0xb76c('0x16')]['message']);return _0x686cf(_0x58e891[_0xb76c('0x16')][_0xb76c('0x19')]);}else{logger[_0xb76c('0x11')](_0xb76c('0x18'),_0x274a3a,_0xb76c('0x14'));_0x686cf(_0x58e891[_0xb76c('0x1a')]['message']);}})['catch'](function(_0x5453e4){logger[_0xb76c('0x16')](_0xb76c('0x18'),_0x274a3a,_0x5453e4);_0x177744(_0x5453e4);});});}