Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / services / routing / model / mailQueue.js
index 239b542..da67ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb24a=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','Agents','length','online','mailPause','available','waiting','stringify','mail:queue:%s','emit','mail_queue:save','md5','util','../../../config/environment','defaults'];(function(_0x1ce05f,_0xe4d511){var _0x493e80=function(_0x230a52){while(--_0x230a52){_0x1ce05f['push'](_0x1ce05f['shift']());}};_0x493e80(++_0xe4d511);}(_0xb24a,0x70));var _0xab24=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0xb24a[_0x4b8156];return _0x4a819c;};'use strict';var _=require('lodash');var md5=require(_0xab24('0x0'));var util=require(_0xab24('0x1'));var Redis=require('ioredis');var config=require(_0xab24('0x2'));config['redis']=_[_0xab24('0x3')](config[_0xab24('0x4')],{'host':_0xab24('0x5'),'port':0x18eb});var io=require(_0xab24('0x6'))(new Redis(config[_0xab24('0x4')]));function MailQueue(_0x2ac875){this['id']=_0x2ac875['id']||0x0;this[_0xab24('0x7')]=_0x2ac875['name']||'';this[_0xab24('0x8')]=_0x2ac875[_0xab24('0x8')]||0xa;this[_0xab24('0x9')]=_0x2ac875[_0xab24('0x9')]||_0xab24('0xa');this['Agents']=_0x2ac875['Agents'];this[_0xab24('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xab24('0xc')]();this[_0xab24('0xd')]();}MailQueue[_0xab24('0xe')][_0xab24('0xc')]=function(){var _0x1dc33f=this[_0xab24('0xb')]['_rr'];this['mapAgentsId']=_[_0xab24('0xf')](this['Agents'],'id');this['mapAgentsId'][_0xab24('0x10')]=_0x1dc33f;};MailQueue[_0xab24('0xe')][_0xab24('0xd')]=function(){this[_0xab24('0x11')]=0x0;this[_0xab24('0x12')]=0x0;for(var _0x31f0ac=0x0;_0x31f0ac<this[_0xab24('0x13')][_0xab24('0x14')];_0x31f0ac+=0x1){if(this[_0xab24('0x13')][_0x31f0ac][_0xab24('0x15')]){this[_0xab24('0x11')]+=0x1;}if(this[_0xab24('0x13')][_0x31f0ac][_0xab24('0x16')]){this[_0xab24('0x12')]+=0x1;}}this['available']=this[_0xab24('0x11')]-this[_0xab24('0x12')];this['available']=this[_0xab24('0x17')]>=0x0?this['available']:0x0;var _0x3ece7c={'id':this['id'],'available':this[_0xab24('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xab24('0x7')],'paused':this[_0xab24('0x12')],'waiting':this[_0xab24('0x18')]};var _0x298683=md5(JSON[_0xab24('0x19')](_0x3ece7c));if(this[_0xab24('0x0')]!==_0x298683){this['md5']=_0x298683;io['to'](util['format'](_0xab24('0x1a'),_0x3ece7c[_0xab24('0x7')]))[_0xab24('0x1b')](_0xab24('0x1c'),_0x3ece7c);}};module['exports']=MailQueue;
\ No newline at end of file
+var _0x1f39=['mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','Agents','loggedIn','paused','length','online'];(function(_0x3e1359,_0x77e06d){var _0x4b2728=function(_0x399899){while(--_0x399899){_0x3e1359['push'](_0x3e1359['shift']());}};_0x4b2728(++_0x77e06d);}(_0x1f39,0x173));var _0x91f3=function(_0x43dac3,_0x564736){_0x43dac3=_0x43dac3-0x0;var _0x2aac5c=_0x1f39[_0x43dac3];return _0x2aac5c;};'use strict';var _=require('lodash');var md5=require(_0x91f3('0x0'));var util=require(_0x91f3('0x1'));var Redis=require('ioredis');var config=require(_0x91f3('0x2'));config[_0x91f3('0x3')]=_['defaults'](config[_0x91f3('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x91f3('0x4'))(new Redis(config['redis']));function MailQueue(_0x834c11){this['id']=_0x834c11['id']||0x0;this[_0x91f3('0x5')]=_0x834c11['name']||'';this[_0x91f3('0x6')]=_0x834c11['timeout']||0xa;this[_0x91f3('0x7')]=_0x834c11[_0x91f3('0x7')]||_0x91f3('0x8');this['Agents']=_0x834c11['Agents'];this[_0x91f3('0x9')]={};this[_0x91f3('0xa')]=0x0;this[_0x91f3('0x0')]='';this['updateRouting']();this[_0x91f3('0xb')]();}MailQueue[_0x91f3('0xc')][_0x91f3('0xd')]=function(){var _0xe4274e=this['mapAgentsId'][_0x91f3('0xe')];this[_0x91f3('0x9')]=_[_0x91f3('0xf')](this[_0x91f3('0x10')],'id');this[_0x91f3('0x9')]['_rr']=_0xe4274e;};MailQueue['prototype']['updateRealtime']=function(){this[_0x91f3('0x11')]=0x0;this[_0x91f3('0x12')]=0x0;for(var _0x4e6bb9=0x0;_0x4e6bb9<this[_0x91f3('0x10')][_0x91f3('0x13')];_0x4e6bb9+=0x1){if(this[_0x91f3('0x10')][_0x4e6bb9][_0x91f3('0x14')]){this['loggedIn']+=0x1;}if(this[_0x91f3('0x10')][_0x4e6bb9][_0x91f3('0x15')]){this[_0x91f3('0x12')]+=0x1;}}this[_0x91f3('0x16')]=this[_0x91f3('0x11')]-this[_0x91f3('0x12')];this[_0x91f3('0x16')]=this[_0x91f3('0x16')]>=0x0?this[_0x91f3('0x16')]:0x0;var _0x2ed68f={'id':this['id'],'available':this[_0x91f3('0x16')],'loggedIn':this[_0x91f3('0x11')],'name':this[_0x91f3('0x5')],'paused':this['paused'],'waiting':this['waiting']};var _0x556ab9=md5(JSON[_0x91f3('0x17')](_0x2ed68f));if(this['md5']!==_0x556ab9){this[_0x91f3('0x0')]=_0x556ab9;io['to'](util[_0x91f3('0x18')](_0x91f3('0x19'),_0x2ed68f[_0x91f3('0x5')]))['emit'](_0x91f3('0x1a'),_0x2ed68f);}};module[_0x91f3('0x1b')]=MailQueue;
\ No newline at end of file