Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / services / routing / model / mailQueue.js
index 7a11895..b6c2acb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc0e=['updateRouting','_rr','map','prototype','updateRealtime','loggedIn','mailPause','paused','available','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x2e52e3,_0x200273){var _0x562cf3=function(_0x5c8808){while(--_0x5c8808){_0x2e52e3['push'](_0x2e52e3['shift']());}};_0x562cf3(++_0x200273);}(_0xdc0e,0xa8));var _0xedc0=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0xdc0e[_0x228a4a];return _0x3d3937;};'use strict';var _=require('lodash');var md5=require(_0xedc0('0x0'));var util=require(_0xedc0('0x1'));var Redis=require(_0xedc0('0x2'));var config=require(_0xedc0('0x3'));config[_0xedc0('0x4')]=_[_0xedc0('0x5')](config[_0xedc0('0x4')],{'host':_0xedc0('0x6'),'port':0x18eb});var io=require(_0xedc0('0x7'))(new Redis(config[_0xedc0('0x4')]));function MailQueue(_0x3a5d87){this['id']=_0x3a5d87['id']||0x0;this[_0xedc0('0x8')]=_0x3a5d87[_0xedc0('0x8')]||'';this[_0xedc0('0x9')]=_0x3a5d87[_0xedc0('0x9')]||0xa;this[_0xedc0('0xa')]=_0x3a5d87['strategy']||'beepall';this[_0xedc0('0xb')]=_0x3a5d87[_0xedc0('0xb')];this[_0xedc0('0xc')]={};this[_0xedc0('0xd')]=0x0;this[_0xedc0('0x0')]='';this[_0xedc0('0xe')]();this['updateRealtime']();}MailQueue['prototype']['updateRouting']=function(){var _0x5c4fd7=this['mapAgentsId'][_0xedc0('0xf')];this[_0xedc0('0xc')]=_[_0xedc0('0x10')](this[_0xedc0('0xb')],'id');this['mapAgentsId'][_0xedc0('0xf')]=_0x5c4fd7;};MailQueue[_0xedc0('0x11')][_0xedc0('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x29faf7=0x0;_0x29faf7<this[_0xedc0('0xb')]['length'];_0x29faf7+=0x1){if(this['Agents'][_0x29faf7]['online']){this[_0xedc0('0x13')]+=0x1;}if(this['Agents'][_0x29faf7][_0xedc0('0x14')]){this[_0xedc0('0x15')]+=0x1;}}this[_0xedc0('0x16')]=this[_0xedc0('0x13')]-this['paused'];this[_0xedc0('0x16')]=this[_0xedc0('0x16')]>=0x0?this['available']:0x0;var _0x43e889={'id':this['id'],'available':this[_0xedc0('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xedc0('0x8')],'paused':this[_0xedc0('0x15')],'waiting':this[_0xedc0('0xd')]};var _0x59079a=md5(JSON['stringify'](_0x43e889));if(this[_0xedc0('0x0')]!==_0x59079a){this['md5']=_0x59079a;io['to'](util['format'](_0xedc0('0x17'),_0x43e889['name']))['emit'](_0xedc0('0x18'),_0x43e889);}};module[_0xedc0('0x19')]=MailQueue;
\ No newline at end of file
+var _0x15b6=['waiting','stringify','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','loggedIn','length','online','mailPause','paused','available'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x15b6,0x161));var _0x615b=function(_0x1c9ae7,_0x4818bb){_0x1c9ae7=_0x1c9ae7-0x0;var _0x2d400d=_0x15b6[_0x1c9ae7];return _0x2d400d;};'use strict';var _=require(_0x615b('0x0'));var md5=require(_0x615b('0x1'));var util=require('util');var Redis=require(_0x615b('0x2'));var config=require(_0x615b('0x3'));config['redis']=_[_0x615b('0x4')](config[_0x615b('0x5')],{'host':_0x615b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x615b('0x5')]));function MailQueue(_0x284881){this['id']=_0x284881['id']||0x0;this[_0x615b('0x7')]=_0x284881[_0x615b('0x7')]||'';this[_0x615b('0x8')]=_0x284881['timeout']||0xa;this[_0x615b('0x9')]=_0x284881[_0x615b('0x9')]||_0x615b('0xa');this[_0x615b('0xb')]=_0x284881[_0x615b('0xb')];this[_0x615b('0xc')]={};this['waiting']=0x0;this[_0x615b('0x1')]='';this[_0x615b('0xd')]();this[_0x615b('0xe')]();}MailQueue['prototype'][_0x615b('0xd')]=function(){var _0x50fdca=this['mapAgentsId'][_0x615b('0xf')];this[_0x615b('0xc')]=_['map'](this[_0x615b('0xb')],'id');this[_0x615b('0xc')][_0x615b('0xf')]=_0x50fdca;};MailQueue['prototype']['updateRealtime']=function(){this[_0x615b('0x10')]=0x0;this['paused']=0x0;for(var _0x19fe11=0x0;_0x19fe11<this[_0x615b('0xb')][_0x615b('0x11')];_0x19fe11+=0x1){if(this[_0x615b('0xb')][_0x19fe11][_0x615b('0x12')]){this[_0x615b('0x10')]+=0x1;}if(this['Agents'][_0x19fe11][_0x615b('0x13')]){this[_0x615b('0x14')]+=0x1;}}this[_0x615b('0x15')]=this[_0x615b('0x10')]-this['paused'];this[_0x615b('0x15')]=this[_0x615b('0x15')]>=0x0?this[_0x615b('0x15')]:0x0;var _0x431b04={'id':this['id'],'available':this[_0x615b('0x15')],'loggedIn':this[_0x615b('0x10')],'name':this[_0x615b('0x7')],'paused':this['paused'],'waiting':this[_0x615b('0x16')]};var _0x235dc3=md5(JSON[_0x615b('0x17')](_0x431b04));if(this['md5']!==_0x235dc3){this['md5']=_0x235dc3;io['to'](util['format']('mail:queue:%s',_0x431b04[_0x615b('0x7')]))['emit']('mail_queue:save',_0x431b04);}};module[_0x615b('0x18')]=MailQueue;
\ No newline at end of file