Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / services / routing / model / mailQueue.js
index 7054fdb..a690dc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedc7=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','available','paused','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout'];(function(_0x2d390d,_0xd39db5){var _0x336f89=function(_0x4d5c1e){while(--_0x4d5c1e){_0x2d390d['push'](_0x2d390d['shift']());}};_0x336f89(++_0xd39db5);}(_0xedc7,0x1f4));var _0x7edc=function(_0x16a1a3,_0x3fb351){_0x16a1a3=_0x16a1a3-0x0;var _0x8b9db7=_0xedc7[_0x16a1a3];return _0x8b9db7;};'use strict';var _=require(_0x7edc('0x0'));var md5=require(_0x7edc('0x1'));var util=require(_0x7edc('0x2'));var Redis=require(_0x7edc('0x3'));var config=require(_0x7edc('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x7edc('0x5'),'port':0x18eb});var io=require(_0x7edc('0x6'))(new Redis(config[_0x7edc('0x7')]));function MailQueue(_0x4dacac){this['id']=_0x4dacac['id']||0x0;this[_0x7edc('0x8')]=_0x4dacac[_0x7edc('0x8')]||'';this[_0x7edc('0x9')]=_0x4dacac[_0x7edc('0x9')]||0xa;this[_0x7edc('0xa')]=_0x4dacac[_0x7edc('0xa')]||_0x7edc('0xb');this[_0x7edc('0xc')]=_0x4dacac[_0x7edc('0xc')];this[_0x7edc('0xd')]={};this[_0x7edc('0xe')]=0x0;this[_0x7edc('0x1')]='';this[_0x7edc('0xf')]();this['updateRealtime']();}MailQueue[_0x7edc('0x10')][_0x7edc('0xf')]=function(){var _0x3105f4=this[_0x7edc('0xd')][_0x7edc('0x11')];this[_0x7edc('0xd')]=_[_0x7edc('0x12')](this[_0x7edc('0xc')],'id');this[_0x7edc('0xd')][_0x7edc('0x11')]=_0x3105f4;};MailQueue['prototype'][_0x7edc('0x13')]=function(){this[_0x7edc('0x14')]=0x0;this['paused']=0x0;for(var _0x4a4a96=0x0;_0x4a4a96<this[_0x7edc('0xc')][_0x7edc('0x15')];_0x4a4a96+=0x1){if(this['Agents'][_0x4a4a96][_0x7edc('0x16')]){this[_0x7edc('0x14')]+=0x1;}if(this[_0x7edc('0xc')][_0x4a4a96]['mailPause']){this['paused']+=0x1;}}this[_0x7edc('0x17')]=this[_0x7edc('0x14')]-this[_0x7edc('0x18')];this['available']=this[_0x7edc('0x17')]>=0x0?this[_0x7edc('0x17')]:0x0;var _0x10d9a2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7edc('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x5c5059=md5(JSON[_0x7edc('0x19')](_0x10d9a2));if(this['md5']!==_0x5c5059){this[_0x7edc('0x1')]=_0x5c5059;io['to'](util['format'](_0x7edc('0x1a'),_0x10d9a2[_0x7edc('0x8')]))[_0x7edc('0x1b')](_0x7edc('0x1c'),_0x10d9a2);}};module[_0x7edc('0x1d')]=MailQueue;
\ No newline at end of file
+var _0x2ed6=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','updateRealtime','prototype','_rr','Agents','paused','online','mailPause','loggedIn','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','md5'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x2ed6,0x128));var _0x62ed=function(_0x3b6685,_0x3bbcb4){_0x3b6685=_0x3b6685-0x0;var _0x6f9cb9=_0x2ed6[_0x3b6685];return _0x6f9cb9;};'use strict';var _=require('lodash');var md5=require(_0x62ed('0x0'));var util=require(_0x62ed('0x1'));var Redis=require(_0x62ed('0x2'));var config=require(_0x62ed('0x3'));config[_0x62ed('0x4')]=_[_0x62ed('0x5')](config[_0x62ed('0x4')],{'host':_0x62ed('0x6'),'port':0x18eb});var io=require(_0x62ed('0x7'))(new Redis(config[_0x62ed('0x4')]));function MailQueue(_0x1c573f){this['id']=_0x1c573f['id']||0x0;this['name']=_0x1c573f[_0x62ed('0x8')]||'';this['timeout']=_0x1c573f[_0x62ed('0x9')]||0xa;this['strategy']=_0x1c573f[_0x62ed('0xa')]||'beepall';this['Agents']=_0x1c573f['Agents'];this[_0x62ed('0xb')]={};this[_0x62ed('0xc')]=0x0;this[_0x62ed('0x0')]='';this['updateRouting']();this[_0x62ed('0xd')]();}MailQueue[_0x62ed('0xe')]['updateRouting']=function(){var _0x141b4a=this[_0x62ed('0xb')][_0x62ed('0xf')];this[_0x62ed('0xb')]=_['map'](this[_0x62ed('0x10')],'id');this[_0x62ed('0xb')][_0x62ed('0xf')]=_0x141b4a;};MailQueue['prototype'][_0x62ed('0xd')]=function(){this['loggedIn']=0x0;this[_0x62ed('0x11')]=0x0;for(var _0x720194=0x0;_0x720194<this['Agents']['length'];_0x720194+=0x1){if(this['Agents'][_0x720194][_0x62ed('0x12')]){this['loggedIn']+=0x1;}if(this[_0x62ed('0x10')][_0x720194][_0x62ed('0x13')]){this['paused']+=0x1;}}this['available']=this[_0x62ed('0x14')]-this[_0x62ed('0x11')];this[_0x62ed('0x15')]=this[_0x62ed('0x15')]>=0x0?this['available']:0x0;var _0x241a74={'id':this['id'],'available':this[_0x62ed('0x15')],'loggedIn':this[_0x62ed('0x14')],'name':this[_0x62ed('0x8')],'paused':this[_0x62ed('0x11')],'waiting':this['waiting']};var _0x60863a=md5(JSON[_0x62ed('0x16')](_0x241a74));if(this['md5']!==_0x60863a){this[_0x62ed('0x0')]=_0x60863a;io['to'](util['format'](_0x62ed('0x17'),_0x241a74['name']))[_0x62ed('0x18')](_0x62ed('0x19'),_0x241a74);}};module[_0x62ed('0x1a')]=MailQueue;
\ No newline at end of file