Built motion from commit 449495f6.|2.6.27
[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 _0xf509=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4497b8,_0x2ce8b3){var _0x43a86f=function(_0x337cde){while(--_0x337cde){_0x4497b8['push'](_0x4497b8['shift']());}};_0x43a86f(++_0x2ce8b3);}(_0xf509,0x115));var _0x9f50=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xf509[_0xd09668];return _0x68726;};'use strict';var EventEmitter=require(_0x9f50('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9f50('0x1')](0x0);var events={'afterCreate':_0x9f50('0x2'),'afterUpdate':_0x9f50('0x3'),'afterDestroy':_0x9f50('0x4')};function emitEvent(_0x56ee64){return function(_0x9e69,_0x34bc76,_0x1f9e7f){UserNotificationEvents['emit'](_0x56ee64+':'+_0x9e69['id'],_0x9e69);UserNotificationEvents[_0x9f50('0x5')](_0x56ee64,_0x9e69);_0x1f9e7f(null);};}for(var e in events){if(events[_0x9f50('0x6')](e)){var event=events[e];UserNotification[_0x9f50('0x7')](e,emitEvent(event));}}module[_0x9f50('0x8')]=UserNotificationEvents;