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 _0x0c1f=['hook','exports','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x3c8956,_0x1f5c39){var _0x258e08=function(_0x1f7668){while(--_0x1f7668){_0x3c8956['push'](_0x3c8956['shift']());}};_0x258e08(++_0x1f5c39);}(_0x0c1f,0x10a));var _0xf0c1=function(_0xd4470d,_0x47318d){_0xd4470d=_0xd4470d-0x0;var _0x5544c5=_0x0c1f[_0xd4470d];return _0x5544c5;};'use strict';var EventEmitter=require(_0xf0c1('0x0'));var UserNotification=require(_0xf0c1('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xf0c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf0c1('0x3')};function emitEvent(_0x1b3c8d){return function(_0x121328,_0xded259,_0x1f1a39){UserNotificationEvents[_0xf0c1('0x4')](_0x1b3c8d+':'+_0x121328['id'],_0x121328);UserNotificationEvents[_0xf0c1('0x4')](_0x1b3c8d,_0x121328);_0x1f1a39(null);};}for(var e in events){if(events[_0xf0c1('0x5')](e)){var event=events[e];UserNotification[_0xf0c1('0x6')](e,emitEvent(event));}}module[_0xf0c1('0x7')]=UserNotificationEvents;