Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / services / routing / model / mailQueue.js
index 08a4839..f15cd2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab5=['length','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','_rr','mapAgentsId','map','loggedIn','paused'];(function(_0x511a3e,_0x15d4bd){var _0x538aa4=function(_0x2aee2e){while(--_0x2aee2e){_0x511a3e['push'](_0x511a3e['shift']());}};_0x538aa4(++_0x15d4bd);}(_0x4ab5,0x1e9));var _0x54ab=function(_0x454db3,_0xcd150e){_0x454db3=_0x454db3-0x0;var _0x3b36da=_0x4ab5[_0x454db3];return _0x3b36da;};'use strict';var _=require(_0x54ab('0x0'));var md5=require('md5');var util=require(_0x54ab('0x1'));var Redis=require('ioredis');var config=require(_0x54ab('0x2'));config[_0x54ab('0x3')]=_[_0x54ab('0x4')](config['redis'],{'host':_0x54ab('0x5'),'port':0x18eb});var io=require(_0x54ab('0x6'))(new Redis(config[_0x54ab('0x3')]));function MailQueue(_0x16e13f){this['id']=_0x16e13f['id']||0x0;this[_0x54ab('0x7')]=_0x16e13f['name']||'';this[_0x54ab('0x8')]=_0x16e13f['timeout']||0xa;this[_0x54ab('0x9')]=_0x16e13f[_0x54ab('0x9')]||_0x54ab('0xa');this[_0x54ab('0xb')]=_0x16e13f[_0x54ab('0xb')];this['mapAgentsId']={};this[_0x54ab('0xc')]=0x0;this[_0x54ab('0xd')]='';this[_0x54ab('0xe')]();this[_0x54ab('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x5cb2cf=this['mapAgentsId'][_0x54ab('0x10')];this[_0x54ab('0x11')]=_[_0x54ab('0x12')](this[_0x54ab('0xb')],'id');this[_0x54ab('0x11')][_0x54ab('0x10')]=_0x5cb2cf;};MailQueue['prototype'][_0x54ab('0xf')]=function(){this[_0x54ab('0x13')]=0x0;this[_0x54ab('0x14')]=0x0;for(var _0x4274de=0x0;_0x4274de<this['Agents'][_0x54ab('0x15')];_0x4274de+=0x1){if(this[_0x54ab('0xb')][_0x4274de][_0x54ab('0x16')]){this[_0x54ab('0x13')]+=0x1;}if(this[_0x54ab('0xb')][_0x4274de]['mailPause']){this[_0x54ab('0x14')]+=0x1;}}this['available']=this[_0x54ab('0x13')]-this[_0x54ab('0x14')];this['available']=this[_0x54ab('0x17')]>=0x0?this[_0x54ab('0x17')]:0x0;var _0x4ce9d5={'id':this['id'],'available':this[_0x54ab('0x17')],'loggedIn':this[_0x54ab('0x13')],'name':this[_0x54ab('0x7')],'paused':this['paused'],'waiting':this[_0x54ab('0xc')]};var _0x44bb3a=md5(JSON[_0x54ab('0x18')](_0x4ce9d5));if(this['md5']!==_0x44bb3a){this[_0x54ab('0xd')]=_0x44bb3a;io['to'](util[_0x54ab('0x19')](_0x54ab('0x1a'),_0x4ce9d5[_0x54ab('0x7')]))[_0x54ab('0x1b')](_0x54ab('0x1c'),_0x4ce9d5);}};module[_0x54ab('0x1d')]=MailQueue;
\ No newline at end of file
+var _0x04e6=['waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x2f4d1f,_0x461983){var _0x16c572=function(_0x240aea){while(--_0x240aea){_0x2f4d1f['push'](_0x2f4d1f['shift']());}};_0x16c572(++_0x461983);}(_0x04e6,0x178));var _0x604e=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x04e6[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x604e('0x0'));var md5=require(_0x604e('0x1'));var util=require(_0x604e('0x2'));var Redis=require(_0x604e('0x3'));var config=require(_0x604e('0x4'));config[_0x604e('0x5')]=_[_0x604e('0x6')](config[_0x604e('0x5')],{'host':_0x604e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x604e('0x5')]));function MailQueue(_0xa5732e){this['id']=_0xa5732e['id']||0x0;this['name']=_0xa5732e[_0x604e('0x8')]||'';this[_0x604e('0x9')]=_0xa5732e[_0x604e('0x9')]||0xa;this[_0x604e('0xa')]=_0xa5732e['strategy']||_0x604e('0xb');this[_0x604e('0xc')]=_0xa5732e[_0x604e('0xc')];this[_0x604e('0xd')]={};this[_0x604e('0xe')]=0x0;this[_0x604e('0x1')]='';this[_0x604e('0xf')]();this[_0x604e('0x10')]();}MailQueue[_0x604e('0x11')][_0x604e('0xf')]=function(){var _0x67050c=this[_0x604e('0xd')][_0x604e('0x12')];this['mapAgentsId']=_[_0x604e('0x13')](this[_0x604e('0xc')],'id');this['mapAgentsId'][_0x604e('0x12')]=_0x67050c;};MailQueue['prototype']['updateRealtime']=function(){this[_0x604e('0x14')]=0x0;this[_0x604e('0x15')]=0x0;for(var _0x154ab2=0x0;_0x154ab2<this[_0x604e('0xc')][_0x604e('0x16')];_0x154ab2+=0x1){if(this[_0x604e('0xc')][_0x154ab2][_0x604e('0x17')]){this[_0x604e('0x14')]+=0x1;}if(this[_0x604e('0xc')][_0x154ab2][_0x604e('0x18')]){this[_0x604e('0x15')]+=0x1;}}this[_0x604e('0x19')]=this['loggedIn']-this[_0x604e('0x15')];this['available']=this[_0x604e('0x19')]>=0x0?this[_0x604e('0x19')]:0x0;var _0x34acec={'id':this['id'],'available':this[_0x604e('0x19')],'loggedIn':this[_0x604e('0x14')],'name':this['name'],'paused':this[_0x604e('0x15')],'waiting':this[_0x604e('0xe')]};var _0x3c7dd0=md5(JSON['stringify'](_0x34acec));if(this[_0x604e('0x1')]!==_0x3c7dd0){this[_0x604e('0x1')]=_0x3c7dd0;io['to'](util[_0x604e('0x1a')](_0x604e('0x1b'),_0x34acec[_0x604e('0x8')]))[_0x604e('0x1c')](_0x604e('0x1d'),_0x34acec);}};module['exports']=MailQueue;
\ No newline at end of file