2c39199a51196da560739316d3c65bcec10fdbd0
[motion2.git] / server / api / userNotification / userNotification.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x4d8c=['hasOwnProperty','../../mysqldb','save','update','remove','emit'];(function(_0x246116,_0x2330f5){var _0x5ab8e4=function(_0x2a965f){while(--_0x2a965f){_0x246116['push'](_0x246116['shift']());}};_0x5ab8e4(++_0x2330f5);}(_0x4d8c,0x1a5));var _0xc4d8=function(_0x38909a,_0x19b2ec){_0x38909a=_0x38909a-0x0;var _0x13db91=_0x4d8c[_0x38909a];return _0x13db91;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xc4d8('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc4d8('0x1'),'afterUpdate':_0xc4d8('0x2'),'afterDestroy':_0xc4d8('0x3')};function emitEvent(_0x84ea63){return function(_0x2d5a35,_0x2cc850,_0x6b2672){UserNotificationEvents[_0xc4d8('0x4')](_0x84ea63+':'+_0x2d5a35['id'],_0x2d5a35);UserNotificationEvents[_0xc4d8('0x4')](_0x84ea63,_0x2d5a35);_0x6b2672(null);};}for(var e in events){if(events[_0xc4d8('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents;