Built motion from commit 56b8093a.|2.6.29
[motion2.git] / server / api / user-setting / user-setting.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 _0xd760=['remove','emit','events','../../mysqldb','save','update'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xd760,0x68));var _0x0d76=function(_0x2acdfe,_0x102248){_0x2acdfe=_0x2acdfe-0x0;var _0x4db243=_0xd760[_0x2acdfe];return _0x4db243;};'use strict';var EventEmitter=require(_0x0d76('0x0'));var UserSetting=require(_0x0d76('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0d76('0x2'),'afterUpdate':_0x0d76('0x3'),'afterDestroy':_0x0d76('0x4')};function emitEvent(_0x58f115){return function(_0x202c30,_0x14239a,_0x392436){UserSettingEvents[_0x0d76('0x5')](_0x58f115+':'+_0x202c30['id'],_0x202c30);UserSettingEvents[_0x0d76('0x5')](_0x58f115,_0x202c30);_0x392436(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents;