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 _0x76a0=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x76a0,0x112));var _0x076a=function(_0x2d2030,_0x3aa483){_0x2d2030=_0x2d2030-0x0;var _0x17ab71=_0x76a0[_0x2d2030];return _0x17ab71;};'use strict';var EventEmitter=require(_0x076a('0x0'));var UserNotification=require(_0x076a('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x076a('0x2')](0x0);var events={'afterCreate':_0x076a('0x3'),'afterUpdate':_0x076a('0x4'),'afterDestroy':_0x076a('0x5')};function emitEvent(_0x3c93df){return function(_0x4fe7c1,_0x37c3b7,_0x41d398){UserNotificationEvents[_0x076a('0x6')](_0x3c93df+':'+_0x4fe7c1['id'],_0x4fe7c1);UserNotificationEvents[_0x076a('0x6')](_0x3c93df,_0x4fe7c1);_0x41d398(null);};}for(var e in events){if(events[_0x076a('0x7')](e)){var event=events[e];UserNotification[_0x076a('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;