Built motion from commit 97153652.|2.6.26
[motion2.git] / server / services / routing / model / mailQueue.js
index d4c123a..fbc6e5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73cb=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5'];(function(_0x296cc4,_0xfdd95a){var _0xf0bddb=function(_0x3c1c8e){while(--_0x3c1c8e){_0x296cc4['push'](_0x296cc4['shift']());}};_0xf0bddb(++_0xfdd95a);}(_0x73cb,0x94));var _0xb73c=function(_0x4b135d,_0x5c2cc7){_0x4b135d=_0x4b135d-0x0;var _0x4aaba0=_0x73cb[_0x4b135d];return _0x4aaba0;};'use strict';var _=require(_0xb73c('0x0'));var md5=require(_0xb73c('0x1'));var util=require(_0xb73c('0x2'));var Redis=require(_0xb73c('0x3'));var config=require('../../../config/environment');config[_0xb73c('0x4')]=_[_0xb73c('0x5')](config[_0xb73c('0x4')],{'host':_0xb73c('0x6'),'port':0x18eb});var io=require(_0xb73c('0x7'))(new Redis(config[_0xb73c('0x4')]));function MailQueue(_0x132e02){this['id']=_0x132e02['id']||0x0;this[_0xb73c('0x8')]=_0x132e02[_0xb73c('0x8')]||'';this[_0xb73c('0x9')]=_0x132e02[_0xb73c('0x9')]||0xa;this[_0xb73c('0xa')]=_0x132e02[_0xb73c('0xa')]||_0xb73c('0xb');this['Agents']=_0x132e02[_0xb73c('0xc')];this['mapAgentsId']={};this[_0xb73c('0xd')]=0x0;this['md5']='';this[_0xb73c('0xe')]();this['updateRealtime']();}MailQueue[_0xb73c('0xf')][_0xb73c('0xe')]=function(){var _0x477060=this[_0xb73c('0x10')]['_rr'];this[_0xb73c('0x10')]=_['map'](this[_0xb73c('0xc')],'id');this[_0xb73c('0x10')][_0xb73c('0x11')]=_0x477060;};MailQueue['prototype'][_0xb73c('0x12')]=function(){this[_0xb73c('0x13')]=0x0;this[_0xb73c('0x14')]=0x0;for(var _0x1423fc=0x0;_0x1423fc<this[_0xb73c('0xc')][_0xb73c('0x15')];_0x1423fc+=0x1){if(this['Agents'][_0x1423fc][_0xb73c('0x16')]){this[_0xb73c('0x13')]+=0x1;}if(this[_0xb73c('0xc')][_0x1423fc][_0xb73c('0x17')]){this[_0xb73c('0x14')]+=0x1;}}this[_0xb73c('0x18')]=this[_0xb73c('0x13')]-this['paused'];this[_0xb73c('0x18')]=this[_0xb73c('0x18')]>=0x0?this[_0xb73c('0x18')]:0x0;var _0x221b80={'id':this['id'],'available':this[_0xb73c('0x18')],'loggedIn':this[_0xb73c('0x13')],'name':this[_0xb73c('0x8')],'paused':this[_0xb73c('0x14')],'waiting':this['waiting']};var _0x47c79a=md5(JSON[_0xb73c('0x19')](_0x221b80));if(this[_0xb73c('0x1')]!==_0x47c79a){this[_0xb73c('0x1')]=_0x47c79a;io['to'](util[_0xb73c('0x1a')](_0xb73c('0x1b'),_0x221b80[_0xb73c('0x8')]))['emit'](_0xb73c('0x1c'),_0x221b80);}};module[_0xb73c('0x1d')]=MailQueue;
\ No newline at end of file
+var _0x0c57=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','mapAgentsId','_rr','prototype','loggedIn','length','mailPause','paused','available','stringify','format','mail:queue:%s','emit','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x0c57,0x190));var _0x70c5=function(_0x2a9b35,_0x27e2cd){_0x2a9b35=_0x2a9b35-0x0;var _0x1253ec=_0x0c57[_0x2a9b35];return _0x1253ec;};'use strict';var _=require('lodash');var md5=require(_0x70c5('0x0'));var util=require(_0x70c5('0x1'));var Redis=require(_0x70c5('0x2'));var config=require(_0x70c5('0x3'));config[_0x70c5('0x4')]=_['defaults'](config[_0x70c5('0x4')],{'host':_0x70c5('0x5'),'port':0x18eb});var io=require(_0x70c5('0x6'))(new Redis(config[_0x70c5('0x4')]));function MailQueue(_0x4ad029){this['id']=_0x4ad029['id']||0x0;this[_0x70c5('0x7')]=_0x4ad029[_0x70c5('0x7')]||'';this[_0x70c5('0x8')]=_0x4ad029[_0x70c5('0x8')]||0xa;this[_0x70c5('0x9')]=_0x4ad029['strategy']||_0x70c5('0xa');this[_0x70c5('0xb')]=_0x4ad029['Agents'];this['mapAgentsId']={};this[_0x70c5('0xc')]=0x0;this[_0x70c5('0x0')]='';this['updateRouting']();this[_0x70c5('0xd')]();}MailQueue['prototype']['updateRouting']=function(){var _0x381513=this[_0x70c5('0xe')][_0x70c5('0xf')];this['mapAgentsId']=_['map'](this[_0x70c5('0xb')],'id');this['mapAgentsId']['_rr']=_0x381513;};MailQueue[_0x70c5('0x10')][_0x70c5('0xd')]=function(){this[_0x70c5('0x11')]=0x0;this['paused']=0x0;for(var _0xed0f69=0x0;_0xed0f69<this[_0x70c5('0xb')][_0x70c5('0x12')];_0xed0f69+=0x1){if(this[_0x70c5('0xb')][_0xed0f69]['online']){this[_0x70c5('0x11')]+=0x1;}if(this['Agents'][_0xed0f69][_0x70c5('0x13')]){this['paused']+=0x1;}}this['available']=this[_0x70c5('0x11')]-this[_0x70c5('0x14')];this[_0x70c5('0x15')]=this[_0x70c5('0x15')]>=0x0?this[_0x70c5('0x15')]:0x0;var _0xfd28fe={'id':this['id'],'available':this['available'],'loggedIn':this[_0x70c5('0x11')],'name':this[_0x70c5('0x7')],'paused':this[_0x70c5('0x14')],'waiting':this[_0x70c5('0xc')]};var _0x21ccfe=md5(JSON[_0x70c5('0x16')](_0xfd28fe));if(this[_0x70c5('0x0')]!==_0x21ccfe){this[_0x70c5('0x0')]=_0x21ccfe;io['to'](util[_0x70c5('0x17')](_0x70c5('0x18'),_0xfd28fe[_0x70c5('0x7')]))[_0x70c5('0x19')]('mail_queue:save',_0xfd28fe);}};module[_0x70c5('0x1a')]=MailQueue;
\ No newline at end of file