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 _0x8c25=['setMaxListeners','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0x8c25,0x10c));var _0x58c2=function(_0xcfd3e0,_0x331ddc){_0xcfd3e0=_0xcfd3e0-0x0;var _0x268bfb=_0x8c25[_0xcfd3e0];return _0x268bfb;};'use strict';var EventEmitter=require(_0x58c2('0x0'));var UserNotification=require(_0x58c2('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x58c2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x58c2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x328204){return function(_0x1129ce,_0xe8721b,_0x33f10c){UserNotificationEvents[_0x58c2('0x4')](_0x328204+':'+_0x1129ce['id'],_0x1129ce);UserNotificationEvents[_0x58c2('0x4')](_0x328204,_0x1129ce);_0x33f10c(null);};}for(var e in events){if(events[_0x58c2('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents;