Built motion from commit 9d1906d1.|2.5.40
[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 _0x43cc=['../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x59685f,_0x32ddd0){var _0x174017=function(_0xc274fd){while(--_0xc274fd){_0x59685f['push'](_0x59685f['shift']());}};_0x174017(++_0x32ddd0);}(_0x43cc,0x17a));var _0xc43c=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x43cc[_0xe8129c];return _0x709fc5;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xc43c('0x0'))['db'][_0xc43c('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc43c('0x2')](0x0);var events={'afterCreate':_0xc43c('0x3'),'afterUpdate':_0xc43c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ea793){return function(_0xc6ff59,_0x4ad33e,_0x233cbf){UserNotificationEvents[_0xc43c('0x5')](_0x5ea793+':'+_0xc6ff59['id'],_0xc6ff59);UserNotificationEvents['emit'](_0x5ea793,_0xc6ff59);_0x233cbf(null);};}for(var e in events){if(events[_0xc43c('0x6')](e)){var event=events[e];UserNotification[_0xc43c('0x7')](e,emitEvent(event));}}module[_0xc43c('0x8')]=UserNotificationEvents;