Built motion from commit 753c950e.|2.5.42
[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 _0xf99a=['hook','exports','events','../../mysqldb','UserNotification','save','remove','emit','hasOwnProperty'];(function(_0x227616,_0x3c3ab2){var _0x4cf73b=function(_0x4e16a6){while(--_0x4e16a6){_0x227616['push'](_0x227616['shift']());}};_0x4cf73b(++_0x3c3ab2);}(_0xf99a,0xd1));var _0xaf99=function(_0xe71372,_0x2a41ff){_0xe71372=_0xe71372-0x0;var _0x4d50fe=_0xf99a[_0xe71372];return _0x4d50fe;};'use strict';var EventEmitter=require(_0xaf99('0x0'));var UserNotification=require(_0xaf99('0x1'))['db'][_0xaf99('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf99('0x3'),'afterUpdate':'update','afterDestroy':_0xaf99('0x4')};function emitEvent(_0x10827e){return function(_0xb080df,_0x3c0398,_0x44ab52){UserNotificationEvents[_0xaf99('0x5')](_0x10827e+':'+_0xb080df['id'],_0xb080df);UserNotificationEvents['emit'](_0x10827e,_0xb080df);_0x44ab52(null);};}for(var e in events){if(events[_0xaf99('0x6')](e)){var event=events[e];UserNotification[_0xaf99('0x7')](e,emitEvent(event));}}module[_0xaf99('0x8')]=UserNotificationEvents;