Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / userProfile / userProfile.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xba38=['../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x1a16a6,_0x405141){var _0x5e3d0b=function(_0x314c34){while(--_0x314c34){_0x1a16a6['push'](_0x1a16a6['shift']());}};_0x5e3d0b(++_0x405141);}(_0xba38,0x190));var _0x8ba3=function(_0x2316f6,_0x4d7ea5){_0x2316f6=_0x2316f6-0x0;var _0x480b4f=_0xba38[_0x2316f6];return _0x480b4f;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8ba3('0x0'))['db'][_0x8ba3('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8ba3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ba3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x173415){return function(_0x2dce57,_0x124492,_0x105cb3){UserProfileEvents[_0x8ba3('0x4')](_0x173415+':'+_0x2dce57['id'],_0x2dce57);UserProfileEvents[_0x8ba3('0x4')](_0x173415,_0x2dce57);_0x105cb3(null);};}for(var e in events){if(events[_0x8ba3('0x5')](e)){var event=events[e];UserProfile[_0x8ba3('0x6')](e,emitEvent(event));}}module[_0x8ba3('0x7')]=UserProfileEvents;