2a0910edaa5a2c8933b5c91e528c208c42198a37
[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 _0xbf11=['emit','hook','exports','events','save','update','remove'];(function(_0x35dd3e,_0x100fd0){var _0x13e059=function(_0x159cb5){while(--_0x159cb5){_0x35dd3e['push'](_0x35dd3e['shift']());}};_0x13e059(++_0x100fd0);}(_0xbf11,0x1bc));var _0x1bf1=function(_0x559b69,_0x5b98bd){_0x559b69=_0x559b69-0x0;var _0x2ff0eb=_0xbf11[_0x559b69];return _0x2ff0eb;};'use strict';var EventEmitter=require(_0x1bf1('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1bf1('0x1'),'afterUpdate':_0x1bf1('0x2'),'afterDestroy':_0x1bf1('0x3')};function emitEvent(_0x2a1d3f){return function(_0x30624e,_0x5d0bdc,_0x5e8c5d){UserNotificationEvents[_0x1bf1('0x4')](_0x2a1d3f+':'+_0x30624e['id'],_0x30624e);UserNotificationEvents[_0x1bf1('0x4')](_0x2a1d3f,_0x30624e);_0x5e8c5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x1bf1('0x5')](e,emitEvent(event));}}module[_0x1bf1('0x6')]=UserNotificationEvents;