Built motion from commit 953226e6.|2.6.32
[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 _0x7b84=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7b84,0x17c));var _0x47b8=function(_0xca2cb0,_0x2989b7){_0xca2cb0=_0xca2cb0-0x0;var _0xdcc6fe=_0x7b84[_0xca2cb0];return _0xdcc6fe;};'use strict';var EventEmitter=require(_0x47b8('0x0'));var UserProfile=require(_0x47b8('0x1'))['db'][_0x47b8('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x47b8('0x3')](0x0);var events={'afterCreate':_0x47b8('0x4'),'afterUpdate':_0x47b8('0x5'),'afterDestroy':_0x47b8('0x6')};function emitEvent(_0x5c7cda){return function(_0x445a5f,_0x1fa41a,_0x2279ea){UserProfileEvents[_0x47b8('0x7')](_0x5c7cda+':'+_0x445a5f['id'],_0x445a5f);UserProfileEvents[_0x47b8('0x7')](_0x5c7cda,_0x445a5f);_0x2279ea(null);};}for(var e in events){if(events[_0x47b8('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x47b8('0x9')]=UserProfileEvents;