Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / services / routing / model / mailQueue.js
index 25f8079..bdacb41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbef1=['Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','length','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x3fbafb,_0x68e1aa){var _0xb37ce4=function(_0x59008b){while(--_0x59008b){_0x3fbafb['push'](_0x3fbafb['shift']());}};_0xb37ce4(++_0x68e1aa);}(_0xbef1,0x88));var _0x1bef=function(_0x49e2b8,_0x5cf700){_0x49e2b8=_0x49e2b8-0x0;var _0x1f2213=_0xbef1[_0x49e2b8];return _0x1f2213;};'use strict';var _=require(_0x1bef('0x0'));var md5=require(_0x1bef('0x1'));var util=require('util');var Redis=require(_0x1bef('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x1bef('0x3')](config['redis'],{'host':_0x1bef('0x4'),'port':0x18eb});var io=require(_0x1bef('0x5'))(new Redis(config['redis']));function MailQueue(_0x34fb21){this['id']=_0x34fb21['id']||0x0;this[_0x1bef('0x6')]=_0x34fb21[_0x1bef('0x6')]||'';this['timeout']=_0x34fb21[_0x1bef('0x7')]||0xa;this[_0x1bef('0x8')]=_0x34fb21[_0x1bef('0x8')]||'beepall';this[_0x1bef('0x9')]=_0x34fb21[_0x1bef('0x9')];this[_0x1bef('0xa')]={};this[_0x1bef('0xb')]=0x0;this[_0x1bef('0x1')]='';this[_0x1bef('0xc')]();this['updateRealtime']();}MailQueue[_0x1bef('0xd')][_0x1bef('0xc')]=function(){var _0x577023=this['mapAgentsId'][_0x1bef('0xe')];this[_0x1bef('0xa')]=_[_0x1bef('0xf')](this[_0x1bef('0x9')],'id');this[_0x1bef('0xa')][_0x1bef('0xe')]=_0x577023;};MailQueue[_0x1bef('0xd')][_0x1bef('0x10')]=function(){this['loggedIn']=0x0;this[_0x1bef('0x11')]=0x0;for(var _0x1d0f26=0x0;_0x1d0f26<this[_0x1bef('0x9')][_0x1bef('0x12')];_0x1d0f26+=0x1){if(this['Agents'][_0x1d0f26][_0x1bef('0x13')]){this[_0x1bef('0x14')]+=0x1;}if(this[_0x1bef('0x9')][_0x1d0f26][_0x1bef('0x15')]){this[_0x1bef('0x11')]+=0x1;}}this[_0x1bef('0x16')]=this[_0x1bef('0x14')]-this[_0x1bef('0x11')];this[_0x1bef('0x16')]=this[_0x1bef('0x16')]>=0x0?this[_0x1bef('0x16')]:0x0;var _0x2d1974={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1bef('0x14')],'name':this['name'],'paused':this[_0x1bef('0x11')],'waiting':this[_0x1bef('0xb')]};var _0x26ac2e=md5(JSON[_0x1bef('0x17')](_0x2d1974));if(this[_0x1bef('0x1')]!==_0x26ac2e){this[_0x1bef('0x1')]=_0x26ac2e;io['to'](util[_0x1bef('0x18')](_0x1bef('0x19'),_0x2d1974[_0x1bef('0x6')]))[_0x1bef('0x1a')](_0x1bef('0x1b'),_0x2d1974);}};module[_0x1bef('0x1c')]=MailQueue;
\ No newline at end of file
+var _0xc78a=['../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','md5','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','available','format','mail:queue:%s','mail_queue:save','lodash','util','ioredis'];(function(_0x2ceedb,_0x3d4af3){var _0x1eef5c=function(_0xee38c1){while(--_0xee38c1){_0x2ceedb['push'](_0x2ceedb['shift']());}};_0x1eef5c(++_0x3d4af3);}(_0xc78a,0x169));var _0xac78=function(_0x1e896c,_0x3f9948){_0x1e896c=_0x1e896c-0x0;var _0xd149d9=_0xc78a[_0x1e896c];return _0xd149d9;};'use strict';var _=require(_0xac78('0x0'));var md5=require('md5');var util=require(_0xac78('0x1'));var Redis=require(_0xac78('0x2'));var config=require(_0xac78('0x3'));config[_0xac78('0x4')]=_[_0xac78('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac78('0x6'))(new Redis(config[_0xac78('0x4')]));function MailQueue(_0x4df963){this['id']=_0x4df963['id']||0x0;this[_0xac78('0x7')]=_0x4df963[_0xac78('0x7')]||'';this[_0xac78('0x8')]=_0x4df963[_0xac78('0x8')]||0xa;this[_0xac78('0x9')]=_0x4df963[_0xac78('0x9')]||_0xac78('0xa');this[_0xac78('0xb')]=_0x4df963['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xac78('0xc')]='';this['updateRouting']();this[_0xac78('0xd')]();}MailQueue[_0xac78('0xe')][_0xac78('0xf')]=function(){var _0x4543a7=this[_0xac78('0x10')][_0xac78('0x11')];this[_0xac78('0x10')]=_[_0xac78('0x12')](this[_0xac78('0xb')],'id');this['mapAgentsId'][_0xac78('0x11')]=_0x4543a7;};MailQueue[_0xac78('0xe')][_0xac78('0xd')]=function(){this[_0xac78('0x13')]=0x0;this[_0xac78('0x14')]=0x0;for(var _0x44ac2a=0x0;_0x44ac2a<this[_0xac78('0xb')][_0xac78('0x15')];_0x44ac2a+=0x1){if(this[_0xac78('0xb')][_0x44ac2a]['online']){this['loggedIn']+=0x1;}if(this['Agents'][_0x44ac2a]['mailPause']){this['paused']+=0x1;}}this[_0xac78('0x16')]=this[_0xac78('0x13')]-this[_0xac78('0x14')];this[_0xac78('0x16')]=this[_0xac78('0x16')]>=0x0?this[_0xac78('0x16')]:0x0;var _0x276824={'id':this['id'],'available':this[_0xac78('0x16')],'loggedIn':this[_0xac78('0x13')],'name':this[_0xac78('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x43741e=md5(JSON['stringify'](_0x276824));if(this[_0xac78('0xc')]!==_0x43741e){this['md5']=_0x43741e;io['to'](util[_0xac78('0x17')](_0xac78('0x18'),_0x276824[_0xac78('0x7')]))['emit'](_0xac78('0x19'),_0x276824);}};module['exports']=MailQueue;
\ No newline at end of file