Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / services / routing / model / chatQueue.js
index ef5b97b..3ccfe1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62fb=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','length','online','chatPause','paused','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0x62fb,0xf3));var _0xb62f=function(_0x114824,_0x1fa8dd){_0x114824=_0x114824-0x0;var _0x597064=_0x62fb[_0x114824];return _0x597064;};'use strict';var _=require(_0xb62f('0x0'));var md5=require(_0xb62f('0x1'));var util=require('util');var Redis=require(_0xb62f('0x2'));var config=require(_0xb62f('0x3'));config[_0xb62f('0x4')]=_[_0xb62f('0x5')](config[_0xb62f('0x4')],{'host':_0xb62f('0x6'),'port':0x18eb});var io=require(_0xb62f('0x7'))(new Redis(config[_0xb62f('0x4')]));function ChatQueue(_0x19e673){this['id']=_0x19e673['id']||0x0;this['name']=_0x19e673[_0xb62f('0x8')]||'';this[_0xb62f('0x9')]=_0x19e673[_0xb62f('0x9')]||0xa;this['strategy']=_0x19e673[_0xb62f('0xa')]||_0xb62f('0xb');this[_0xb62f('0xc')]=_0x19e673[_0xb62f('0xc')];this[_0xb62f('0xd')]={};this[_0xb62f('0xe')]=0x0;this[_0xb62f('0x1')]='';this['updateRouting']();this[_0xb62f('0xf')]();}ChatQueue['prototype'][_0xb62f('0x10')]=function(){var _0x3f6acf=this[_0xb62f('0xd')][_0xb62f('0x11')];this[_0xb62f('0xd')]=_[_0xb62f('0x12')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x3f6acf;};ChatQueue[_0xb62f('0x13')][_0xb62f('0xf')]=function(){this[_0xb62f('0x14')]=0x0;this['paused']=0x0;for(var _0x5dfaf9=0x0;_0x5dfaf9<this['Agents'][_0xb62f('0x15')];_0x5dfaf9+=0x1){if(this[_0xb62f('0xc')][_0x5dfaf9][_0xb62f('0x16')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x5dfaf9][_0xb62f('0x17')]){this[_0xb62f('0x18')]+=0x1;}}this[_0xb62f('0x19')]=this[_0xb62f('0x14')]-this['paused'];this[_0xb62f('0x19')]=this[_0xb62f('0x19')]>=0x0?this['available']:0x0;var _0x4c6668={'id':this['id'],'available':this[_0xb62f('0x19')],'loggedIn':this[_0xb62f('0x14')],'name':this[_0xb62f('0x8')],'paused':this['paused'],'waiting':this[_0xb62f('0xe')]};var _0xcb5bc4=md5(JSON[_0xb62f('0x1a')](_0x4c6668));if(this[_0xb62f('0x1')]!==_0xcb5bc4){this['md5']=_0xcb5bc4;io['to'](util['format'](_0xb62f('0x1b'),_0x4c6668['name']))[_0xb62f('0x1c')](_0xb62f('0x1d'),_0x4c6668);}};module[_0xb62f('0x1e')]=ChatQueue;
\ No newline at end of file
+var _0x73da=['mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','chatPause','available','format','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x442818,_0x494946){var _0x37c9e1=function(_0x6783e1){while(--_0x6783e1){_0x442818['push'](_0x442818['shift']());}};_0x37c9e1(++_0x494946);}(_0x73da,0x10b));var _0xa73d=function(_0x58f8d6,_0x3de6e9){_0x58f8d6=_0x58f8d6-0x0;var _0x249399=_0x73da[_0x58f8d6];return _0x249399;};'use strict';var _=require(_0xa73d('0x0'));var md5=require(_0xa73d('0x1'));var util=require(_0xa73d('0x2'));var Redis=require(_0xa73d('0x3'));var config=require(_0xa73d('0x4'));config['redis']=_[_0xa73d('0x5')](config[_0xa73d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xa73d('0x7'))(new Redis(config[_0xa73d('0x6')]));function ChatQueue(_0x27d470){this['id']=_0x27d470['id']||0x0;this[_0xa73d('0x8')]=_0x27d470['name']||'';this[_0xa73d('0x9')]=_0x27d470['timeout']||0xa;this[_0xa73d('0xa')]=_0x27d470['strategy']||_0xa73d('0xb');this[_0xa73d('0xc')]=_0x27d470['Agents'];this[_0xa73d('0xd')]={};this[_0xa73d('0xe')]=0x0;this[_0xa73d('0x1')]='';this[_0xa73d('0xf')]();this[_0xa73d('0x10')]();}ChatQueue['prototype'][_0xa73d('0xf')]=function(){var _0x43c9dd=this[_0xa73d('0xd')][_0xa73d('0x11')];this['mapAgentsId']=_[_0xa73d('0x12')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x43c9dd;};ChatQueue[_0xa73d('0x13')][_0xa73d('0x10')]=function(){this[_0xa73d('0x14')]=0x0;this[_0xa73d('0x15')]=0x0;for(var _0x168a4d=0x0;_0x168a4d<this[_0xa73d('0xc')][_0xa73d('0x16')];_0x168a4d+=0x1){if(this['Agents'][_0x168a4d]['online']){this[_0xa73d('0x14')]+=0x1;}if(this[_0xa73d('0xc')][_0x168a4d][_0xa73d('0x17')]){this[_0xa73d('0x15')]+=0x1;}}this[_0xa73d('0x18')]=this['loggedIn']-this[_0xa73d('0x15')];this[_0xa73d('0x18')]=this[_0xa73d('0x18')]>=0x0?this[_0xa73d('0x18')]:0x0;var _0x18a385={'id':this['id'],'available':this[_0xa73d('0x18')],'loggedIn':this[_0xa73d('0x14')],'name':this[_0xa73d('0x8')],'paused':this[_0xa73d('0x15')],'waiting':this[_0xa73d('0xe')]};var _0x55fe5b=md5(JSON['stringify'](_0x18a385));if(this[_0xa73d('0x1')]!==_0x55fe5b){this[_0xa73d('0x1')]=_0x55fe5b;io['to'](util[_0xa73d('0x19')]('chat:queue:%s',_0x18a385[_0xa73d('0x8')]))[_0xa73d('0x1a')](_0xa73d('0x1b'),_0x18a385);}};module['exports']=ChatQueue;
\ No newline at end of file