X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fservices%2Frouting%2Fmodel%2FmailQueue.js;h=324538670dfca41655d32bd9080c2724e58c474f;hb=3a60439f3b647e2a7df8ce941316640492032b43;hp=88014d1fe236e7bf2c8d68cf66b5aaf5f9315f56;hpb=1a8d267e76bee6a69bd79c66b9e5eb5d9e44c796;p=motion2.git diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 88014d1..3245386 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 _0x09d7=['name','timeout','strategy','beepall','Agents','waiting','prototype','updateRouting','mapAgentsId','_rr','loggedIn','length','mailPause','paused','available','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x09d7,0x14b));var _0x709d=function(_0x309054,_0x2ba3dd){_0x309054=_0x309054-0x0;var _0x3e5998=_0x09d7[_0x309054];return _0x3e5998;};'use strict';var _=require(_0x709d('0x0'));var md5=require(_0x709d('0x1'));var util=require(_0x709d('0x2'));var Redis=require(_0x709d('0x3'));var config=require(_0x709d('0x4'));config['redis']=_[_0x709d('0x5')](config['redis'],{'host':_0x709d('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x25ce70){this['id']=_0x25ce70['id']||0x0;this[_0x709d('0x7')]=_0x25ce70[_0x709d('0x7')]||'';this[_0x709d('0x8')]=_0x25ce70['timeout']||0xa;this[_0x709d('0x9')]=_0x25ce70[_0x709d('0x9')]||_0x709d('0xa');this[_0x709d('0xb')]=_0x25ce70['Agents'];this['mapAgentsId']={};this[_0x709d('0xc')]=0x0;this[_0x709d('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x709d('0xd')][_0x709d('0xe')]=function(){var _0x50476d=this[_0x709d('0xf')][_0x709d('0x10')];this[_0x709d('0xf')]=_['map'](this[_0x709d('0xb')],'id');this['mapAgentsId'][_0x709d('0x10')]=_0x50476d;};MailQueue['prototype']['updateRealtime']=function(){this[_0x709d('0x11')]=0x0;this['paused']=0x0;for(var _0x36ba81=0x0;_0x36ba81=0x0?this[_0x709d('0x15')]:0x0;var _0x3317d0={'id':this['id'],'available':this[_0x709d('0x15')],'loggedIn':this[_0x709d('0x11')],'name':this['name'],'paused':this[_0x709d('0x14')],'waiting':this[_0x709d('0xc')]};var _0xc70a3c=md5(JSON['stringify'](_0x3317d0));if(this[_0x709d('0x1')]!==_0xc70a3c){this['md5']=_0xc70a3c;io['to'](util[_0x709d('0x16')](_0x709d('0x17'),_0x3317d0[_0x709d('0x7')]))[_0x709d('0x18')]('mail_queue:save',_0x3317d0);}};module[_0x709d('0x19')]=MailQueue; \ No newline at end of file +var _0x408f=['redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x45ade7,_0x237b70){var _0x4d70ce=function(_0x534690){while(--_0x534690){_0x45ade7['push'](_0x45ade7['shift']());}};_0x4d70ce(++_0x237b70);}(_0x408f,0xdb));var _0xf408=function(_0x3c75c2,_0x1daec2){_0x3c75c2=_0x3c75c2-0x0;var _0x700e18=_0x408f[_0x3c75c2];return _0x700e18;};'use strict';var _=require(_0xf408('0x0'));var md5=require(_0xf408('0x1'));var util=require(_0xf408('0x2'));var Redis=require(_0xf408('0x3'));var config=require(_0xf408('0x4'));config[_0xf408('0x5')]=_[_0xf408('0x6')](config[_0xf408('0x5')],{'host':_0xf408('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf408('0x5')]));function MailQueue(_0x23f53f){this['id']=_0x23f53f['id']||0x0;this[_0xf408('0x8')]=_0x23f53f['name']||'';this['timeout']=_0x23f53f[_0xf408('0x9')]||0xa;this['strategy']=_0x23f53f[_0xf408('0xa')]||'beepall';this[_0xf408('0xb')]=_0x23f53f[_0xf408('0xb')];this[_0xf408('0xc')]={};this[_0xf408('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xf408('0xe')]();}MailQueue[_0xf408('0xf')]['updateRouting']=function(){var _0x822435=this['mapAgentsId'][_0xf408('0x10')];this[_0xf408('0xc')]=_[_0xf408('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xf408('0x10')]=_0x822435;};MailQueue['prototype'][_0xf408('0xe')]=function(){this['loggedIn']=0x0;this[_0xf408('0x12')]=0x0;for(var _0x24a941=0x0;_0x24a941=0x0?this[_0xf408('0x16')]:0x0;var _0x3f9761={'id':this['id'],'available':this[_0xf408('0x16')],'loggedIn':this[_0xf408('0x14')],'name':this[_0xf408('0x8')],'paused':this[_0xf408('0x12')],'waiting':this[_0xf408('0xd')]};var _0x57556f=md5(JSON[_0xf408('0x17')](_0x3f9761));if(this['md5']!==_0x57556f){this[_0xf408('0x1')]=_0x57556f;io['to'](util['format'](_0xf408('0x18'),_0x3f9761[_0xf408('0x8')]))[_0xf408('0x19')](_0xf408('0x1a'),_0x3f9761);}};module[_0xf408('0x1b')]=MailQueue; \ No newline at end of file