Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / services / routing / model / chatQueue.js
index b8ac5dc..d8ed610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5e3=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn','paused','online','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x677c63,_0x4373d5){var _0x41cb67=function(_0x2025e6){while(--_0x2025e6){_0x677c63['push'](_0x677c63['shift']());}};_0x41cb67(++_0x4373d5);}(_0xf5e3,0x18c));var _0x3f5e=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf5e3[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x3f5e('0x0'));var md5=require(_0x3f5e('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x3f5e('0x2'));config[_0x3f5e('0x3')]=_['defaults'](config['redis'],{'host':_0x3f5e('0x4'),'port':0x18eb});var io=require(_0x3f5e('0x5'))(new Redis(config[_0x3f5e('0x3')]));function ChatQueue(_0x4d7289){this['id']=_0x4d7289['id']||0x0;this['name']=_0x4d7289[_0x3f5e('0x6')]||'';this[_0x3f5e('0x7')]=_0x4d7289['timeout']||0xa;this[_0x3f5e('0x8')]=_0x4d7289['strategy']||_0x3f5e('0x9');this[_0x3f5e('0xa')]=_0x4d7289['Agents'];this[_0x3f5e('0xb')]={};this[_0x3f5e('0xc')]=0x0;this['md5']='';this[_0x3f5e('0xd')]();this[_0x3f5e('0xe')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x1e66ad=this['mapAgentsId'][_0x3f5e('0xf')];this[_0x3f5e('0xb')]=_[_0x3f5e('0x10')](this[_0x3f5e('0xa')],'id');this[_0x3f5e('0xb')][_0x3f5e('0xf')]=_0x1e66ad;};ChatQueue['prototype'][_0x3f5e('0xe')]=function(){this[_0x3f5e('0x11')]=0x0;this[_0x3f5e('0x12')]=0x0;for(var _0x278706=0x0;_0x278706<this['Agents']['length'];_0x278706+=0x1){if(this[_0x3f5e('0xa')][_0x278706][_0x3f5e('0x13')]){this[_0x3f5e('0x11')]+=0x1;}if(this['Agents'][_0x278706][_0x3f5e('0x14')]){this[_0x3f5e('0x12')]+=0x1;}}this[_0x3f5e('0x15')]=this[_0x3f5e('0x11')]-this[_0x3f5e('0x12')];this[_0x3f5e('0x15')]=this[_0x3f5e('0x15')]>=0x0?this[_0x3f5e('0x15')]:0x0;var _0x4973ff={'id':this['id'],'available':this[_0x3f5e('0x15')],'loggedIn':this[_0x3f5e('0x11')],'name':this[_0x3f5e('0x6')],'paused':this[_0x3f5e('0x12')],'waiting':this[_0x3f5e('0xc')]};var _0x52c38f=md5(JSON['stringify'](_0x4973ff));if(this[_0x3f5e('0x1')]!==_0x52c38f){this[_0x3f5e('0x1')]=_0x52c38f;io['to'](util[_0x3f5e('0x16')](_0x3f5e('0x17'),_0x4973ff[_0x3f5e('0x6')]))[_0x3f5e('0x18')](_0x3f5e('0x19'),_0x4973ff);}};module[_0x3f5e('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0xee3f=['online','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','map','_rr','updateRealtime','loggedIn','paused'];(function(_0x4b935a,_0x327ee3){var _0xa298f0=function(_0x3e07c2){while(--_0x3e07c2){_0x4b935a['push'](_0x4b935a['shift']());}};_0xa298f0(++_0x327ee3);}(_0xee3f,0x1e8));var _0xfee3=function(_0x364825,_0x49dc34){_0x364825=_0x364825-0x0;var _0x796804=_0xee3f[_0x364825];return _0x796804;};'use strict';var _=require(_0xfee3('0x0'));var md5=require(_0xfee3('0x1'));var util=require(_0xfee3('0x2'));var Redis=require(_0xfee3('0x3'));var config=require(_0xfee3('0x4'));config[_0xfee3('0x5')]=_[_0xfee3('0x6')](config[_0xfee3('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xfee3('0x7'))(new Redis(config['redis']));function ChatQueue(_0x2b5cdc){this['id']=_0x2b5cdc['id']||0x0;this['name']=_0x2b5cdc[_0xfee3('0x8')]||'';this['timeout']=_0x2b5cdc[_0xfee3('0x9')]||0xa;this[_0xfee3('0xa')]=_0x2b5cdc[_0xfee3('0xa')]||_0xfee3('0xb');this[_0xfee3('0xc')]=_0x2b5cdc['Agents'];this[_0xfee3('0xd')]={};this[_0xfee3('0xe')]=0x0;this[_0xfee3('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0xfee3('0xf')][_0xfee3('0x10')]=function(){var _0x2e72c0=this[_0xfee3('0xd')]['_rr'];this[_0xfee3('0xd')]=_[_0xfee3('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xfee3('0x12')]=_0x2e72c0;};ChatQueue[_0xfee3('0xf')][_0xfee3('0x13')]=function(){this[_0xfee3('0x14')]=0x0;this[_0xfee3('0x15')]=0x0;for(var _0xfa4a40=0x0;_0xfa4a40<this[_0xfee3('0xc')]['length'];_0xfa4a40+=0x1){if(this[_0xfee3('0xc')][_0xfa4a40][_0xfee3('0x16')]){this[_0xfee3('0x14')]+=0x1;}if(this[_0xfee3('0xc')][_0xfa4a40][_0xfee3('0x17')]){this['paused']+=0x1;}}this[_0xfee3('0x18')]=this[_0xfee3('0x14')]-this[_0xfee3('0x15')];this['available']=this[_0xfee3('0x18')]>=0x0?this[_0xfee3('0x18')]:0x0;var _0x55fe06={'id':this['id'],'available':this[_0xfee3('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xfee3('0x8')],'paused':this[_0xfee3('0x15')],'waiting':this['waiting']};var _0xdfebf7=md5(JSON[_0xfee3('0x19')](_0x55fe06));if(this[_0xfee3('0x1')]!==_0xdfebf7){this['md5']=_0xdfebf7;io['to'](util['format'](_0xfee3('0x1a'),_0x55fe06[_0xfee3('0x8')]))[_0xfee3('0x1b')](_0xfee3('0x1c'),_0x55fe06);}};module[_0xfee3('0x1d')]=ChatQueue;
\ No newline at end of file