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 _0xc43c=['hook','exports','events','../../mysqldb','UserProfile','remove','emit'];(function(_0xe24841,_0x2c0f66){var _0x2e41b3=function(_0xd50fbe){while(--_0xd50fbe){_0xe24841['push'](_0xe24841['shift']());}};_0x2e41b3(++_0x2c0f66);}(_0xc43c,0xd4));var _0xcc43=function(_0x2fad03,_0x490c10){_0x2fad03=_0x2fad03-0x0;var _0x29c27d=_0xc43c[_0x2fad03];return _0x29c27d;};'use strict';var EventEmitter=require(_0xcc43('0x0'));var UserProfile=require(_0xcc43('0x1'))['db'][_0xcc43('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcc43('0x3')};function emitEvent(_0x482ebc){return function(_0x484b53,_0x4c59cc,_0x37e84f){UserProfileEvents[_0xcc43('0x4')](_0x482ebc+':'+_0x484b53['id'],_0x484b53);UserProfileEvents[_0xcc43('0x4')](_0x482ebc,_0x484b53);_0x37e84f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xcc43('0x5')](e,emitEvent(event));}}module[_0xcc43('0x6')]=UserProfileEvents;