Built motion from commit 43538d75.|2.5.35
[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 _0x4819=['save','update','remove','emit','exports','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0x4819,0xcd));var _0x9481=function(_0x23c3f4,_0x24f0b3){_0x23c3f4=_0x23c3f4-0x0;var _0x82f0f1=_0x4819[_0x23c3f4];return _0x82f0f1;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x9481('0x0'))['db'][_0x9481('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9481('0x2')](0x0);var events={'afterCreate':_0x9481('0x3'),'afterUpdate':_0x9481('0x4'),'afterDestroy':_0x9481('0x5')};function emitEvent(_0x40a703){return function(_0x14dc10,_0xc39edf,_0x16c617){UserProfileEvents['emit'](_0x40a703+':'+_0x14dc10['id'],_0x14dc10);UserProfileEvents[_0x9481('0x6')](_0x40a703,_0x14dc10);_0x16c617(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9481('0x7')]=UserProfileEvents;