X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fservices%2Frouting%2Fmodel%2FmailQueue.js;h=dbc8d98be1dbae1cc6b0b53ff0c4db66598484d2;hb=676e0a00dac18511f03a9406d0d87e461770e967;hp=fe85bdc7f345ff25c8e7eef109f83831fc24c2d8;hpb=07b7b3200d171aa6bbc6fe2ed92b6ea789d6486c;p=motion2.git diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index fe85bdc..dbc8d98 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -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=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 _0xd185=['paused','mailPause','available','stringify','format','mail:queue:%s','emit','exports','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0xcd820f,_0x47b0cd){var _0x54e78a=function(_0x2cd702){while(--_0x2cd702){_0xcd820f['push'](_0xcd820f['shift']());}};_0x54e78a(++_0x47b0cd);}(_0xd185,0x131));var _0x5d18=function(_0x21cdb1,_0x4f3ab8){_0x21cdb1=_0x21cdb1-0x0;var _0x16884f=_0xd185[_0x21cdb1];return _0x16884f;};'use strict';var _=require('lodash');var md5=require(_0x5d18('0x0'));var util=require('util');var Redis=require(_0x5d18('0x1'));var config=require('../../../config/environment');config[_0x5d18('0x2')]=_[_0x5d18('0x3')](config[_0x5d18('0x2')],{'host':_0x5d18('0x4'),'port':0x18eb});var io=require(_0x5d18('0x5'))(new Redis(config['redis']));function MailQueue(_0x310180){this['id']=_0x310180['id']||0x0;this['name']=_0x310180[_0x5d18('0x6')]||'';this[_0x5d18('0x7')]=_0x310180[_0x5d18('0x7')]||0xa;this[_0x5d18('0x8')]=_0x310180[_0x5d18('0x8')]||_0x5d18('0x9');this[_0x5d18('0xa')]=_0x310180[_0x5d18('0xa')];this[_0x5d18('0xb')]={};this[_0x5d18('0xc')]=0x0;this[_0x5d18('0x0')]='';this[_0x5d18('0xd')]();this[_0x5d18('0xe')]();}MailQueue[_0x5d18('0xf')][_0x5d18('0xd')]=function(){var _0x37e539=this['mapAgentsId'][_0x5d18('0x10')];this[_0x5d18('0xb')]=_[_0x5d18('0x11')](this['Agents'],'id');this[_0x5d18('0xb')][_0x5d18('0x10')]=_0x37e539;};MailQueue[_0x5d18('0xf')][_0x5d18('0xe')]=function(){this[_0x5d18('0x12')]=0x0;this[_0x5d18('0x13')]=0x0;for(var _0x247aa4=0x0;_0x247aa4=0x0?this[_0x5d18('0x15')]:0x0;var _0x5bd10a={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x5d18('0xc')]};var _0x542c3d=md5(JSON[_0x5d18('0x16')](_0x5bd10a));if(this[_0x5d18('0x0')]!==_0x542c3d){this[_0x5d18('0x0')]=_0x542c3d;io['to'](util[_0x5d18('0x17')](_0x5d18('0x18'),_0x5bd10a[_0x5d18('0x6')]))[_0x5d18('0x19')]('mail_queue:save',_0x5bd10a);}};module[_0x5d18('0x1a')]=MailQueue; \ No newline at end of file