Built motion from commit 97153652.|2.6.26
[motion2.git] / server / services / routing / model / mailQueue.js
index 25f8079..fbc6e5e 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 _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