Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / services / routing / model / mailQueue.js
index fe85bdc..5a8360e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f0f=['ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','online','mailPause','available','format','mail_queue:save','exports','lodash','md5','util'];(function(_0x4c5664,_0x170d12){var _0x380651=function(_0x3b3834){while(--_0x3b3834){_0x4c5664['push'](_0x4c5664['shift']());}};_0x380651(++_0x170d12);}(_0x8f0f,0x169));var _0xf8f0=function(_0x5d5f7b,_0xd49d50){_0x5d5f7b=_0x5d5f7b-0x0;var _0x4e79c5=_0x8f0f[_0x5d5f7b];return _0x4e79c5;};'use strict';var _=require(_0xf8f0('0x0'));var md5=require(_0xf8f0('0x1'));var util=require(_0xf8f0('0x2'));var Redis=require(_0xf8f0('0x3'));var config=require(_0xf8f0('0x4'));config[_0xf8f0('0x5')]=_[_0xf8f0('0x6')](config[_0xf8f0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf8f0('0x7'))(new Redis(config[_0xf8f0('0x5')]));function MailQueue(_0x1e7f0e){this['id']=_0x1e7f0e['id']||0x0;this[_0xf8f0('0x8')]=_0x1e7f0e[_0xf8f0('0x8')]||'';this[_0xf8f0('0x9')]=_0x1e7f0e[_0xf8f0('0x9')]||0xa;this[_0xf8f0('0xa')]=_0x1e7f0e[_0xf8f0('0xa')]||_0xf8f0('0xb');this[_0xf8f0('0xc')]=_0x1e7f0e['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xf8f0('0xd')]();this['updateRealtime']();}MailQueue[_0xf8f0('0xe')][_0xf8f0('0xd')]=function(){var _0x57a6cd=this[_0xf8f0('0xf')][_0xf8f0('0x10')];this[_0xf8f0('0xf')]=_[_0xf8f0('0x11')](this['Agents'],'id');this[_0xf8f0('0xf')][_0xf8f0('0x10')]=_0x57a6cd;};MailQueue[_0xf8f0('0xe')][_0xf8f0('0x12')]=function(){this[_0xf8f0('0x13')]=0x0;this[_0xf8f0('0x14')]=0x0;for(var _0x2e74a2=0x0;_0x2e74a2<this['Agents'][_0xf8f0('0x15')];_0x2e74a2+=0x1){if(this[_0xf8f0('0xc')][_0x2e74a2][_0xf8f0('0x16')]){this['loggedIn']+=0x1;}if(this[_0xf8f0('0xc')][_0x2e74a2][_0xf8f0('0x17')]){this['paused']+=0x1;}}this[_0xf8f0('0x18')]=this[_0xf8f0('0x13')]-this[_0xf8f0('0x14')];this[_0xf8f0('0x18')]=this['available']>=0x0?this[_0xf8f0('0x18')]:0x0;var _0x532109={'id':this['id'],'available':this[_0xf8f0('0x18')],'loggedIn':this[_0xf8f0('0x13')],'name':this[_0xf8f0('0x8')],'paused':this[_0xf8f0('0x14')],'waiting':this['waiting']};var _0x3a5220=md5(JSON['stringify'](_0x532109));if(this[_0xf8f0('0x1')]!==_0x3a5220){this[_0xf8f0('0x1')]=_0x3a5220;io['to'](util[_0xf8f0('0x19')]('mail:queue:%s',_0x532109[_0xf8f0('0x8')]))['emit'](_0xf8f0('0x1a'),_0x532109);}};module[_0xf8f0('0x1b')]=MailQueue;
\ No newline at end of file
+var _0xb38c=['map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0x12ca8d,_0x209776){var _0x3e4ba1=function(_0x4bb367){while(--_0x4bb367){_0x12ca8d['push'](_0x12ca8d['shift']());}};_0x3e4ba1(++_0x209776);}(_0xb38c,0x6a));var _0xcb38=function(_0x3cd91d,_0x163516){_0x3cd91d=_0x3cd91d-0x0;var _0x3b4fab=_0xb38c[_0x3cd91d];return _0x3b4fab;};'use strict';var _=require(_0xcb38('0x0'));var md5=require(_0xcb38('0x1'));var util=require(_0xcb38('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xcb38('0x3')]=_[_0xcb38('0x4')](config[_0xcb38('0x3')],{'host':_0xcb38('0x5'),'port':0x18eb});var io=require(_0xcb38('0x6'))(new Redis(config['redis']));function MailQueue(_0x46da4b){this['id']=_0x46da4b['id']||0x0;this[_0xcb38('0x7')]=_0x46da4b[_0xcb38('0x7')]||'';this[_0xcb38('0x8')]=_0x46da4b[_0xcb38('0x8')]||0xa;this[_0xcb38('0x9')]=_0x46da4b['strategy']||_0xcb38('0xa');this[_0xcb38('0xb')]=_0x46da4b[_0xcb38('0xb')];this[_0xcb38('0xc')]={};this[_0xcb38('0xd')]=0x0;this[_0xcb38('0x1')]='';this[_0xcb38('0xe')]();this[_0xcb38('0xf')]();}MailQueue[_0xcb38('0x10')]['updateRouting']=function(){var _0x9b8329=this[_0xcb38('0xc')][_0xcb38('0x11')];this[_0xcb38('0xc')]=_[_0xcb38('0x12')](this[_0xcb38('0xb')],'id');this[_0xcb38('0xc')][_0xcb38('0x11')]=_0x9b8329;};MailQueue['prototype'][_0xcb38('0xf')]=function(){this[_0xcb38('0x13')]=0x0;this[_0xcb38('0x14')]=0x0;for(var _0x20c4bf=0x0;_0x20c4bf<this[_0xcb38('0xb')][_0xcb38('0x15')];_0x20c4bf+=0x1){if(this[_0xcb38('0xb')][_0x20c4bf][_0xcb38('0x16')]){this[_0xcb38('0x13')]+=0x1;}if(this[_0xcb38('0xb')][_0x20c4bf][_0xcb38('0x17')]){this[_0xcb38('0x14')]+=0x1;}}this[_0xcb38('0x18')]=this[_0xcb38('0x13')]-this[_0xcb38('0x14')];this[_0xcb38('0x18')]=this['available']>=0x0?this[_0xcb38('0x18')]:0x0;var _0x26cbfd={'id':this['id'],'available':this[_0xcb38('0x18')],'loggedIn':this[_0xcb38('0x13')],'name':this[_0xcb38('0x7')],'paused':this[_0xcb38('0x14')],'waiting':this[_0xcb38('0xd')]};var _0x140068=md5(JSON[_0xcb38('0x19')](_0x26cbfd));if(this['md5']!==_0x140068){this[_0xcb38('0x1')]=_0x140068;io['to'](util[_0xcb38('0x1a')](_0xcb38('0x1b'),_0x26cbfd[_0xcb38('0x7')]))[_0xcb38('0x1c')](_0xcb38('0x1d'),_0x26cbfd);}};module[_0xcb38('0x1e')]=MailQueue;
\ No newline at end of file