143816246bc6ae021f58465555fc63055965c16f
[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 _0xe742=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification'];(function(_0x3f7d30,_0x288d25){var _0x220b4b=function(_0x4806fe){while(--_0x4806fe){_0x3f7d30['push'](_0x3f7d30['shift']());}};_0x220b4b(++_0x288d25);}(_0xe742,0x180));var _0x2e74=function(_0xb384c6,_0x2c832a){_0xb384c6=_0xb384c6-0x0;var _0x53d1b2=_0xe742[_0xb384c6];return _0x53d1b2;};'use strict';var EventEmitter=require(_0x2e74('0x0'));var UserNotification=require(_0x2e74('0x1'))['db'][_0x2e74('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e74('0x3'),'afterUpdate':'update','afterDestroy':_0x2e74('0x4')};function emitEvent(_0x2502dc){return function(_0x1d516b,_0x1a8ecd,_0x19d076){UserNotificationEvents['emit'](_0x2502dc+':'+_0x1d516b['id'],_0x1d516b);UserNotificationEvents[_0x2e74('0x5')](_0x2502dc,_0x1d516b);_0x19d076(null);};}for(var e in events){if(events[_0x2e74('0x6')](e)){var event=events[e];UserNotification[_0x2e74('0x7')](e,emitEvent(event));}}module[_0x2e74('0x8')]=UserNotificationEvents;