Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / services / routing / model / mailQueue.js
index dc035ef..ddb88b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x16a2=['stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','prototype','mapAgentsId','_rr','map','loggedIn','paused','online','available'];(function(_0x5f291d,_0x206271){var _0x42a8d8=function(_0x10c67f){while(--_0x10c67f){_0x5f291d['push'](_0x5f291d['shift']());}};_0x42a8d8(++_0x206271);}(_0x16a2,0x1d0));var _0x216a=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x16a2[_0x25662e];return _0x59b7bc;};'use strict';var _=require(_0x216a('0x0'));var md5=require(_0x216a('0x1'));var util=require(_0x216a('0x2'));var Redis=require(_0x216a('0x3'));var config=require(_0x216a('0x4'));config['redis']=_['defaults'](config[_0x216a('0x5')],{'host':_0x216a('0x6'),'port':0x18eb});var io=require(_0x216a('0x7'))(new Redis(config[_0x216a('0x5')]));function MailQueue(_0x5d5f57){this['id']=_0x5d5f57['id']||0x0;this['name']=_0x5d5f57[_0x216a('0x8')]||'';this[_0x216a('0x9')]=_0x5d5f57[_0x216a('0x9')]||0xa;this['strategy']=_0x5d5f57[_0x216a('0xa')]||_0x216a('0xb');this[_0x216a('0xc')]=_0x5d5f57[_0x216a('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x216a('0x1')]='';this[_0x216a('0xd')]();this['updateRealtime']();}MailQueue[_0x216a('0xe')][_0x216a('0xd')]=function(){var _0xf34cc6=this[_0x216a('0xf')][_0x216a('0x10')];this['mapAgentsId']=_[_0x216a('0x11')](this[_0x216a('0xc')],'id');this['mapAgentsId'][_0x216a('0x10')]=_0xf34cc6;};MailQueue[_0x216a('0xe')]['updateRealtime']=function(){this[_0x216a('0x12')]=0x0;this[_0x216a('0x13')]=0x0;for(var _0x506978=0x0;_0x506978<this[_0x216a('0xc')]['length'];_0x506978+=0x1){if(this[_0x216a('0xc')][_0x506978][_0x216a('0x14')]){this[_0x216a('0x12')]+=0x1;}if(this[_0x216a('0xc')][_0x506978]['mailPause']){this[_0x216a('0x13')]+=0x1;}}this[_0x216a('0x15')]=this['loggedIn']-this[_0x216a('0x13')];this['available']=this[_0x216a('0x15')]>=0x0?this['available']:0x0;var _0x35f178={'id':this['id'],'available':this[_0x216a('0x15')],'loggedIn':this[_0x216a('0x12')],'name':this[_0x216a('0x8')],'paused':this[_0x216a('0x13')],'waiting':this['waiting']};var _0x1ca65f=md5(JSON[_0x216a('0x16')](_0x35f178));if(this[_0x216a('0x1')]!==_0x1ca65f){this[_0x216a('0x1')]=_0x1ca65f;io['to'](util['format'](_0x216a('0x17'),_0x35f178[_0x216a('0x8')]))[_0x216a('0x18')](_0x216a('0x19'),_0x35f178);}};module[_0x216a('0x1a')]=MailQueue;
\ No newline at end of file