Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / services / routing / model / whatsappQueue.js
index 096210f..1a00c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ca=['ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xc5ca,0x94));var _0xac5c=function(_0x434b5f,_0x4dc968){_0x434b5f=_0x434b5f-0x0;var _0x1ac066=_0xc5ca[_0x434b5f];return _0x1ac066;};'use strict';var _=require(_0xac5c('0x0'));var md5=require(_0xac5c('0x1'));var util=require('util');var Redis=require(_0xac5c('0x2'));var config=require(_0xac5c('0x3'));config['redis']=_[_0xac5c('0x4')](config['redis'],{'host':_0xac5c('0x5'),'port':0x18eb});var io=require(_0xac5c('0x6'))(new Redis(config[_0xac5c('0x7')]));function WhatsappQueue(_0x270285){this['id']=_0x270285['id']||0x0;this[_0xac5c('0x8')]=_0x270285[_0xac5c('0x8')]||'';this[_0xac5c('0x9')]=_0x270285[_0xac5c('0x9')]||0xa;this[_0xac5c('0xa')]=_0x270285[_0xac5c('0xa')]||_0xac5c('0xb');this[_0xac5c('0xc')]=_0x270285[_0xac5c('0xc')];this[_0xac5c('0xd')]={};this[_0xac5c('0xe')]=0x0;this[_0xac5c('0x1')]='';this[_0xac5c('0xf')]();this[_0xac5c('0x10')]();}WhatsappQueue[_0xac5c('0x11')][_0xac5c('0xf')]=function(){var _0x1959a8=this[_0xac5c('0xd')][_0xac5c('0x12')];this['mapAgentsId']=_[_0xac5c('0x13')](this[_0xac5c('0xc')],'id');this[_0xac5c('0xd')][_0xac5c('0x12')]=_0x1959a8;};WhatsappQueue[_0xac5c('0x11')][_0xac5c('0x10')]=function(){this[_0xac5c('0x14')]=0x0;this[_0xac5c('0x15')]=0x0;for(var _0x376ae4=0x0;_0x376ae4<this[_0xac5c('0xc')][_0xac5c('0x16')];_0x376ae4+=0x1){if(this[_0xac5c('0xc')][_0x376ae4]['online']){this[_0xac5c('0x14')]+=0x1;}if(this['Agents'][_0x376ae4][_0xac5c('0x17')]){this[_0xac5c('0x15')]+=0x1;}}this['available']=this[_0xac5c('0x14')]-this['paused'];this[_0xac5c('0x18')]=this[_0xac5c('0x18')]>=0x0?this[_0xac5c('0x18')]:0x0;var _0x4e1b71={'id':this['id'],'available':this[_0xac5c('0x18')],'loggedIn':this[_0xac5c('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xac5c('0xe')]};var _0x418137=md5(JSON[_0xac5c('0x19')](_0x4e1b71));if(this[_0xac5c('0x1')]!==_0x418137){this[_0xac5c('0x1')]=_0x418137;io['to'](util[_0xac5c('0x1a')]('whatsapp:queue:%s',_0x4e1b71[_0xac5c('0x8')]))[_0xac5c('0x1b')](_0xac5c('0x1c'),_0x4e1b71);}};module[_0xac5c('0x1d')]=WhatsappQueue;
\ No newline at end of file
+var _0x456b=['localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','../../../config/environment','defaults','redis'];(function(_0x3e0f8e,_0x46812d){var _0x47dda2=function(_0x1abb56){while(--_0x1abb56){_0x3e0f8e['push'](_0x3e0f8e['shift']());}};_0x47dda2(++_0x46812d);}(_0x456b,0x1e8));var _0xb456=function(_0x1028e7,_0x563f13){_0x1028e7=_0x1028e7-0x0;var _0x3344a6=_0x456b[_0x1028e7];return _0x3344a6;};'use strict';var _=require(_0xb456('0x0'));var md5=require('md5');var util=require(_0xb456('0x1'));var Redis=require('ioredis');var config=require(_0xb456('0x2'));config['redis']=_[_0xb456('0x3')](config[_0xb456('0x4')],{'host':_0xb456('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb456('0x4')]));function WhatsappQueue(_0x3565cd){this['id']=_0x3565cd['id']||0x0;this[_0xb456('0x6')]=_0x3565cd['name']||'';this[_0xb456('0x7')]=_0x3565cd[_0xb456('0x7')]||0xa;this[_0xb456('0x8')]=_0x3565cd[_0xb456('0x8')]||_0xb456('0x9');this[_0xb456('0xa')]=_0x3565cd[_0xb456('0xa')];this[_0xb456('0xb')]={};this[_0xb456('0xc')]=0x0;this[_0xb456('0xd')]='';this[_0xb456('0xe')]();this['updateRealtime']();}WhatsappQueue[_0xb456('0xf')][_0xb456('0xe')]=function(){var _0x1a82ac=this['mapAgentsId']['_rr'];this[_0xb456('0xb')]=_['map'](this[_0xb456('0xa')],'id');this[_0xb456('0xb')][_0xb456('0x10')]=_0x1a82ac;};WhatsappQueue[_0xb456('0xf')][_0xb456('0x11')]=function(){this[_0xb456('0x12')]=0x0;this[_0xb456('0x13')]=0x0;for(var _0x2cbf66=0x0;_0x2cbf66<this['Agents'][_0xb456('0x14')];_0x2cbf66+=0x1){if(this[_0xb456('0xa')][_0x2cbf66][_0xb456('0x15')]){this[_0xb456('0x12')]+=0x1;}if(this[_0xb456('0xa')][_0x2cbf66][_0xb456('0x16')]){this[_0xb456('0x13')]+=0x1;}}this[_0xb456('0x17')]=this[_0xb456('0x12')]-this['paused'];this['available']=this[_0xb456('0x17')]>=0x0?this[_0xb456('0x17')]:0x0;var _0x2252fe={'id':this['id'],'available':this[_0xb456('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb456('0xc')]};var _0x465879=md5(JSON[_0xb456('0x18')](_0x2252fe));if(this[_0xb456('0xd')]!==_0x465879){this[_0xb456('0xd')]=_0x465879;io['to'](util['format'](_0xb456('0x19'),_0x2252fe[_0xb456('0x6')]))[_0xb456('0x1a')](_0xb456('0x1b'),_0x2252fe);}};module[_0xb456('0x1c')]=WhatsappQueue;
\ No newline at end of file