1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xbc95=['hook','UserSetting','update','remove','emit'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xbc95,0xdd));var _0x5bc9=function(_0x441847,_0x21da34){_0x441847=_0x441847-0x0;var _0x5b109c=_0xbc95[_0x441847];return _0x5b109c;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0x5bc9('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5bc9('0x1'),'afterDestroy':_0x5bc9('0x2')};function emitEvent(_0x4a7c42){return function(_0x517db7,_0x40b61d,_0x47f4d7){UserSettingEvents[_0x5bc9('0x3')](_0x4a7c42+':'+_0x517db7['id'],_0x517db7);UserSettingEvents[_0x5bc9('0x3')](_0x4a7c42,_0x517db7);_0x47f4d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x5bc9('0x4')](e,emitEvent(event));}}module['exports']=UserSettingEvents;