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 _0xf07b=['../../mysqldb','User','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf07b,0x179));var _0xbf07=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf07b[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xbf07('0x0'));var User=require(_0xbf07('0x1'))['db'][_0xbf07('0x2')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf07('0x3'),'afterDestroy':_0xbf07('0x4')};function emitEvent(_0x19f6cb){return function(_0xcf211b,_0x35e2c0,_0x244217){UserEvents[_0xbf07('0x5')](_0x19f6cb+':'+_0xcf211b['id'],_0xcf211b);UserEvents[_0xbf07('0x5')](_0x19f6cb,_0xcf211b);_0x244217(null);};}for(var e in events){if(events[_0xbf07('0x6')](e)){var event=events[e];User[_0xbf07('0x7')](e,emitEvent(event));}}module[_0xbf07('0x8')]=UserEvents;