1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x4ffa=['UserProfile','models','then','catch','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5cc4de,_0x2df335){var _0x1bf255=function(_0x479413){while(--_0x479413){_0x5cc4de['push'](_0x5cc4de['shift']());}};_0x1bf255(++_0x2df335);}(_0x4ffa,0x124));var _0xa4ff=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4ffa[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa4ff('0x0'))('api');var moment=require(_0xa4ff('0x1'));var BPromise=require(_0xa4ff('0x2'));var rp=require(_0xa4ff('0x3'));var fs=require('fs');var path=require(_0xa4ff('0x4'));var rimraf=require(_0xa4ff('0x5'));var config=require(_0xa4ff('0x6'));var attributes=require('./userProfile.attributes');module[_0xa4ff('0x7')]=function(_0x1d6a4c,_0x2bf21d){return _0x1d6a4c['define'](_0xa4ff('0x8'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x482e8d,_0x1da35a,_0x420e46){var _0x4dfa72=_0x1d6a4c[_0xa4ff('0x9')];_0x4dfa72['User']['update']({'privacyEnabled':_0x482e8d['privacyEnabled']},{'where':{'UserProfileId':_0x482e8d['id']}})[_0xa4ff('0xa')](function(){_0x420e46();})[_0xa4ff('0xb')](function(_0x7cb440){_0x420e46(_0x7cb440);});}}});};