Built motion from commit fda31434.|2.5.44
[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 _0x94ea=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0x2e6b64,_0xccbf5e){var _0x41f346=function(_0x333e5b){while(--_0x333e5b){_0x2e6b64['push'](_0x2e6b64['shift']());}};_0x41f346(++_0xccbf5e);}(_0x94ea,0xac));var _0xa94e=function(_0x49e0e5,_0x1f1f6b){_0x49e0e5=_0x49e0e5-0x0;var _0x249c90=_0x94ea[_0x49e0e5];return _0x249c90;};'use strict';var EventEmitter=require(_0xa94e('0x0'));var UserNotification=require(_0xa94e('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa94e('0x2'),'afterUpdate':_0xa94e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x542f71){return function(_0x58a825,_0x2402ed,_0x32c242){UserNotificationEvents[_0xa94e('0x4')](_0x542f71+':'+_0x58a825['id'],_0x58a825);UserNotificationEvents[_0xa94e('0x4')](_0x542f71,_0x58a825);_0x32c242(null);};}for(var e in events){if(events[_0xa94e('0x5')](e)){var event=events[e];UserNotification[_0xa94e('0x6')](e,emitEvent(event));}}module[_0xa94e('0x7')]=UserNotificationEvents;