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 _0xd226=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x30a4ba,_0x27f6ee){var _0x1f4d05=function(_0x4dcd8d){while(--_0x4dcd8d){_0x30a4ba['push'](_0x30a4ba['shift']());}};_0x1f4d05(++_0x27f6ee);}(_0xd226,0x197));var _0x6d22=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0xd226[_0x2cef86];return _0x46dfd6;};'use strict';var EventEmitter=require(_0x6d22('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6d22('0x1')](0x0);var events={'afterCreate':_0x6d22('0x2'),'afterUpdate':_0x6d22('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3f1d36){return function(_0x25da03,_0x45d70e,_0xb13b48){UserNotificationEvents[_0x6d22('0x4')](_0x3f1d36+':'+_0x25da03['id'],_0x25da03);UserNotificationEvents[_0x6d22('0x4')](_0x3f1d36,_0x25da03);_0xb13b48(null);};}for(var e in events){if(events[_0x6d22('0x5')](e)){var event=events[e];UserNotification[_0x6d22('0x6')](e,emitEvent(event));}}module[_0x6d22('0x7')]=UserNotificationEvents;