Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / config / utils.js
index d4ee61d..7b49e65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f94=['getLicense','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','chat','fax','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes'];(function(_0x465154,_0xa33b26){var _0x561b8f=function(_0x521e19){while(--_0x521e19){_0x465154['push'](_0x465154['shift']());}};_0x561b8f(++_0xa33b26);}(_0x9f94,0x7f));var _0x49f9=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9f94[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x49f9('0x0'));var BPromise=require(_0x49f9('0x1'));var db=require(_0x49f9('0x2'))['db'];var util=require('./license/util');var channels=['voice','mail',_0x49f9('0x3'),_0x49f9('0x4'),'sms','whatsapp',_0x49f9('0x5')];exports[_0x49f9('0x6')]=function(){return channels;};exports[_0x49f9('0x7')]=function(_0x452749){_0x452749=_0x452749['toLowerCase']();return _[_0x49f9('0x8')](channels,_0x452749);};exports[_0x49f9('0x9')]=function(_0xdf184a,_0x510b7e,_0x4b8f0f,_0x4140ef){var _0x16f638={'loginAttempts':_0x510b7e,'blocked':_0x4b8f0f};if(!_[_0x49f9('0xa')](_0x4140ef)){_0x16f638[_0x49f9('0xb')]=_0x4140ef;}return _0xdf184a[_0x49f9('0xc')](_0x16f638);};exports[_0x49f9('0xd')]=function(_0x6e7bb1){return new BPromise(function(_0x1d7f36,_0x444a8b){var _0x32c918=0x0;if(_0x6e7bb1[_0x49f9('0xe')]!==_0x49f9('0xf')){_0x1d7f36(_0x6e7bb1);}db[_0x49f9('0x10')]['count']({'where':{'role':_0x49f9('0xf'),'online':!![],'id':{'$ne':_0x6e7bb1['id']}}})[_0x49f9('0x11')](function(_0x13fbca){_0x32c918=_0x13fbca;return util[_0x49f9('0xd')]();})[_0x49f9('0x11')](function(_0x53f6c3){if(_0x53f6c3&&_0x53f6c3[_0x49f9('0x12')]&&_0x32c918>=_0x53f6c3['agents']){throw Error(_0x49f9('0x13'));}_0x1d7f36(_0x6e7bb1);})['catch'](function(_0x4f786a){_0x444a8b(_0x4f786a);});});};
\ No newline at end of file
+var _0xd026=['clearBlockUser','isUndefined','blockedAt','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','fax','openchannel','isValidChannel','includes'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xd026,0x15c));var _0x6d02=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xd026[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x6d02('0x0'));var BPromise=require(_0x6d02('0x1'));var db=require(_0x6d02('0x2'))['db'];var util=require(_0x6d02('0x3'));var channels=['voice',_0x6d02('0x4'),'chat',_0x6d02('0x5'),'sms','whatsapp',_0x6d02('0x6')];exports['getChannels']=function(){return channels;};exports[_0x6d02('0x7')]=function(_0x2a8e1d){_0x2a8e1d=_0x2a8e1d['toLowerCase']();return _[_0x6d02('0x8')](channels,_0x2a8e1d);};exports[_0x6d02('0x9')]=function(_0x206bc1,_0x58706d,_0x43ff88,_0xcb273){var _0x485742={'loginAttempts':_0x58706d,'blocked':_0x43ff88};if(!_[_0x6d02('0xa')](_0xcb273)){_0x485742[_0x6d02('0xb')]=_0xcb273;}return _0x206bc1['updateAttributes'](_0x485742);};exports[_0x6d02('0xc')]=function(_0x36858d){return new BPromise(function(_0x46da8d,_0x21674d){var _0x36dfdb=0x0;if(_0x36858d[_0x6d02('0xd')]!==_0x6d02('0xe')){_0x46da8d(_0x36858d);}db[_0x6d02('0xf')][_0x6d02('0x10')]({'where':{'role':_0x6d02('0xe'),'online':!![],'id':{'$ne':_0x36858d['id']}}})['then'](function(_0x2378f3){_0x36dfdb=_0x2378f3;return util[_0x6d02('0xc')]();})[_0x6d02('0x11')](function(_0x466463){if(_0x466463&&_0x466463[_0x6d02('0x12')]&&_0x36dfdb>=_0x466463['agents']){throw Error(_0x6d02('0x13'));}_0x46da8d(_0x36858d);})[_0x6d02('0x14')](function(_0x3cbe95){_0x21674d(_0x3cbe95);});});};
\ No newline at end of file