Built motion from commit (unavailable).|2.3.98
[motion2.git] / server / services / routing / model / chatQueue.js
index 10e29f6..1f99b2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46b9=['updateRouting','updateRealtime','_rr','map','paused','length','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x48adee,_0x3b71f5){var _0xac26e9=function(_0x406047){while(--_0x406047){_0x48adee['push'](_0x48adee['shift']());}};_0xac26e9(++_0x3b71f5);}(_0x46b9,0x160));var _0x946b=function(_0x194d1d,_0x5a4870){_0x194d1d=_0x194d1d-0x0;var _0x165c50=_0x46b9[_0x194d1d];return _0x165c50;};'use strict';var _=require('lodash');var md5=require(_0x946b('0x0'));var util=require(_0x946b('0x1'));var Redis=require('ioredis');var config=require(_0x946b('0x2'));config[_0x946b('0x3')]=_['defaults'](config[_0x946b('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x946b('0x4'))(new Redis(config[_0x946b('0x3')]));function ChatQueue(_0x98b58e){this['id']=_0x98b58e['id']||0x0;this['name']=_0x98b58e[_0x946b('0x5')]||'';this['timeout']=_0x98b58e[_0x946b('0x6')]||0xa;this[_0x946b('0x7')]=_0x98b58e[_0x946b('0x7')]||_0x946b('0x8');this['Agents']=_0x98b58e[_0x946b('0x9')];this[_0x946b('0xa')]={};this[_0x946b('0xb')]=0x0;this['md5']='';this[_0x946b('0xc')]();this[_0x946b('0xd')]();}ChatQueue['prototype'][_0x946b('0xc')]=function(){var _0x40ae58=this[_0x946b('0xa')][_0x946b('0xe')];this[_0x946b('0xa')]=_[_0x946b('0xf')](this[_0x946b('0x9')],'id');this['mapAgentsId'][_0x946b('0xe')]=_0x40ae58;};ChatQueue['prototype'][_0x946b('0xd')]=function(){this['loggedIn']=0x0;this[_0x946b('0x10')]=0x0;for(var _0x53a4a9=0x0;_0x53a4a9<this['Agents'][_0x946b('0x11')];_0x53a4a9+=0x1){if(this['Agents'][_0x53a4a9][_0x946b('0x12')]){this[_0x946b('0x13')]+=0x1;}if(this[_0x946b('0x9')][_0x53a4a9][_0x946b('0x14')]){this[_0x946b('0x10')]+=0x1;}}this[_0x946b('0x15')]=this[_0x946b('0x13')]-this[_0x946b('0x10')];this[_0x946b('0x15')]=this[_0x946b('0x15')]>=0x0?this['available']:0x0;var _0x19b9c1={'id':this['id'],'available':this[_0x946b('0x15')],'loggedIn':this[_0x946b('0x13')],'name':this[_0x946b('0x5')],'paused':this[_0x946b('0x10')],'waiting':this[_0x946b('0xb')]};var _0x321d81=md5(JSON[_0x946b('0x16')](_0x19b9c1));if(this[_0x946b('0x0')]!==_0x321d81){this[_0x946b('0x0')]=_0x321d81;io['to'](util[_0x946b('0x17')](_0x946b('0x18'),_0x19b9c1['name']))[_0x946b('0x19')](_0x946b('0x1a'),_0x19b9c1);}};module[_0x946b('0x1b')]=ChatQueue;
\ No newline at end of file
+var _0x1e01=['prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','exports','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime'];(function(_0x382c02,_0x1c7b82){var _0x3a2c6d=function(_0x434710){while(--_0x434710){_0x382c02['push'](_0x382c02['shift']());}};_0x3a2c6d(++_0x1c7b82);}(_0x1e01,0x159));var _0x11e0=function(_0x5baeb0,_0x1f1bb7){_0x5baeb0=_0x5baeb0-0x0;var _0x5086e2=_0x1e01[_0x5baeb0];return _0x5086e2;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x11e0('0x0'));var Redis=require(_0x11e0('0x1'));var config=require('../../../config/environment');config[_0x11e0('0x2')]=_[_0x11e0('0x3')](config['redis'],{'host':_0x11e0('0x4'),'port':0x18eb});var io=require(_0x11e0('0x5'))(new Redis(config['redis']));function ChatQueue(_0x45ca71){this['id']=_0x45ca71['id']||0x0;this[_0x11e0('0x6')]=_0x45ca71[_0x11e0('0x6')]||'';this[_0x11e0('0x7')]=_0x45ca71['timeout']||0xa;this[_0x11e0('0x8')]=_0x45ca71[_0x11e0('0x8')]||_0x11e0('0x9');this[_0x11e0('0xa')]=_0x45ca71['Agents'];this[_0x11e0('0xb')]={};this['waiting']=0x0;this[_0x11e0('0xc')]='';this[_0x11e0('0xd')]();this[_0x11e0('0xe')]();}ChatQueue[_0x11e0('0xf')]['updateRouting']=function(){var _0x23f888=this[_0x11e0('0xb')][_0x11e0('0x10')];this[_0x11e0('0xb')]=_[_0x11e0('0x11')](this['Agents'],'id');this[_0x11e0('0xb')][_0x11e0('0x10')]=_0x23f888;};ChatQueue[_0x11e0('0xf')][_0x11e0('0xe')]=function(){this[_0x11e0('0x12')]=0x0;this[_0x11e0('0x13')]=0x0;for(var _0x10ddff=0x0;_0x10ddff<this[_0x11e0('0xa')][_0x11e0('0x14')];_0x10ddff+=0x1){if(this[_0x11e0('0xa')][_0x10ddff][_0x11e0('0x15')]){this[_0x11e0('0x12')]+=0x1;}if(this['Agents'][_0x10ddff][_0x11e0('0x16')]){this[_0x11e0('0x13')]+=0x1;}}this[_0x11e0('0x17')]=this[_0x11e0('0x12')]-this['paused'];this[_0x11e0('0x17')]=this[_0x11e0('0x17')]>=0x0?this[_0x11e0('0x17')]:0x0;var _0x4ec5f9={'id':this['id'],'available':this[_0x11e0('0x17')],'loggedIn':this[_0x11e0('0x12')],'name':this[_0x11e0('0x6')],'paused':this[_0x11e0('0x13')],'waiting':this[_0x11e0('0x18')]};var _0x35ae00=md5(JSON[_0x11e0('0x19')](_0x4ec5f9));if(this[_0x11e0('0xc')]!==_0x35ae00){this[_0x11e0('0xc')]=_0x35ae00;io['to'](util[_0x11e0('0x1a')](_0x11e0('0x1b'),_0x4ec5f9[_0x11e0('0x6')]))[_0x11e0('0x1c')]('chat_queue:save',_0x4ec5f9);}};module[_0x11e0('0x1d')]=ChatQueue;
\ No newline at end of file