Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / services / routing / model / mailQueue.js
index 2b9fbf8..d40fdd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','online','paused','available','stringify','emit','mail_queue:save','exports','lodash','ioredis','redis','socket.io-emitter'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xd4a2,0x173));var _0x2d4a=function(_0x65a0a3,_0x8a7981){_0x65a0a3=_0x65a0a3-0x0;var _0x407512=_0xd4a2[_0x65a0a3];return _0x407512;};'use strict';var _=require(_0x2d4a('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x2d4a('0x1'));var config=require('../../../config/environment');config[_0x2d4a('0x2')]=_['defaults'](config[_0x2d4a('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x2d4a('0x3'))(new Redis(config[_0x2d4a('0x2')]));function MailQueue(_0x2624b5){this['id']=_0x2624b5['id']||0x0;this[_0x2d4a('0x4')]=_0x2624b5[_0x2d4a('0x4')]||'';this['timeout']=_0x2624b5[_0x2d4a('0x5')]||0xa;this[_0x2d4a('0x6')]=_0x2624b5[_0x2d4a('0x6')]||_0x2d4a('0x7');this[_0x2d4a('0x8')]=_0x2624b5[_0x2d4a('0x8')];this[_0x2d4a('0x9')]={};this[_0x2d4a('0xa')]=0x0;this[_0x2d4a('0xb')]='';this[_0x2d4a('0xc')]();this[_0x2d4a('0xd')]();}MailQueue[_0x2d4a('0xe')]['updateRouting']=function(){var _0x5f3c52=this[_0x2d4a('0x9')]['_rr'];this[_0x2d4a('0x9')]=_[_0x2d4a('0xf')](this[_0x2d4a('0x8')],'id');this[_0x2d4a('0x9')][_0x2d4a('0x10')]=_0x5f3c52;};MailQueue[_0x2d4a('0xe')][_0x2d4a('0xd')]=function(){this[_0x2d4a('0x11')]=0x0;this['paused']=0x0;for(var _0x4be8b4=0x0;_0x4be8b4<this[_0x2d4a('0x8')]['length'];_0x4be8b4+=0x1){if(this[_0x2d4a('0x8')][_0x4be8b4][_0x2d4a('0x12')]){this[_0x2d4a('0x11')]+=0x1;}if(this[_0x2d4a('0x8')][_0x4be8b4]['mailPause']){this[_0x2d4a('0x13')]+=0x1;}}this['available']=this[_0x2d4a('0x11')]-this['paused'];this[_0x2d4a('0x14')]=this[_0x2d4a('0x14')]>=0x0?this[_0x2d4a('0x14')]:0x0;var _0x388371={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x2d4a('0x13')],'waiting':this[_0x2d4a('0xa')]};var _0x321a33=md5(JSON[_0x2d4a('0x15')](_0x388371));if(this[_0x2d4a('0xb')]!==_0x321a33){this[_0x2d4a('0xb')]=_0x321a33;io['to'](util['format']('mail:queue:%s',_0x388371[_0x2d4a('0x4')]))[_0x2d4a('0x16')](_0x2d4a('0x17'),_0x388371);}};module[_0x2d4a('0x18')]=MailQueue;
\ No newline at end of file
+var _0xb114=['md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting'];(function(_0x528918,_0x3f1de0){var _0x6df9a8=function(_0x260e80){while(--_0x260e80){_0x528918['push'](_0x528918['shift']());}};_0x6df9a8(++_0x3f1de0);}(_0xb114,0x11f));var _0x4b11=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xb114[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0x4b11('0x0'));var md5=require('md5');var util=require(_0x4b11('0x1'));var Redis=require(_0x4b11('0x2'));var config=require('../../../config/environment');config[_0x4b11('0x3')]=_[_0x4b11('0x4')](config[_0x4b11('0x3')],{'host':_0x4b11('0x5'),'port':0x18eb});var io=require(_0x4b11('0x6'))(new Redis(config[_0x4b11('0x3')]));function MailQueue(_0x5556a4){this['id']=_0x5556a4['id']||0x0;this[_0x4b11('0x7')]=_0x5556a4[_0x4b11('0x7')]||'';this[_0x4b11('0x8')]=_0x5556a4[_0x4b11('0x8')]||0xa;this[_0x4b11('0x9')]=_0x5556a4[_0x4b11('0x9')]||_0x4b11('0xa');this['Agents']=_0x5556a4[_0x4b11('0xb')];this['mapAgentsId']={};this[_0x4b11('0xc')]=0x0;this[_0x4b11('0xd')]='';this[_0x4b11('0xe')]();this[_0x4b11('0xf')]();}MailQueue[_0x4b11('0x10')][_0x4b11('0xe')]=function(){var _0x5ca59b=this[_0x4b11('0x11')][_0x4b11('0x12')];this[_0x4b11('0x11')]=_[_0x4b11('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x4b11('0x12')]=_0x5ca59b;};MailQueue[_0x4b11('0x10')][_0x4b11('0xf')]=function(){this[_0x4b11('0x14')]=0x0;this[_0x4b11('0x15')]=0x0;for(var _0x46ca74=0x0;_0x46ca74<this[_0x4b11('0xb')][_0x4b11('0x16')];_0x46ca74+=0x1){if(this['Agents'][_0x46ca74]['online']){this[_0x4b11('0x14')]+=0x1;}if(this[_0x4b11('0xb')][_0x46ca74][_0x4b11('0x17')]){this['paused']+=0x1;}}this['available']=this['loggedIn']-this[_0x4b11('0x15')];this[_0x4b11('0x18')]=this[_0x4b11('0x18')]>=0x0?this[_0x4b11('0x18')]:0x0;var _0xa67776={'id':this['id'],'available':this[_0x4b11('0x18')],'loggedIn':this[_0x4b11('0x14')],'name':this[_0x4b11('0x7')],'paused':this[_0x4b11('0x15')],'waiting':this[_0x4b11('0xc')]};var _0x50a977=md5(JSON[_0x4b11('0x19')](_0xa67776));if(this[_0x4b11('0xd')]!==_0x50a977){this[_0x4b11('0xd')]=_0x50a977;io['to'](util['format'](_0x4b11('0x1a'),_0xa67776['name']))[_0x4b11('0x1b')](_0x4b11('0x1c'),_0xa67776);}};module[_0x4b11('0x1d')]=MailQueue;
\ No newline at end of file