Built motion from commit (unavailable).|2.5.29
[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 _0xb7c8=['exports','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb7c8,0x119));var _0x8b7c=function(_0x9c07fb,_0x423308){_0x9c07fb=_0x9c07fb-0x0;var _0x359592=_0xb7c8[_0x9c07fb];return _0x359592;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x8b7c('0x0'))['db'][_0x8b7c('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8b7c('0x2')](0x0);var events={'afterCreate':_0x8b7c('0x3'),'afterUpdate':_0x8b7c('0x4'),'afterDestroy':_0x8b7c('0x5')};function emitEvent(_0x396b64){return function(_0x50113e,_0x38672b,_0x412f93){UserNotificationEvents[_0x8b7c('0x6')](_0x396b64+':'+_0x50113e['id'],_0x50113e);UserNotificationEvents[_0x8b7c('0x6')](_0x396b64,_0x50113e);_0x412f93(null);};}for(var e in events){if(events[_0x8b7c('0x7')](e)){var event=events[e];UserNotification[_0x8b7c('0x8')](e,emitEvent(event));}}module[_0x8b7c('0x9')]=UserNotificationEvents;