Built motion from commit (unavailable).|2.2.0
[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 _0x24ca=['../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x24ca,0x8c));var _0xa24c=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x24ca[_0x3b0912];return _0xa8f339;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa24c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa24c('0x2'));var db=require(_0xa24c('0x3'))['db'];var utils=require(_0xa24c('0x4'));var logger=require('../../config/logger')(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var jayson=require(_0xa24c('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa24c('0x8')](config[_0xa24c('0x9')],{'host':_0xa24c('0xa'),'port':0x18eb});var socket=require(_0xa24c('0xb'))(new Redis(config[_0xa24c('0x9')]));require(_0xa24c('0xc'))['register'](socket);function respondWithRpcPromise(_0x101ca7,_0x413b3d,_0x355882){return new BPromise(function(_0x584595,_0x5a474b){return client[_0xa24c('0xd')](_0x101ca7,_0x355882)[_0xa24c('0xe')](function(_0x2da0c3){logger[_0xa24c('0xf')](_0xa24c('0x10'),_0x413b3d,_0xa24c('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x413b3d,'request\x20sent',JSON[_0xa24c('0x12')](_0x2da0c3));if(_0x2da0c3[_0xa24c('0x13')]){if(_0x2da0c3[_0xa24c('0x13')][_0xa24c('0x14')]===0x1f4){logger[_0xa24c('0x13')]('ChatGroup,\x20%s,\x20%s',_0x413b3d,_0x2da0c3[_0xa24c('0x13')]['message']);return _0x5a474b(_0x2da0c3['error']['message']);}logger[_0xa24c('0x13')](_0xa24c('0x10'),_0x413b3d,_0x2da0c3[_0xa24c('0x13')][_0xa24c('0x15')]);return _0x584595(_0x2da0c3[_0xa24c('0x13')][_0xa24c('0x15')]);}else{logger[_0xa24c('0xf')](_0xa24c('0x10'),_0x413b3d,_0xa24c('0x11'));_0x584595(_0x2da0c3[_0xa24c('0x16')][_0xa24c('0x15')]);}})[_0xa24c('0x17')](function(_0x278cce){logger[_0xa24c('0x13')]('ChatGroup,\x20%s,\x20%s',_0x413b3d,_0x278cce);_0x5a474b(_0x278cce);});});}