Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / services / routing / model / chatQueue.js
index 8864d7d..6aba732 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d9c=['loggedIn','paused','length','online','available','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr'];(function(_0xb7e71c,_0x39b47e){var _0xcd9aae=function(_0x1dface){while(--_0x1dface){_0xb7e71c['push'](_0xb7e71c['shift']());}};_0xcd9aae(++_0x39b47e);}(_0x6d9c,0x14e));var _0xc6d9=function(_0x5cf2ac,_0x3c619f){_0x5cf2ac=_0x5cf2ac-0x0;var _0x1ac7e9=_0x6d9c[_0x5cf2ac];return _0x1ac7e9;};'use strict';var _=require('lodash');var md5=require(_0xc6d9('0x0'));var util=require(_0xc6d9('0x1'));var Redis=require(_0xc6d9('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xc6d9('0x3')](config[_0xc6d9('0x4')],{'host':_0xc6d9('0x5'),'port':0x18eb});var io=require(_0xc6d9('0x6'))(new Redis(config[_0xc6d9('0x4')]));function ChatQueue(_0x3fa6af){this['id']=_0x3fa6af['id']||0x0;this[_0xc6d9('0x7')]=_0x3fa6af[_0xc6d9('0x7')]||'';this[_0xc6d9('0x8')]=_0x3fa6af[_0xc6d9('0x8')]||0xa;this[_0xc6d9('0x9')]=_0x3fa6af[_0xc6d9('0x9')]||'beepall';this[_0xc6d9('0xa')]=_0x3fa6af['Agents'];this['mapAgentsId']={};this[_0xc6d9('0xb')]=0x0;this[_0xc6d9('0x0')]='';this[_0xc6d9('0xc')]();this[_0xc6d9('0xd')]();}ChatQueue[_0xc6d9('0xe')]['updateRouting']=function(){var _0x1d99ab=this[_0xc6d9('0xf')][_0xc6d9('0x10')];this['mapAgentsId']=_['map'](this[_0xc6d9('0xa')],'id');this[_0xc6d9('0xf')][_0xc6d9('0x10')]=_0x1d99ab;};ChatQueue[_0xc6d9('0xe')][_0xc6d9('0xd')]=function(){this[_0xc6d9('0x11')]=0x0;this[_0xc6d9('0x12')]=0x0;for(var _0x5ad36b=0x0;_0x5ad36b<this[_0xc6d9('0xa')][_0xc6d9('0x13')];_0x5ad36b+=0x1){if(this['Agents'][_0x5ad36b][_0xc6d9('0x14')]){this[_0xc6d9('0x11')]+=0x1;}if(this[_0xc6d9('0xa')][_0x5ad36b]['chatPause']){this[_0xc6d9('0x12')]+=0x1;}}this[_0xc6d9('0x15')]=this['loggedIn']-this['paused'];this[_0xc6d9('0x15')]=this[_0xc6d9('0x15')]>=0x0?this[_0xc6d9('0x15')]:0x0;var _0x3ef2cb={'id':this['id'],'available':this[_0xc6d9('0x15')],'loggedIn':this[_0xc6d9('0x11')],'name':this[_0xc6d9('0x7')],'paused':this[_0xc6d9('0x12')],'waiting':this[_0xc6d9('0xb')]};var _0x1784fc=md5(JSON['stringify'](_0x3ef2cb));if(this[_0xc6d9('0x0')]!==_0x1784fc){this[_0xc6d9('0x0')]=_0x1784fc;io['to'](util[_0xc6d9('0x16')](_0xc6d9('0x17'),_0x3ef2cb[_0xc6d9('0x7')]))[_0xc6d9('0x18')](_0xc6d9('0x19'),_0x3ef2cb);}};module[_0xc6d9('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0xac31=['emit','exports','lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','length','online','chatPause','available','loggedIn','paused','format'];(function(_0x238e8,_0x52e37e){var _0x4e4502=function(_0x2b1c0b){while(--_0x2b1c0b){_0x238e8['push'](_0x238e8['shift']());}};_0x4e4502(++_0x52e37e);}(_0xac31,0x1a6));var _0x1ac3=function(_0x620f4b,_0x4f62d2){_0x620f4b=_0x620f4b-0x0;var _0x1d711d=_0xac31[_0x620f4b];return _0x1d711d;};'use strict';var _=require(_0x1ac3('0x0'));var md5=require(_0x1ac3('0x1'));var util=require(_0x1ac3('0x2'));var Redis=require(_0x1ac3('0x3'));var config=require('../../../config/environment');config[_0x1ac3('0x4')]=_[_0x1ac3('0x5')](config['redis'],{'host':_0x1ac3('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1ac3('0x4')]));function ChatQueue(_0x47a7e3){this['id']=_0x47a7e3['id']||0x0;this[_0x1ac3('0x7')]=_0x47a7e3[_0x1ac3('0x7')]||'';this[_0x1ac3('0x8')]=_0x47a7e3[_0x1ac3('0x8')]||0xa;this[_0x1ac3('0x9')]=_0x47a7e3[_0x1ac3('0x9')]||_0x1ac3('0xa');this[_0x1ac3('0xb')]=_0x47a7e3[_0x1ac3('0xb')];this[_0x1ac3('0xc')]={};this[_0x1ac3('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x1ac3('0xe')]();}ChatQueue[_0x1ac3('0xf')][_0x1ac3('0x10')]=function(){var _0x25e28e=this[_0x1ac3('0xc')][_0x1ac3('0x11')];this['mapAgentsId']=_[_0x1ac3('0x12')](this[_0x1ac3('0xb')],'id');this[_0x1ac3('0xc')][_0x1ac3('0x11')]=_0x25e28e;};ChatQueue['prototype'][_0x1ac3('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x214792=0x0;_0x214792<this[_0x1ac3('0xb')][_0x1ac3('0x13')];_0x214792+=0x1){if(this[_0x1ac3('0xb')][_0x214792][_0x1ac3('0x14')]){this['loggedIn']+=0x1;}if(this[_0x1ac3('0xb')][_0x214792][_0x1ac3('0x15')]){this['paused']+=0x1;}}this[_0x1ac3('0x16')]=this[_0x1ac3('0x17')]-this[_0x1ac3('0x18')];this[_0x1ac3('0x16')]=this[_0x1ac3('0x16')]>=0x0?this[_0x1ac3('0x16')]:0x0;var _0x3de924={'id':this['id'],'available':this[_0x1ac3('0x16')],'loggedIn':this[_0x1ac3('0x17')],'name':this[_0x1ac3('0x7')],'paused':this[_0x1ac3('0x18')],'waiting':this[_0x1ac3('0xd')]};var _0x79807c=md5(JSON['stringify'](_0x3de924));if(this[_0x1ac3('0x1')]!==_0x79807c){this['md5']=_0x79807c;io['to'](util[_0x1ac3('0x19')]('chat:queue:%s',_0x3de924[_0x1ac3('0x7')]))[_0x1ac3('0x1a')]('chat_queue:save',_0x3de924);}};module[_0x1ac3('0x1b')]=ChatQueue;
\ No newline at end of file