Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / services / routing / model / mailQueue.js
index 0f9ff8b..5b51368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e89=['stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','paused','loggedIn','available'];(function(_0xd0d541,_0x4cf939){var _0x488821=function(_0x5e01e3){while(--_0x5e01e3){_0xd0d541['push'](_0xd0d541['shift']());}};_0x488821(++_0x4cf939);}(_0x7e89,0x1bf));var _0x97e8=function(_0x5c4669,_0x7f9bcd){_0x5c4669=_0x5c4669-0x0;var _0xf18b6a=_0x7e89[_0x5c4669];return _0xf18b6a;};'use strict';var _=require(_0x97e8('0x0'));var md5=require(_0x97e8('0x1'));var util=require(_0x97e8('0x2'));var Redis=require(_0x97e8('0x3'));var config=require(_0x97e8('0x4'));config[_0x97e8('0x5')]=_[_0x97e8('0x6')](config[_0x97e8('0x5')],{'host':_0x97e8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x97e8('0x5')]));function MailQueue(_0x212252){this['id']=_0x212252['id']||0x0;this[_0x97e8('0x8')]=_0x212252[_0x97e8('0x8')]||'';this[_0x97e8('0x9')]=_0x212252[_0x97e8('0x9')]||0xa;this[_0x97e8('0xa')]=_0x212252['strategy']||'beepall';this[_0x97e8('0xb')]=_0x212252[_0x97e8('0xb')];this[_0x97e8('0xc')]={};this[_0x97e8('0xd')]=0x0;this['md5']='';this[_0x97e8('0xe')]();this['updateRealtime']();}MailQueue[_0x97e8('0xf')][_0x97e8('0xe')]=function(){var _0x37dac7=this[_0x97e8('0xc')][_0x97e8('0x10')];this[_0x97e8('0xc')]=_['map'](this[_0x97e8('0xb')],'id');this[_0x97e8('0xc')][_0x97e8('0x10')]=_0x37dac7;};MailQueue[_0x97e8('0xf')][_0x97e8('0x11')]=function(){this['loggedIn']=0x0;this[_0x97e8('0x12')]=0x0;for(var _0x3d1806=0x0;_0x3d1806<this['Agents']['length'];_0x3d1806+=0x1){if(this[_0x97e8('0xb')][_0x3d1806]['online']){this[_0x97e8('0x13')]+=0x1;}if(this[_0x97e8('0xb')][_0x3d1806]['mailPause']){this[_0x97e8('0x12')]+=0x1;}}this[_0x97e8('0x14')]=this[_0x97e8('0x13')]-this['paused'];this[_0x97e8('0x14')]=this[_0x97e8('0x14')]>=0x0?this['available']:0x0;var _0x26c93a={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x97e8('0x8')],'paused':this[_0x97e8('0x12')],'waiting':this[_0x97e8('0xd')]};var _0x1ef6e7=md5(JSON[_0x97e8('0x15')](_0x26c93a));if(this[_0x97e8('0x1')]!==_0x1ef6e7){this[_0x97e8('0x1')]=_0x1ef6e7;io['to'](util[_0x97e8('0x16')](_0x97e8('0x17'),_0x26c93a[_0x97e8('0x8')]))['emit'](_0x97e8('0x18'),_0x26c93a);}};module[_0x97e8('0x19')]=MailQueue;
\ No newline at end of file
+var _0xb1b4=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','mailPause','available','waiting','format','emit','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x51eb77,_0x436673){var _0x4b26fe=function(_0x4db9dc){while(--_0x4db9dc){_0x51eb77['push'](_0x51eb77['shift']());}};_0x4b26fe(++_0x436673);}(_0xb1b4,0x175));var _0x4b1b=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0xb1b4[_0x59dccc];return _0xc97bcb;};'use strict';var _=require(_0x4b1b('0x0'));var md5=require(_0x4b1b('0x1'));var util=require(_0x4b1b('0x2'));var Redis=require('ioredis');var config=require(_0x4b1b('0x3'));config[_0x4b1b('0x4')]=_[_0x4b1b('0x5')](config[_0x4b1b('0x4')],{'host':_0x4b1b('0x6'),'port':0x18eb});var io=require(_0x4b1b('0x7'))(new Redis(config['redis']));function MailQueue(_0x1b83e0){this['id']=_0x1b83e0['id']||0x0;this[_0x4b1b('0x8')]=_0x1b83e0[_0x4b1b('0x8')]||'';this[_0x4b1b('0x9')]=_0x1b83e0[_0x4b1b('0x9')]||0xa;this['strategy']=_0x1b83e0[_0x4b1b('0xa')]||_0x4b1b('0xb');this['Agents']=_0x1b83e0[_0x4b1b('0xc')];this[_0x4b1b('0xd')]={};this['waiting']=0x0;this[_0x4b1b('0x1')]='';this[_0x4b1b('0xe')]();this[_0x4b1b('0xf')]();}MailQueue[_0x4b1b('0x10')][_0x4b1b('0xe')]=function(){var _0x154408=this[_0x4b1b('0xd')]['_rr'];this[_0x4b1b('0xd')]=_[_0x4b1b('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x4b1b('0x12')]=_0x154408;};MailQueue[_0x4b1b('0x10')][_0x4b1b('0xf')]=function(){this[_0x4b1b('0x13')]=0x0;this[_0x4b1b('0x14')]=0x0;for(var _0x4c1072=0x0;_0x4c1072<this[_0x4b1b('0xc')]['length'];_0x4c1072+=0x1){if(this[_0x4b1b('0xc')][_0x4c1072]['online']){this[_0x4b1b('0x13')]+=0x1;}if(this[_0x4b1b('0xc')][_0x4c1072][_0x4b1b('0x15')]){this[_0x4b1b('0x14')]+=0x1;}}this[_0x4b1b('0x16')]=this[_0x4b1b('0x13')]-this['paused'];this[_0x4b1b('0x16')]=this[_0x4b1b('0x16')]>=0x0?this['available']:0x0;var _0x5ea908={'id':this['id'],'available':this[_0x4b1b('0x16')],'loggedIn':this[_0x4b1b('0x13')],'name':this[_0x4b1b('0x8')],'paused':this[_0x4b1b('0x14')],'waiting':this[_0x4b1b('0x17')]};var _0x3ab3dc=md5(JSON['stringify'](_0x5ea908));if(this[_0x4b1b('0x1')]!==_0x3ab3dc){this[_0x4b1b('0x1')]=_0x3ab3dc;io['to'](util[_0x4b1b('0x18')]('mail:queue:%s',_0x5ea908['name']))[_0x4b1b('0x19')]('mail_queue:save',_0x5ea908);}};module[_0x4b1b('0x1a')]=MailQueue;
\ No newline at end of file