Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / services / routing / model / mailQueue.js
index e2c6e27..dc035ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07a5=['updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','../../../config/environment','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x80889a,_0x1e4616){var _0xb1f419=function(_0xf52021){while(--_0xf52021){_0x80889a['push'](_0x80889a['shift']());}};_0xb1f419(++_0x1e4616);}(_0x07a5,0x96));var _0x507a=function(_0xe56790,_0x5f304d){_0xe56790=_0xe56790-0x0;var _0x145cf7=_0x07a5[_0xe56790];return _0x145cf7;};'use strict';var _=require('lodash');var md5=require(_0x507a('0x0'));var util=require(_0x507a('0x1'));var Redis=require('ioredis');var config=require(_0x507a('0x2'));config['redis']=_[_0x507a('0x3')](config['redis'],{'host':_0x507a('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0xdbda09){this['id']=_0xdbda09['id']||0x0;this[_0x507a('0x5')]=_0xdbda09[_0x507a('0x5')]||'';this[_0x507a('0x6')]=_0xdbda09[_0x507a('0x6')]||0xa;this[_0x507a('0x7')]=_0xdbda09[_0x507a('0x7')]||_0x507a('0x8');this[_0x507a('0x9')]=_0xdbda09[_0x507a('0x9')];this[_0x507a('0xa')]={};this[_0x507a('0xb')]=0x0;this['md5']='';this[_0x507a('0xc')]();this[_0x507a('0xd')]();}MailQueue[_0x507a('0xe')][_0x507a('0xc')]=function(){var _0x3347d2=this[_0x507a('0xa')]['_rr'];this[_0x507a('0xa')]=_[_0x507a('0xf')](this[_0x507a('0x9')],'id');this[_0x507a('0xa')]['_rr']=_0x3347d2;};MailQueue[_0x507a('0xe')][_0x507a('0xd')]=function(){this[_0x507a('0x10')]=0x0;this[_0x507a('0x11')]=0x0;for(var _0x4e8135=0x0;_0x4e8135<this[_0x507a('0x9')][_0x507a('0x12')];_0x4e8135+=0x1){if(this[_0x507a('0x9')][_0x4e8135][_0x507a('0x13')]){this[_0x507a('0x10')]+=0x1;}if(this['Agents'][_0x4e8135]['mailPause']){this[_0x507a('0x11')]+=0x1;}}this['available']=this[_0x507a('0x10')]-this[_0x507a('0x11')];this[_0x507a('0x14')]=this[_0x507a('0x14')]>=0x0?this[_0x507a('0x14')]:0x0;var _0x209f6d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x507a('0x10')],'name':this[_0x507a('0x5')],'paused':this[_0x507a('0x11')],'waiting':this[_0x507a('0xb')]};var _0x1b302c=md5(JSON[_0x507a('0x15')](_0x209f6d));if(this[_0x507a('0x0')]!==_0x1b302c){this[_0x507a('0x0')]=_0x1b302c;io['to'](util[_0x507a('0x16')](_0x507a('0x17'),_0x209f6d[_0x507a('0x5')]))[_0x507a('0x18')](_0x507a('0x19'),_0x209f6d);}};module[_0x507a('0x1a')]=MailQueue;
\ No newline at end of file
+var _0x251e=['paused','available','mail:queue:%s','emit','mail_queue:save','md5','util','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','loggedIn','length','mailPause'];(function(_0x3b9479,_0x44a6a9){var _0x257790=function(_0x3dc634){while(--_0x3dc634){_0x3b9479['push'](_0x3b9479['shift']());}};_0x257790(++_0x44a6a9);}(_0x251e,0x102));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0xe251('0x0'));var util=require(_0xe251('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xe251('0x2')](config[_0xe251('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xe251('0x4'))(new Redis(config[_0xe251('0x3')]));function MailQueue(_0x7a2835){this['id']=_0x7a2835['id']||0x0;this[_0xe251('0x5')]=_0x7a2835[_0xe251('0x5')]||'';this[_0xe251('0x6')]=_0x7a2835[_0xe251('0x6')]||0xa;this[_0xe251('0x7')]=_0x7a2835[_0xe251('0x7')]||_0xe251('0x8');this[_0xe251('0x9')]=_0x7a2835[_0xe251('0x9')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xe251('0xa')]();this[_0xe251('0xb')]();}MailQueue[_0xe251('0xc')][_0xe251('0xa')]=function(){var _0x355579=this['mapAgentsId'][_0xe251('0xd')];this[_0xe251('0xe')]=_['map'](this[_0xe251('0x9')],'id');this['mapAgentsId'][_0xe251('0xd')]=_0x355579;};MailQueue[_0xe251('0xc')][_0xe251('0xb')]=function(){this[_0xe251('0xf')]=0x0;this['paused']=0x0;for(var _0x3ade5e=0x0;_0x3ade5e<this[_0xe251('0x9')][_0xe251('0x10')];_0x3ade5e+=0x1){if(this[_0xe251('0x9')][_0x3ade5e]['online']){this[_0xe251('0xf')]+=0x1;}if(this[_0xe251('0x9')][_0x3ade5e][_0xe251('0x11')]){this['paused']+=0x1;}}this['available']=this[_0xe251('0xf')]-this[_0xe251('0x12')];this['available']=this[_0xe251('0x13')]>=0x0?this['available']:0x0;var _0x32600f={'id':this['id'],'available':this[_0xe251('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xe251('0x5')],'paused':this[_0xe251('0x12')],'waiting':this['waiting']};var _0x4bd7da=md5(JSON['stringify'](_0x32600f));if(this[_0xe251('0x0')]!==_0x4bd7da){this[_0xe251('0x0')]=_0x4bd7da;io['to'](util['format'](_0xe251('0x14'),_0x32600f[_0xe251('0x5')]))[_0xe251('0x15')](_0xe251('0x16'),_0x32600f);}};module['exports']=MailQueue;
\ No newline at end of file