Built motion from commit 1ea47bf4.|2.6.34
[motion2.git] / server / services / routing / model / chatQueue.js
index 21e6f68..5275901 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d2c=['updateRouting','prototype','_rr','map','updateRealtime','length','online','chatPause','paused','loggedIn','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x0d2c,0xac));var _0xc0d2=function(_0x3846ce,_0x10c80a){_0x3846ce=_0x3846ce-0x0;var _0x117ce8=_0x0d2c[_0x3846ce];return _0x117ce8;};'use strict';var _=require(_0xc0d2('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xc0d2('0x1'));var config=require('../../../config/environment');config[_0xc0d2('0x2')]=_[_0xc0d2('0x3')](config[_0xc0d2('0x2')],{'host':_0xc0d2('0x4'),'port':0x18eb});var io=require(_0xc0d2('0x5'))(new Redis(config[_0xc0d2('0x2')]));function ChatQueue(_0x317b04){this['id']=_0x317b04['id']||0x0;this[_0xc0d2('0x6')]=_0x317b04[_0xc0d2('0x6')]||'';this[_0xc0d2('0x7')]=_0x317b04[_0xc0d2('0x7')]||0xa;this[_0xc0d2('0x8')]=_0x317b04[_0xc0d2('0x8')]||_0xc0d2('0x9');this['Agents']=_0x317b04[_0xc0d2('0xa')];this[_0xc0d2('0xb')]={};this[_0xc0d2('0xc')]=0x0;this[_0xc0d2('0xd')]='';this[_0xc0d2('0xe')]();this['updateRealtime']();}ChatQueue[_0xc0d2('0xf')][_0xc0d2('0xe')]=function(){var _0x2f433f=this[_0xc0d2('0xb')][_0xc0d2('0x10')];this[_0xc0d2('0xb')]=_[_0xc0d2('0x11')](this[_0xc0d2('0xa')],'id');this[_0xc0d2('0xb')]['_rr']=_0x2f433f;};ChatQueue[_0xc0d2('0xf')][_0xc0d2('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x10d685=0x0;_0x10d685<this[_0xc0d2('0xa')][_0xc0d2('0x13')];_0x10d685+=0x1){if(this[_0xc0d2('0xa')][_0x10d685][_0xc0d2('0x14')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x10d685][_0xc0d2('0x15')]){this[_0xc0d2('0x16')]+=0x1;}}this['available']=this[_0xc0d2('0x17')]-this['paused'];this[_0xc0d2('0x18')]=this[_0xc0d2('0x18')]>=0x0?this[_0xc0d2('0x18')]:0x0;var _0x5f4ee1={'id':this['id'],'available':this[_0xc0d2('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xc0d2('0x6')],'paused':this[_0xc0d2('0x16')],'waiting':this['waiting']};var _0x4e5cbb=md5(JSON[_0xc0d2('0x19')](_0x5f4ee1));if(this[_0xc0d2('0xd')]!==_0x4e5cbb){this[_0xc0d2('0xd')]=_0x4e5cbb;io['to'](util[_0xc0d2('0x1a')](_0xc0d2('0x1b'),_0x5f4ee1[_0xc0d2('0x6')]))[_0xc0d2('0x1c')](_0xc0d2('0x1d'),_0x5f4ee1);}};module[_0xc0d2('0x1e')]=ChatQueue;
\ No newline at end of file
+var _0x39da=['available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','mapAgentsId','waiting','md5','updateRouting','_rr','map','prototype','updateRealtime','paused','Agents','length','online','loggedIn','chatPause'];(function(_0x1df876,_0x16315d){var _0x163102=function(_0x5dedd0){while(--_0x5dedd0){_0x1df876['push'](_0x1df876['shift']());}};_0x163102(++_0x16315d);}(_0x39da,0xc1));var _0xa39d=function(_0x5e644b,_0x231ee9){_0x5e644b=_0x5e644b-0x0;var _0x5c9cdc=_0x39da[_0x5e644b];return _0x5c9cdc;};'use strict';var _=require(_0xa39d('0x0'));var md5=require('md5');var util=require(_0xa39d('0x1'));var Redis=require(_0xa39d('0x2'));var config=require(_0xa39d('0x3'));config[_0xa39d('0x4')]=_['defaults'](config[_0xa39d('0x4')],{'host':_0xa39d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa39d('0x4')]));function ChatQueue(_0x456f17){this['id']=_0x456f17['id']||0x0;this['name']=_0x456f17[_0xa39d('0x6')]||'';this[_0xa39d('0x7')]=_0x456f17[_0xa39d('0x7')]||0xa;this[_0xa39d('0x8')]=_0x456f17[_0xa39d('0x8')]||_0xa39d('0x9');this['Agents']=_0x456f17['Agents'];this[_0xa39d('0xa')]={};this[_0xa39d('0xb')]=0x0;this[_0xa39d('0xc')]='';this[_0xa39d('0xd')]();this['updateRealtime']();}ChatQueue['prototype'][_0xa39d('0xd')]=function(){var _0x4d05d5=this[_0xa39d('0xa')][_0xa39d('0xe')];this['mapAgentsId']=_[_0xa39d('0xf')](this['Agents'],'id');this['mapAgentsId'][_0xa39d('0xe')]=_0x4d05d5;};ChatQueue[_0xa39d('0x10')][_0xa39d('0x11')]=function(){this['loggedIn']=0x0;this[_0xa39d('0x12')]=0x0;for(var _0x1ba49d=0x0;_0x1ba49d<this[_0xa39d('0x13')][_0xa39d('0x14')];_0x1ba49d+=0x1){if(this['Agents'][_0x1ba49d][_0xa39d('0x15')]){this[_0xa39d('0x16')]+=0x1;}if(this[_0xa39d('0x13')][_0x1ba49d][_0xa39d('0x17')]){this[_0xa39d('0x12')]+=0x1;}}this[_0xa39d('0x18')]=this[_0xa39d('0x16')]-this['paused'];this[_0xa39d('0x18')]=this[_0xa39d('0x18')]>=0x0?this[_0xa39d('0x18')]:0x0;var _0xf956cd={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa39d('0x16')],'name':this[_0xa39d('0x6')],'paused':this[_0xa39d('0x12')],'waiting':this[_0xa39d('0xb')]};var _0x5c286b=md5(JSON[_0xa39d('0x19')](_0xf956cd));if(this[_0xa39d('0xc')]!==_0x5c286b){this[_0xa39d('0xc')]=_0x5c286b;io['to'](util[_0xa39d('0x1a')](_0xa39d('0x1b'),_0xf956cd['name']))[_0xa39d('0x1c')](_0xa39d('0x1d'),_0xf956cd);}};module[_0xa39d('0x1e')]=ChatQueue;
\ No newline at end of file