Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / routing / model / chatQueue.js
index 4906093..9871960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa703=['loggedIn','paused','length','online','available','stringify','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa703,0x1d4));var _0x3a70=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa703[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x3a70('0x0'));var md5=require(_0x3a70('0x1'));var util=require(_0x3a70('0x2'));var Redis=require('ioredis');var config=require(_0x3a70('0x3'));config[_0x3a70('0x4')]=_[_0x3a70('0x5')](config[_0x3a70('0x4')],{'host':_0x3a70('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3a70('0x4')]));function ChatQueue(_0x46d4fd){this['id']=_0x46d4fd['id']||0x0;this[_0x3a70('0x7')]=_0x46d4fd[_0x3a70('0x7')]||'';this[_0x3a70('0x8')]=_0x46d4fd[_0x3a70('0x8')]||0xa;this['strategy']=_0x46d4fd['strategy']||_0x3a70('0x9');this[_0x3a70('0xa')]=_0x46d4fd[_0x3a70('0xa')];this['mapAgentsId']={};this[_0x3a70('0xb')]=0x0;this[_0x3a70('0x1')]='';this['updateRouting']();this[_0x3a70('0xc')]();}ChatQueue[_0x3a70('0xd')][_0x3a70('0xe')]=function(){var _0x460fd9=this[_0x3a70('0xf')][_0x3a70('0x10')];this[_0x3a70('0xf')]=_[_0x3a70('0x11')](this[_0x3a70('0xa')],'id');this[_0x3a70('0xf')][_0x3a70('0x10')]=_0x460fd9;};ChatQueue[_0x3a70('0xd')][_0x3a70('0xc')]=function(){this[_0x3a70('0x12')]=0x0;this[_0x3a70('0x13')]=0x0;for(var _0x5df168=0x0;_0x5df168<this[_0x3a70('0xa')][_0x3a70('0x14')];_0x5df168+=0x1){if(this[_0x3a70('0xa')][_0x5df168][_0x3a70('0x15')]){this[_0x3a70('0x12')]+=0x1;}if(this[_0x3a70('0xa')][_0x5df168]['chatPause']){this[_0x3a70('0x13')]+=0x1;}}this['available']=this[_0x3a70('0x12')]-this[_0x3a70('0x13')];this[_0x3a70('0x16')]=this[_0x3a70('0x16')]>=0x0?this[_0x3a70('0x16')]:0x0;var _0x365b31={'id':this['id'],'available':this[_0x3a70('0x16')],'loggedIn':this[_0x3a70('0x12')],'name':this[_0x3a70('0x7')],'paused':this[_0x3a70('0x13')],'waiting':this[_0x3a70('0xb')]};var _0x51638c=md5(JSON[_0x3a70('0x17')](_0x365b31));if(this['md5']!==_0x51638c){this[_0x3a70('0x1')]=_0x51638c;io['to'](util['format'](_0x3a70('0x18'),_0x365b31['name']))['emit'](_0x3a70('0x19'),_0x365b31);}};module[_0x3a70('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0xe303=['_rr','paused','length','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map'];(function(_0x101154,_0x1e7615){var _0x59e025=function(_0x5a0f31){while(--_0x5a0f31){_0x101154['push'](_0x101154['shift']());}};_0x59e025(++_0x1e7615);}(_0xe303,0xc8));var _0x3e30=function(_0x3b32ed,_0x47e199){_0x3b32ed=_0x3b32ed-0x0;var _0x19fccc=_0xe303[_0x3b32ed];return _0x19fccc;};'use strict';var _=require('lodash');var md5=require(_0x3e30('0x0'));var util=require('util');var Redis=require(_0x3e30('0x1'));var config=require(_0x3e30('0x2'));config[_0x3e30('0x3')]=_['defaults'](config['redis'],{'host':_0x3e30('0x4'),'port':0x18eb});var io=require(_0x3e30('0x5'))(new Redis(config[_0x3e30('0x3')]));function ChatQueue(_0x5e3b7c){this['id']=_0x5e3b7c['id']||0x0;this[_0x3e30('0x6')]=_0x5e3b7c['name']||'';this[_0x3e30('0x7')]=_0x5e3b7c[_0x3e30('0x7')]||0xa;this[_0x3e30('0x8')]=_0x5e3b7c[_0x3e30('0x8')]||_0x3e30('0x9');this[_0x3e30('0xa')]=_0x5e3b7c['Agents'];this[_0x3e30('0xb')]={};this[_0x3e30('0xc')]=0x0;this[_0x3e30('0x0')]='';this[_0x3e30('0xd')]();this['updateRealtime']();}ChatQueue[_0x3e30('0xe')][_0x3e30('0xd')]=function(){var _0xd9923c=this[_0x3e30('0xb')]['_rr'];this[_0x3e30('0xb')]=_[_0x3e30('0xf')](this['Agents'],'id');this[_0x3e30('0xb')][_0x3e30('0x10')]=_0xd9923c;};ChatQueue[_0x3e30('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x3e30('0x11')]=0x0;for(var _0xdebf14=0x0;_0xdebf14<this[_0x3e30('0xa')][_0x3e30('0x12')];_0xdebf14+=0x1){if(this[_0x3e30('0xa')][_0xdebf14][_0x3e30('0x13')]){this[_0x3e30('0x14')]+=0x1;}if(this[_0x3e30('0xa')][_0xdebf14][_0x3e30('0x15')]){this[_0x3e30('0x11')]+=0x1;}}this['available']=this['loggedIn']-this[_0x3e30('0x11')];this[_0x3e30('0x16')]=this[_0x3e30('0x16')]>=0x0?this[_0x3e30('0x16')]:0x0;var _0x4e9439={'id':this['id'],'available':this[_0x3e30('0x16')],'loggedIn':this[_0x3e30('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x3e30('0xc')]};var _0x337f4c=md5(JSON[_0x3e30('0x17')](_0x4e9439));if(this[_0x3e30('0x0')]!==_0x337f4c){this[_0x3e30('0x0')]=_0x337f4c;io['to'](util[_0x3e30('0x18')](_0x3e30('0x19'),_0x4e9439['name']))['emit'](_0x3e30('0x1a'),_0x4e9439);}};module['exports']=ChatQueue;
\ No newline at end of file