Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / services / routing / model / whatsappQueue.js
index abef0c5..3403c12 100644 (file)
@@ -1 +1 @@
-const a1336_0x170c=['waiting','beepall','_rr','map','util','available','mapAgentsId','paused','online','updateRouting','name','stringify','lodash','../../../rediscache','timeout','loggedIn','strategy','length','md5','whatsappPause','format','prototype','Agents'];(function(_0x25b531,_0x112cda){const _0x170cf9=function(_0x228743){while(--_0x228743){_0x25b531['push'](_0x25b531['shift']());}};_0x170cf9(++_0x112cda);}(a1336_0x170c,0x1a3));const a1336_0x2287=function(_0x25b531,_0x112cda){_0x25b531=_0x25b531-0xd1;let _0x170cf9=a1336_0x170c[_0x25b531];return _0x170cf9;};const a1336_0x220700=a1336_0x2287;'use strict';const _=require(a1336_0x220700(0xd8)),md5=require(a1336_0x220700(0xde)),util=require(a1336_0x220700(0xe7)),{getSocket}=require(a1336_0x220700(0xd9)),io=getSocket();function WhatsappQueue(_0x3d9e95){const _0x27fa75=a1336_0x220700;this['id']=_0x3d9e95['id']||0x0,this[_0x27fa75(0xd6)]=_0x3d9e95[_0x27fa75(0xd6)]||'',this[_0x27fa75(0xda)]=_0x3d9e95[_0x27fa75(0xda)]||0xa,this[_0x27fa75(0xdc)]=_0x3d9e95[_0x27fa75(0xdc)]||_0x27fa75(0xe4),this[_0x27fa75(0xe2)]=_0x3d9e95[_0x27fa75(0xe2)],this[_0x27fa75(0xd2)]={},this['waiting']=0x0,this[_0x27fa75(0xde)]='',this['updateRouting'](),this['updateRealtime']();}WhatsappQueue[a1336_0x220700(0xe1)][a1336_0x220700(0xd5)]=function(){const _0xe3a7f4=a1336_0x220700,_0xeeb2a5=this[_0xe3a7f4(0xd2)][_0xe3a7f4(0xe5)];this[_0xe3a7f4(0xd2)]=_[_0xe3a7f4(0xe6)](this[_0xe3a7f4(0xe2)],'id'),this[_0xe3a7f4(0xd2)][_0xe3a7f4(0xe5)]=_0xeeb2a5;},WhatsappQueue['prototype']['updateRealtime']=function(){const _0x1021d2=a1336_0x220700;this[_0x1021d2(0xdb)]=0x0,this['paused']=0x0;for(let _0x4154a8=0x0;_0x4154a8<this[_0x1021d2(0xe2)][_0x1021d2(0xdd)];_0x4154a8+=0x1){this['Agents'][_0x4154a8][_0x1021d2(0xd4)]&&(this[_0x1021d2(0xdb)]+=0x1),this[_0x1021d2(0xe2)][_0x4154a8][_0x1021d2(0xdf)]&&(this[_0x1021d2(0xd3)]+=0x1);}this['available']=this[_0x1021d2(0xdb)]-this[_0x1021d2(0xd3)],this[_0x1021d2(0xd1)]=this[_0x1021d2(0xd1)]>=0x0?this['available']:0x0;const _0x52ca06={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1021d2(0xdb)],'name':this[_0x1021d2(0xd6)],'paused':this[_0x1021d2(0xd3)],'waiting':this[_0x1021d2(0xe3)]},_0x4fb011=md5(JSON[_0x1021d2(0xd7)](_0x52ca06));this[_0x1021d2(0xde)]!==_0x4fb011&&(this[_0x1021d2(0xde)]=_0x4fb011,io['to'](util[_0x1021d2(0xe0)]('whatsapp:queue:%s',_0x52ca06[_0x1021d2(0xd6)]))['emit']('whatsapp_queue:save',_0x52ca06));},module['exports']=WhatsappQueue;
\ No newline at end of file
+const a1340_0x5ecd=['mapAgentsId','name','loggedIn','whatsapp:queue:%s','paused','exports','whatsappPause','_rr','stringify','available','strategy','Agents','updateRouting','md5','map','waiting','lodash','format','beepall','util','timeout','emit','prototype','whatsapp_queue:save','updateRealtime'];(function(_0x1ad329,_0x25d6d5){const _0x5ecdee=function(_0x4e94bc){while(--_0x4e94bc){_0x1ad329['push'](_0x1ad329['shift']());}};_0x5ecdee(++_0x25d6d5);}(a1340_0x5ecd,0x196));const a1340_0x4e94=function(_0x1ad329,_0x25d6d5){_0x1ad329=_0x1ad329-0x16e;let _0x5ecdee=a1340_0x5ecd[_0x1ad329];return _0x5ecdee;};const a1340_0x177dd7=a1340_0x4e94;'use strict';const _=require(a1340_0x177dd7(0x178)),md5=require(a1340_0x177dd7(0x175)),util=require(a1340_0x177dd7(0x17b)),{getSocket}=require('../../../rediscache'),io=getSocket();function WhatsappQueue(_0x1e1887){const _0x46cda4=a1340_0x177dd7;this['id']=_0x1e1887['id']||0x0,this['name']=_0x1e1887['name']||'',this[_0x46cda4(0x17c)]=_0x1e1887[_0x46cda4(0x17c)]||0xa,this[_0x46cda4(0x172)]=_0x1e1887[_0x46cda4(0x172)]||_0x46cda4(0x17a),this[_0x46cda4(0x173)]=_0x1e1887[_0x46cda4(0x173)],this[_0x46cda4(0x181)]={},this[_0x46cda4(0x177)]=0x0,this[_0x46cda4(0x175)]='',this[_0x46cda4(0x174)](),this[_0x46cda4(0x180)]();}WhatsappQueue[a1340_0x177dd7(0x17e)][a1340_0x177dd7(0x174)]=function(){const _0xc637da=a1340_0x177dd7,_0x3ed6da=this['mapAgentsId'][_0xc637da(0x16f)];this[_0xc637da(0x181)]=_[_0xc637da(0x176)](this[_0xc637da(0x173)],'id'),this['mapAgentsId'][_0xc637da(0x16f)]=_0x3ed6da;},WhatsappQueue[a1340_0x177dd7(0x17e)][a1340_0x177dd7(0x180)]=function(){const _0x4ce358=a1340_0x177dd7;this['loggedIn']=0x0,this[_0x4ce358(0x185)]=0x0;for(let _0x202b30=0x0;_0x202b30<this[_0x4ce358(0x173)]['length'];_0x202b30+=0x1){this[_0x4ce358(0x173)][_0x202b30]['online']&&(this[_0x4ce358(0x183)]+=0x1),this['Agents'][_0x202b30][_0x4ce358(0x16e)]&&(this[_0x4ce358(0x185)]+=0x1);}this['available']=this['loggedIn']-this[_0x4ce358(0x185)],this[_0x4ce358(0x171)]=this[_0x4ce358(0x171)]>=0x0?this[_0x4ce358(0x171)]:0x0;const _0x5e4e55={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x4ce358(0x182)],'paused':this[_0x4ce358(0x185)],'waiting':this['waiting']},_0x1ada7b=md5(JSON[_0x4ce358(0x170)](_0x5e4e55));this['md5']!==_0x1ada7b&&(this[_0x4ce358(0x175)]=_0x1ada7b,io['to'](util[_0x4ce358(0x179)](_0x4ce358(0x184),_0x5e4e55['name']))[_0x4ce358(0x17d)](_0x4ce358(0x17f),_0x5e4e55));},module[a1340_0x177dd7(0x186)]=WhatsappQueue;
\ No newline at end of file