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 _0xa331=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0x20a005,_0x3267c4){var _0x318723=function(_0x4dd1e8){while(--_0x4dd1e8){_0x20a005['push'](_0x20a005['shift']());}};_0x318723(++_0x3267c4);}(_0xa331,0x162));var _0x1a33=function(_0x51dccc,_0x32ec11){_0x51dccc=_0x51dccc-0x0;var _0x44d20e=_0xa331[_0x51dccc];return _0x44d20e;};'use strict';var EventEmitter=require(_0x1a33('0x0'));var UserNotification=require(_0x1a33('0x1'))['db'][_0x1a33('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1a33('0x3')](0x0);var events={'afterCreate':_0x1a33('0x4'),'afterUpdate':_0x1a33('0x5'),'afterDestroy':_0x1a33('0x6')};function emitEvent(_0x4e43da){return function(_0xa09f41,_0x4c8597,_0x1413cc){UserNotificationEvents['emit'](_0x4e43da+':'+_0xa09f41['id'],_0xa09f41);UserNotificationEvents['emit'](_0x4e43da,_0xa09f41);_0x1413cc(null);};}for(var e in events){if(events[_0x1a33('0x7')](e)){var event=events[e];UserNotification[_0x1a33('0x8')](e,emitEvent(event));}}module[_0x1a33('0x9')]=UserNotificationEvents;