Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / api / chatInternalMessage / chatInternalMessage.rpc.js
index 19e87b6..f803c86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81a9=['redis','defaults','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http'];(function(_0x5a9666,_0x30bc94){var _0x28601f=function(_0x52e447){while(--_0x52e447){_0x5a9666['push'](_0x5a9666['shift']());}};_0x28601f(++_0x30bc94);}(_0x81a9,0x81));var _0x981a=function(_0x4ed865,_0x2f18d){_0x4ed865=_0x4ed865-0x0;var _0xc4e344=_0x81a9[_0x4ed865];return _0xc4e344;};'use strict';var _=require(_0x981a('0x0'));var util=require('util');var moment=require(_0x981a('0x1'));var BPromise=require(_0x981a('0x2'));var rs=require(_0x981a('0x3'));var fs=require('fs');var Redis=require(_0x981a('0x4'));var db=require(_0x981a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x981a('0x6'));var jayson=require(_0x981a('0x7'));var client=jayson['client'][_0x981a('0x8')]({'port':0x232a});config[_0x981a('0x9')]=_[_0x981a('0xa')](config[_0x981a('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x981a('0x9')]));require(_0x981a('0xb'))[_0x981a('0xc')](socket);function respondWithRpcPromise(_0x32f8d9,_0x381c86,_0x2d1b70){return new BPromise(function(_0x41854f,_0x5ab43b){return client[_0x981a('0xd')](_0x32f8d9,_0x2d1b70)['then'](function(_0x5076f9){logger[_0x981a('0xe')](_0x981a('0xf'),_0x381c86,_0x981a('0x10'));logger[_0x981a('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x381c86,'request\x20sent',JSON[_0x981a('0x12')](_0x5076f9));if(_0x5076f9[_0x981a('0x13')]){if(_0x5076f9['error'][_0x981a('0x14')]===0x1f4){logger[_0x981a('0x13')](_0x981a('0xf'),_0x381c86,_0x5076f9[_0x981a('0x13')][_0x981a('0x15')]);return _0x5ab43b(_0x5076f9[_0x981a('0x13')]['message']);}logger[_0x981a('0x13')](_0x981a('0xf'),_0x381c86,_0x5076f9[_0x981a('0x13')][_0x981a('0x15')]);return _0x41854f(_0x5076f9['error']['message']);}else{logger['info'](_0x981a('0xf'),_0x381c86,_0x981a('0x10'));_0x41854f(_0x5076f9['result'][_0x981a('0x15')]);}})[_0x981a('0x16')](function(_0x2968f8){logger[_0x981a('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x381c86,_0x2968f8);_0x5ab43b(_0x2968f8);});});}
\ No newline at end of file
+var _0x314a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x5a3881,_0x13d038){var _0x2ef78b=function(_0x323906){while(--_0x323906){_0x5a3881['push'](_0x5a3881['shift']());}};_0x2ef78b(++_0x13d038);}(_0x314a,0xf9));var _0xa314=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x314a[_0x45b29d];return _0x32d74;};'use strict';var _=require(_0xa314('0x0'));var util=require(_0xa314('0x1'));var moment=require(_0xa314('0x2'));var BPromise=require(_0xa314('0x3'));var rs=require(_0xa314('0x4'));var fs=require('fs');var Redis=require(_0xa314('0x5'));var db=require(_0xa314('0x6'))['db'];var utils=require(_0xa314('0x7'));var logger=require(_0xa314('0x8'))(_0xa314('0x9'));var config=require(_0xa314('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa314('0xb')][_0xa314('0xc')]({'port':0x232a});config[_0xa314('0xd')]=_[_0xa314('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa314('0xd')]));require(_0xa314('0xf'))[_0xa314('0x10')](socket);function respondWithRpcPromise(_0x43e382,_0x15d82f,_0x54d4d5){return new BPromise(function(_0x346b42,_0x1cff35){return client['request'](_0x43e382,_0x54d4d5)[_0xa314('0x11')](function(_0x45a536){logger[_0xa314('0x12')](_0xa314('0x13'),_0x15d82f,_0xa314('0x14'));logger['debug'](_0xa314('0x15'),_0x15d82f,'request\x20sent',JSON[_0xa314('0x16')](_0x45a536));if(_0x45a536['error']){if(_0x45a536[_0xa314('0x17')][_0xa314('0x18')]===0x1f4){logger['error'](_0xa314('0x13'),_0x15d82f,_0x45a536[_0xa314('0x17')][_0xa314('0x19')]);return _0x1cff35(_0x45a536['error']['message']);}logger[_0xa314('0x17')](_0xa314('0x13'),_0x15d82f,_0x45a536['error'][_0xa314('0x19')]);return _0x346b42(_0x45a536['error'][_0xa314('0x19')]);}else{logger[_0xa314('0x12')](_0xa314('0x13'),_0x15d82f,_0xa314('0x14'));_0x346b42(_0x45a536[_0xa314('0x1a')][_0xa314('0x19')]);}})['catch'](function(_0x190fcc){logger[_0xa314('0x17')](_0xa314('0x13'),_0x15d82f,_0x190fcc);_0x1cff35(_0x190fcc);});});}
\ No newline at end of file