Built motion from commit da24aabd.|2.6.20
[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 _0xc08c=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x5cb36b,_0x22450a){var _0x58610d=function(_0x4dbee3){while(--_0x4dbee3){_0x5cb36b['push'](_0x5cb36b['shift']());}};_0x58610d(++_0x22450a);}(_0xc08c,0x152));var _0xcc08=function(_0x227378,_0x2073f2){_0x227378=_0x227378-0x0;var _0x502efe=_0xc08c[_0x227378];return _0x502efe;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xcc08('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xcc08('0x1')](0x0);var events={'afterCreate':_0xcc08('0x2'),'afterUpdate':_0xcc08('0x3'),'afterDestroy':'remove'};function emitEvent(_0x376191){return function(_0x444476,_0x54a8d0,_0x3caf87){UserNotificationEvents[_0xcc08('0x4')](_0x376191+':'+_0x444476['id'],_0x444476);UserNotificationEvents[_0xcc08('0x4')](_0x376191,_0x444476);_0x3caf87(null);};}for(var e in events){if(events[_0xcc08('0x5')](e)){var event=events[e];UserNotification[_0xcc08('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;