Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / config / utils.js
index f8f392f..70448c2 100644 (file)
@@ -1 +1 @@
-const a888_0x20dc=['voice','getChannels','isValidChannel','openchannel','getLicense','count','mail','../mysqldb','includes','User','update','then','role','whatsapp','agents','toLowerCase','isUndefined','fax','./license/util','agent','catch','sequelize','blockedAt'];(function(_0x1c7280,_0x20dc51){const _0x4d756e=function(_0x29bcf6){while(--_0x29bcf6){_0x1c7280['push'](_0x1c7280['shift']());}};_0x4d756e(++_0x20dc51);}(a888_0x20dc,0xab));const a888_0x4d75=function(_0x1c7280,_0x20dc51){_0x1c7280=_0x1c7280-0x0;let _0x4d756e=a888_0x20dc[_0x1c7280];return _0x4d756e;};const _0x57d6ff=a888_0x4d75;'use strict';const _=require('lodash'),db=require(_0x57d6ff('0x14'))['db'],util=require(_0x57d6ff('0x8')),{Op}=require(_0x57d6ff('0xb')),channels=[_0x57d6ff('0xd'),_0x57d6ff('0x13'),'chat',_0x57d6ff('0x7'),'sms',_0x57d6ff('0x3'),_0x57d6ff('0x10')];exports[_0x57d6ff('0xe')]=function(){return channels;},exports[_0x57d6ff('0xf')]=function(_0x29bcf6){const _0x1ac779=_0x57d6ff;return _0x29bcf6=_0x29bcf6[_0x1ac779('0x5')](),_[_0x1ac779('0x15')](channels,_0x29bcf6);},exports['clearBlockUser']=function(_0x1378d0,_0x1cbc4d,_0x47de4a,_0x2eb827){const _0x2db5a2=_0x57d6ff,_0x95918a={'loginAttempts':_0x1cbc4d,'blocked':_0x47de4a};return!_[_0x2db5a2('0x6')](_0x2eb827)&&(_0x95918a[_0x2db5a2('0xc')]=_0x2eb827),_0x1378d0[_0x2db5a2('0x0')](_0x95918a);},exports[_0x57d6ff('0x11')]=function(_0x1bb083){return new Promise(function(_0x81af22,_0x575ed7){const _0x5cdec1=a888_0x4d75;let _0x4de132=0x0;_0x1bb083[_0x5cdec1('0x2')]!==_0x5cdec1('0x9')&&_0x81af22(_0x1bb083),db[_0x5cdec1('0x16')][_0x5cdec1('0x12')]({'where':{'role':_0x5cdec1('0x9'),'online':!![],'id':{[Op['ne']]:_0x1bb083['id']}}})[_0x5cdec1('0x1')](function(_0x4a0997){const _0x527d53=_0x5cdec1;return _0x4de132=_0x4a0997,util[_0x527d53('0x11')]();})['then'](function(_0x17ab88){const _0x4e9b05=_0x5cdec1;if(_0x17ab88&&_0x17ab88[_0x4e9b05('0x4')]&&_0x4de132>=_0x17ab88[_0x4e9b05('0x4')])throw Error('Maximum\x20login\x20has\x20been\x20reached');_0x81af22(_0x1bb083);})[_0x5cdec1('0xa')](function(_0x59a7b7){_0x575ed7(_0x59a7b7);});});};
\ No newline at end of file
+const a888_0x56b0=['sms','toLowerCase','getChannels','whatsapp','fax','Maximum\x20login\x20has\x20been\x20reached','getLicense','openchannel','../mysqldb','agents','clearBlockUser','voice','includes','isValidChannel','mail','role','./license/util','blockedAt','update','isUndefined','count'];(function(_0x188e57,_0x56b09a){const _0x35742c=function(_0x2e8bc9){while(--_0x2e8bc9){_0x188e57['push'](_0x188e57['shift']());}};_0x35742c(++_0x56b09a);}(a888_0x56b0,0x196));const a888_0x3574=function(_0x188e57,_0x56b09a){_0x188e57=_0x188e57-0x0;let _0x35742c=a888_0x56b0[_0x188e57];return _0x35742c;};const _0x2c2199=a888_0x3574;'use strict';const _=require('lodash'),db=require(_0x2c2199('0x1'))['db'],util=require(_0x2c2199('0x9')),{Op}=require('sequelize'),channels=[_0x2c2199('0x4'),_0x2c2199('0x7'),'chat',_0x2c2199('0x12'),_0x2c2199('0xe'),_0x2c2199('0x11'),_0x2c2199('0x0')];exports[_0x2c2199('0x10')]=function(){return channels;},exports[_0x2c2199('0x6')]=function(_0x2e8bc9){const _0x4134b9=_0x2c2199;return _0x2e8bc9=_0x2e8bc9[_0x4134b9('0xf')](),_[_0x4134b9('0x5')](channels,_0x2e8bc9);},exports[_0x2c2199('0x3')]=function(_0x25f1d2,_0x5ae8bf,_0x50420e,_0xeeec6f){const _0x563651=_0x2c2199,_0x2421c0={'loginAttempts':_0x5ae8bf,'blocked':_0x50420e};return!_[_0x563651('0xc')](_0xeeec6f)&&(_0x2421c0[_0x563651('0xa')]=_0xeeec6f),_0x25f1d2[_0x563651('0xb')](_0x2421c0);},exports[_0x2c2199('0x14')]=function(_0x2413f0){return new Promise(function(_0xd4bd13,_0x4908d1){const _0x4090a9=a888_0x3574;let _0x2d5309=0x0;_0x2413f0[_0x4090a9('0x8')]!=='agent'&&_0xd4bd13(_0x2413f0),db['User'][_0x4090a9('0xd')]({'where':{'role':'agent','online':!![],'id':{[Op['ne']]:_0x2413f0['id']}}})['then'](function(_0x2b35b3){const _0x351816=_0x4090a9;return _0x2d5309=_0x2b35b3,util[_0x351816('0x14')]();})['then'](function(_0x4bcc77){const _0x4e8790=_0x4090a9;if(_0x4bcc77&&_0x4bcc77[_0x4e8790('0x2')]&&_0x2d5309>=_0x4bcc77['agents'])throw Error(_0x4e8790('0x13'));_0xd4bd13(_0x2413f0);})['catch'](function(_0x4c6808){_0x4908d1(_0x4c6808);});});};
\ No newline at end of file