Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / config / utils.js
index a0a71e8..6e6f1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3040=['sms','whatsapp','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','voice','fax'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3040,0x87));var _0x0304=function(_0x3d4d41,_0x2ee486){_0x3d4d41=_0x3d4d41-0x0;var _0x20d879=_0x3040[_0x3d4d41];return _0x20d879;};'use strict';var _=require(_0x0304('0x0'));var BPromise=require(_0x0304('0x1'));var db=require(_0x0304('0x2'))['db'];var util=require('./license/util');var channels=[_0x0304('0x3'),'mail','chat',_0x0304('0x4'),_0x0304('0x5'),_0x0304('0x6'),'openchannel'];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x5e78a2){_0x5e78a2=_0x5e78a2[_0x0304('0x7')]();return _['includes'](channels,_0x5e78a2);};exports[_0x0304('0x8')]=function(_0x448c72,_0x52b951,_0x4c82eb,_0x8376c9){var _0x5844bf={'loginAttempts':_0x52b951,'blocked':_0x4c82eb};if(!_[_0x0304('0x9')](_0x8376c9)){_0x5844bf[_0x0304('0xa')]=_0x8376c9;}return _0x448c72[_0x0304('0xb')](_0x5844bf);};exports[_0x0304('0xc')]=function(_0x1375ab){return new BPromise(function(_0x31276f,_0x272f1c){var _0x24f4eb=0x0;if(_0x1375ab['role']!=='agent'){_0x31276f(_0x1375ab);}db[_0x0304('0xd')][_0x0304('0xe')]({'where':{'role':_0x0304('0xf'),'online':!![],'id':{'$ne':_0x1375ab['id']}}})[_0x0304('0x10')](function(_0xfc4e67){_0x24f4eb=_0xfc4e67;return util[_0x0304('0xc')]();})[_0x0304('0x10')](function(_0x331d88){if(_0x331d88&&_0x331d88[_0x0304('0x11')]&&_0x24f4eb>=_0x331d88[_0x0304('0x11')]){throw Error(_0x0304('0x12'));}_0x31276f(_0x1375ab);})[_0x0304('0x13')](function(_0x36097c){_0x272f1c(_0x36097c);});});};
\ No newline at end of file
+var _0x4ebe=['bluebird','../mysqldb','mail','chat','sms','openchannel','isValidChannel','toLowerCase','clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash'];(function(_0x5b2bcb,_0x2bf78c){var _0x26952e=function(_0x4412d8){while(--_0x4412d8){_0x5b2bcb['push'](_0x5b2bcb['shift']());}};_0x26952e(++_0x2bf78c);}(_0x4ebe,0xfb));var _0xe4eb=function(_0x1400f1,_0x1dad76){_0x1400f1=_0x1400f1-0x0;var _0x414bda=_0x4ebe[_0x1400f1];return _0x414bda;};'use strict';var _=require(_0xe4eb('0x0'));var BPromise=require(_0xe4eb('0x1'));var db=require(_0xe4eb('0x2'))['db'];var util=require('./license/util');var channels=['voice',_0xe4eb('0x3'),_0xe4eb('0x4'),'fax',_0xe4eb('0x5'),'whatsapp',_0xe4eb('0x6')];exports['getChannels']=function(){return channels;};exports[_0xe4eb('0x7')]=function(_0x43f598){_0x43f598=_0x43f598[_0xe4eb('0x8')]();return _['includes'](channels,_0x43f598);};exports[_0xe4eb('0x9')]=function(_0x2d4f47,_0x38f805,_0x1a8699,_0x2ee437){var _0x3d6acd={'loginAttempts':_0x38f805,'blocked':_0x1a8699};if(!_[_0xe4eb('0xa')](_0x2ee437)){_0x3d6acd['blockedAt']=_0x2ee437;}return _0x2d4f47[_0xe4eb('0xb')](_0x3d6acd);};exports[_0xe4eb('0xc')]=function(_0x43509c){return new BPromise(function(_0x3b0f37,_0x174c55){var _0x4a500e=0x0;if(_0x43509c[_0xe4eb('0xd')]!==_0xe4eb('0xe')){_0x3b0f37(_0x43509c);}db[_0xe4eb('0xf')][_0xe4eb('0x10')]({'where':{'role':_0xe4eb('0xe'),'online':!![],'id':{'$ne':_0x43509c['id']}}})[_0xe4eb('0x11')](function(_0x164e74){_0x4a500e=_0x164e74;return util[_0xe4eb('0xc')]();})[_0xe4eb('0x11')](function(_0x23b671){if(_0x23b671&&_0x23b671[_0xe4eb('0x12')]&&_0x4a500e>=_0x23b671[_0xe4eb('0x12')]){throw Error(_0xe4eb('0x13'));}_0x3b0f37(_0x43509c);})[_0xe4eb('0x14')](function(_0x1d5a66){_0x174c55(_0x1d5a66);});});};
\ No newline at end of file