Built motion from commit 3c2ce842.|2.6.31
[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 _0xc03b=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xc03b,0xd5));var _0xbc03=function(_0x43db86,_0x34184b){_0x43db86=_0x43db86-0x0;var _0x27bda2=_0xc03b[_0x43db86];return _0x27bda2;};'use strict';var EventEmitter=require(_0xbc03('0x0'));var UserSetting=require(_0xbc03('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xbc03('0x2')](0x0);var events={'afterCreate':_0xbc03('0x3'),'afterUpdate':'update','afterDestroy':_0xbc03('0x4')};function emitEvent(_0x518963){return function(_0x58d776,_0x16a7c4,_0x44c0a8){UserSettingEvents['emit'](_0x518963+':'+_0x58d776['id'],_0x58d776);UserSettingEvents[_0xbc03('0x5')](_0x518963,_0x58d776);_0x44c0a8(null);};}for(var e in events){if(events[_0xbc03('0x6')](e)){var event=events[e];UserSetting[_0xbc03('0x7')](e,emitEvent(event));}}module[_0xbc03('0x8')]=UserSettingEvents;