Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / services / routing / model / whatsappQueue.js
index 49c4c09..3fe4af3 100644 (file)
@@ -1 +1 @@
-const a1171_0x3f4c=['updateRealtime','Agents','length','prototype','strategy','name','util','available','map','stringify','loggedIn','paused','whatsappPause','updateRouting','format','lodash','whatsapp_queue:save','mapAgentsId','_rr','md5','timeout','whatsapp:queue:%s','../../../rediscache','waiting'];(function(_0x1d3ace,_0x3f4ccf){const _0x29ff7f=function(_0x13cd2f){while(--_0x13cd2f){_0x1d3ace['push'](_0x1d3ace['shift']());}};_0x29ff7f(++_0x3f4ccf);}(a1171_0x3f4c,0xc7));const a1171_0x29ff=function(_0x1d3ace,_0x3f4ccf){_0x1d3ace=_0x1d3ace-0x0;let _0x29ff7f=a1171_0x3f4c[_0x1d3ace];return _0x29ff7f;};const _0x5cbb99=a1171_0x29ff;'use strict';const _=require(_0x5cbb99('0x8')),md5=require(_0x5cbb99('0xc')),util=require(_0x5cbb99('0x17')),{getSocket}=require(_0x5cbb99('0xf')),io=getSocket();function WhatsappQueue(_0x13cd2f){const _0x4b2ebe=_0x5cbb99;this['id']=_0x13cd2f['id']||0x0,this['name']=_0x13cd2f[_0x4b2ebe('0x16')]||'',this[_0x4b2ebe('0xd')]=_0x13cd2f['timeout']||0xa,this[_0x4b2ebe('0x15')]=_0x13cd2f[_0x4b2ebe('0x15')]||'beepall',this[_0x4b2ebe('0x12')]=_0x13cd2f[_0x4b2ebe('0x12')],this[_0x4b2ebe('0xa')]={},this[_0x4b2ebe('0x10')]=0x0,this[_0x4b2ebe('0xc')]='',this[_0x4b2ebe('0x6')](),this[_0x4b2ebe('0x11')]();}WhatsappQueue['prototype'][_0x5cbb99('0x6')]=function(){const _0x407aa0=_0x5cbb99,_0x44242d=this[_0x407aa0('0xa')][_0x407aa0('0xb')];this[_0x407aa0('0xa')]=_[_0x407aa0('0x1')](this['Agents'],'id'),this['mapAgentsId']['_rr']=_0x44242d;},WhatsappQueue[_0x5cbb99('0x14')][_0x5cbb99('0x11')]=function(){const _0x1f0ac4=_0x5cbb99;this['loggedIn']=0x0,this['paused']=0x0;for(let _0x41a5bf=0x0;_0x41a5bf<this[_0x1f0ac4('0x12')][_0x1f0ac4('0x13')];_0x41a5bf+=0x1){this[_0x1f0ac4('0x12')][_0x41a5bf]['online']&&(this[_0x1f0ac4('0x3')]+=0x1),this[_0x1f0ac4('0x12')][_0x41a5bf][_0x1f0ac4('0x5')]&&(this[_0x1f0ac4('0x4')]+=0x1);}this[_0x1f0ac4('0x0')]=this['loggedIn']-this['paused'],this['available']=this['available']>=0x0?this[_0x1f0ac4('0x0')]:0x0;const _0x5980b8={'id':this['id'],'available':this[_0x1f0ac4('0x0')],'loggedIn':this['loggedIn'],'name':this[_0x1f0ac4('0x16')],'paused':this['paused'],'waiting':this['waiting']},_0x5cbc64=md5(JSON[_0x1f0ac4('0x2')](_0x5980b8));this[_0x1f0ac4('0xc')]!==_0x5cbc64&&(this[_0x1f0ac4('0xc')]=_0x5cbc64,io['to'](util[_0x1f0ac4('0x7')](_0x1f0ac4('0xe'),_0x5980b8[_0x1f0ac4('0x16')]))['emit'](_0x1f0ac4('0x9'),_0x5980b8));},module['exports']=WhatsappQueue;
\ No newline at end of file
+const a1172_0x6f87=['updateRouting','paused','prototype','updateRealtime','Agents','timeout','loggedIn','strategy','length','online','util','whatsappPause','md5','available','map','name','stringify','mapAgentsId','exports','lodash','_rr','whatsapp_queue:save','format','waiting'];(function(_0x1c41da,_0x6f878d){const _0x3bc5bb=function(_0x55e62d){while(--_0x55e62d){_0x1c41da['push'](_0x1c41da['shift']());}};_0x3bc5bb(++_0x6f878d);}(a1172_0x6f87,0x113));const a1172_0x3bc5=function(_0x1c41da,_0x6f878d){_0x1c41da=_0x1c41da-0x0;let _0x3bc5bb=a1172_0x6f87[_0x1c41da];return _0x3bc5bb;};const _0x2f939b=a1172_0x3bc5;'use strict';const _=require(_0x2f939b('0x8')),md5=require(_0x2f939b('0x1')),util=require(_0x2f939b('0x17')),{getSocket}=require('../../../rediscache'),io=getSocket();function WhatsappQueue(_0x55e62d){const _0x3bca0f=_0x2f939b;this['id']=_0x55e62d['id']||0x0,this[_0x3bca0f('0x4')]=_0x55e62d['name']||'',this[_0x3bca0f('0x12')]=_0x55e62d[_0x3bca0f('0x12')]||0xa,this[_0x3bca0f('0x14')]=_0x55e62d[_0x3bca0f('0x14')]||'beepall',this[_0x3bca0f('0x11')]=_0x55e62d[_0x3bca0f('0x11')],this[_0x3bca0f('0x6')]={},this[_0x3bca0f('0xc')]=0x0,this[_0x3bca0f('0x1')]='',this['updateRouting'](),this['updateRealtime']();}WhatsappQueue['prototype'][_0x2f939b('0xd')]=function(){const _0x557dcd=_0x2f939b,_0xdc8030=this[_0x557dcd('0x6')]['_rr'];this[_0x557dcd('0x6')]=_[_0x557dcd('0x3')](this[_0x557dcd('0x11')],'id'),this[_0x557dcd('0x6')][_0x557dcd('0x9')]=_0xdc8030;},WhatsappQueue[_0x2f939b('0xf')][_0x2f939b('0x10')]=function(){const _0x4b8808=_0x2f939b;this[_0x4b8808('0x13')]=0x0,this['paused']=0x0;for(let _0x4560cb=0x0;_0x4560cb<this['Agents'][_0x4b8808('0x15')];_0x4560cb+=0x1){this['Agents'][_0x4560cb][_0x4b8808('0x16')]&&(this[_0x4b8808('0x13')]+=0x1),this[_0x4b8808('0x11')][_0x4560cb][_0x4b8808('0x0')]&&(this['paused']+=0x1);}this['available']=this[_0x4b8808('0x13')]-this[_0x4b8808('0xe')],this['available']=this[_0x4b8808('0x2')]>=0x0?this[_0x4b8808('0x2')]:0x0;const _0x23a5c7={'id':this['id'],'available':this[_0x4b8808('0x2')],'loggedIn':this[_0x4b8808('0x13')],'name':this[_0x4b8808('0x4')],'paused':this[_0x4b8808('0xe')],'waiting':this[_0x4b8808('0xc')]},_0x298360=md5(JSON[_0x4b8808('0x5')](_0x23a5c7));this[_0x4b8808('0x1')]!==_0x298360&&(this[_0x4b8808('0x1')]=_0x298360,io['to'](util[_0x4b8808('0xb')]('whatsapp:queue:%s',_0x23a5c7[_0x4b8808('0x4')]))['emit'](_0x4b8808('0xa'),_0x23a5c7));},module[_0x2f939b('0x7')]=WhatsappQueue;
\ No newline at end of file