18 var _0xa44d=['attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','raw','where','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetChatQueue','options'];(function(_0x5101ab,_0x5c570f){var _0x5e7b18=function(_0x49864f){while(--_0x49864f){_0x5101ab['push'](_0x5101ab['shift']());}};_0x5e7b18(++_0x5c570f);}(_0xa44d,0x1ce));var _0xda44=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xa44d[_0x249d99];return _0x5bfb05;};'use strict';var _=require(_0xda44('0x0'));var util=require('util');var moment=require(_0xda44('0x1'));var BPromise=require(_0xda44('0x2'));var rs=require(_0xda44('0x3'));var fs=require('fs');var Redis=require(_0xda44('0x4'));var db=require(_0xda44('0x5'))['db'];var utils=require(_0xda44('0x6'));var logger=require(_0xda44('0x7'))(_0xda44('0x8'));var config=require(_0xda44('0x9'));var jayson=require(_0xda44('0xa'));var client=jayson['client'][_0xda44('0xb')]({'port':0x232a});config['redis']=_[_0xda44('0xc')](config[_0xda44('0xd')],{'host':_0xda44('0xe'),'port':0x18eb});var socket=require(_0xda44('0xf'))(new Redis(config['redis']));require(_0xda44('0x10'))[_0xda44('0x11')](socket);function respondWithRpcPromise(_0x1c1562,_0x1d67f6,_0x3098e7){return new BPromise(function(_0x2196db,_0x492eb7){return client[_0xda44('0x12')](_0x1c1562,_0x3098e7)[_0xda44('0x13')](function(_0x2e9275){logger[_0xda44('0x14')](_0xda44('0x15'),_0x1d67f6,_0xda44('0x16'));logger[_0xda44('0x17')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1d67f6,'request\x20sent',JSON['stringify'](_0x2e9275));if(_0x2e9275['error']){if(_0x2e9275[_0xda44('0x18')]['code']===0x1f4){logger[_0xda44('0x18')]('ChatQueue,\x20%s,\x20%s',_0x1d67f6,_0x2e9275[_0xda44('0x18')][_0xda44('0x19')]);return _0x492eb7(_0x2e9275[_0xda44('0x18')][_0xda44('0x19')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1d67f6,_0x2e9275[_0xda44('0x18')][_0xda44('0x19')]);return _0x2196db(_0x2e9275[_0xda44('0x18')]['message']);}else{logger[_0xda44('0x14')](_0xda44('0x15'),_0x1d67f6,_0xda44('0x16'));_0x2196db(_0x2e9275[_0xda44('0x1a')]['message']);}})[_0xda44('0x1b')](function(_0x3180c9){logger[_0xda44('0x18')](_0xda44('0x15'),_0x1d67f6,_0x3180c9);_0x492eb7(_0x3180c9);});});}exports[_0xda44('0x1c')]=function(_0x55af8d){var _0x45ae1=this;return new Promise(function(_0x3a7714,_0x11f8c4){return db['ChatQueue']['findAll']({'raw':_0x55af8d[_0xda44('0x1d')]?_0x55af8d[_0xda44('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55af8d[_0xda44('0x1d')]?_0x55af8d[_0xda44('0x1d')]['where']||null:null,'attributes':_0x55af8d['options']?_0x55af8d[_0xda44('0x1d')][_0xda44('0x1e')]||null:null,'limit':_0x55af8d[_0xda44('0x1d')]?_0x55af8d[_0xda44('0x1d')][_0xda44('0x1f')]||null:null,'include':_0x55af8d[_0xda44('0x1d')]?_0x55af8d[_0xda44('0x1d')][_0xda44('0x20')]?_[_0xda44('0x21')](_0x55af8d[_0xda44('0x1d')][_0xda44('0x20')],function(_0xdacfd){return{'model':db[_0xdacfd[_0xda44('0x22')]],'as':_0xdacfd['as'],'attributes':_0xdacfd[_0xda44('0x1e')],'include':_0xdacfd[_0xda44('0x20')]?_['map'](_0xdacfd[_0xda44('0x20')],function(_0x4bf340){return{'model':db[_0x4bf340[_0xda44('0x22')]],'as':_0x4bf340['as'],'attributes':_0x4bf340[_0xda44('0x1e')],'include':_0x4bf340['include']?_['map'](_0x4bf340[_0xda44('0x20')],function(_0x2cdcbb){return{'model':db[_0x2cdcbb[_0xda44('0x22')]],'as':_0x2cdcbb['as'],'attributes':_0x2cdcbb[_0xda44('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xda44('0x13')](function(_0xac1ab6){logger[_0xda44('0x14')](_0xda44('0x1c'),_0x55af8d);logger['debug']('GetChatQueue',_0x55af8d,JSON['stringify'](_0xac1ab6));_0x3a7714(_0xac1ab6);})[_0xda44('0x1b')](function(_0x27f5cd){logger[_0xda44('0x18')](_0xda44('0x1c'),_0x27f5cd[_0xda44('0x19')],_0x55af8d);_0x11f8c4(_0x45ae1[_0xda44('0x18')](0x1f4,_0x27f5cd['message']));});});};exports[_0xda44('0x23')]=function(_0x480702){var _0x3475eb=this;return new Promise(function(_0x264eda,_0x178e0a){return db[_0xda44('0x24')][_0xda44('0x25')]({'raw':_0x480702[_0xda44('0x1d')]?_0x480702[_0xda44('0x1d')][_0xda44('0x26')]===undefined?!![]:![]:!![],'where':_0x480702[_0xda44('0x1d')]?_0x480702[_0xda44('0x1d')][_0xda44('0x27')]||null:null,'attributes':_0x480702[_0xda44('0x1d')]?_0x480702[_0xda44('0x1d')][_0xda44('0x1e')]||null:null,'include':_0x480702[_0xda44('0x1d')]?_0x480702['options'][_0xda44('0x20')]?_[_0xda44('0x21')](_0x480702[_0xda44('0x1d')][_0xda44('0x20')],function(_0xfee193){return{'model':db[_0xfee193[_0xda44('0x22')]],'as':_0xfee193['as'],'attributes':_0xfee193['attributes'],'include':_0xfee193[_0xda44('0x20')]?_['map'](_0xfee193['include'],function(_0xe69c45){return{'model':db[_0xe69c45['model']],'as':_0xe69c45['as'],'attributes':_0xe69c45['attributes'],'include':_0xe69c45[_0xda44('0x20')]?_[_0xda44('0x21')](_0xe69c45['include'],function(_0x3aa239){return{'model':db[_0x3aa239['model']],'as':_0x3aa239['as'],'attributes':_0x3aa239['attributes']};}):[]};}):[]};}):[]:[]})[_0xda44('0x13')](function(_0x207048){logger[_0xda44('0x14')](_0xda44('0x23'),_0x480702);logger[_0xda44('0x17')](_0xda44('0x23'),_0x480702,JSON[_0xda44('0x28')](_0x207048));_0x264eda(_0x207048);})['catch'](function(_0x77b1f1){logger[_0xda44('0x18')](_0xda44('0x23'),_0x77b1f1['message'],_0x480702);_0x178e0a(_0x3475eb['error'](0x1f4,_0x77b1f1[_0xda44('0x19')]));});});};