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 _0x2f13=['../../mysqldb','update','remove','emit','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f13,0x15d));var _0x32f1=function(_0x2c7b76,_0x184438){_0x2c7b76=_0x2c7b76-0x0;var _0x92d9f9=_0x2f13[_0x2c7b76];return _0x92d9f9;};'use strict';var EventEmitter=require(_0x32f1('0x0'));var UserProfile=require(_0x32f1('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x32f1('0x2'),'afterDestroy':_0x32f1('0x3')};function emitEvent(_0x344746){return function(_0x5b51ee,_0x474397,_0x5ab60a){UserProfileEvents['emit'](_0x344746+':'+_0x5b51ee['id'],_0x5b51ee);UserProfileEvents[_0x32f1('0x4')](_0x344746,_0x5b51ee);_0x5ab60a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x32f1('0x5')](e,emitEvent(event));}}module[_0x32f1('0x6')]=UserProfileEvents;