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 _0xd021=['hook','events','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x179f19,_0x3f7af3){var _0x3fee80=function(_0x204d97){while(--_0x204d97){_0x179f19['push'](_0x179f19['shift']());}};_0x3fee80(++_0x3f7af3);}(_0xd021,0x1e4));var _0x1d02=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd021[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x1d02('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1d02('0x1')](0x0);var events={'afterCreate':_0x1d02('0x2'),'afterUpdate':_0x1d02('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18ea23){return function(_0xdea0c8,_0x178130,_0x1b25d6){UserProfileEvents[_0x1d02('0x4')](_0x18ea23+':'+_0xdea0c8['id'],_0xdea0c8);UserProfileEvents[_0x1d02('0x4')](_0x18ea23,_0xdea0c8);_0x1b25d6(null);};}for(var e in events){if(events[_0x1d02('0x5')](e)){var event=events[e];UserProfile[_0x1d02('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents;