Built motion from commit 52c8a02d.|2.6.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 _0xa0c4=['update','remove','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x16c90b,_0x133383){var _0x2e6a92=function(_0x1b098a){while(--_0x1b098a){_0x16c90b['push'](_0x16c90b['shift']());}};_0x2e6a92(++_0x133383);}(_0xa0c4,0x7d));var _0x4a0c=function(_0x4dd2a6,_0x40af0d){_0x4dd2a6=_0x4dd2a6-0x0;var _0x787f8f=_0xa0c4[_0x4dd2a6];return _0x787f8f;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x4a0c('0x0'))['db'][_0x4a0c('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4a0c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a0c('0x3'),'afterDestroy':_0x4a0c('0x4')};function emitEvent(_0x2f4369){return function(_0xe24fe9,_0x12faf1,_0x5f4406){UserNotificationEvents['emit'](_0x2f4369+':'+_0xe24fe9['id'],_0xe24fe9);UserNotificationEvents['emit'](_0x2f4369,_0xe24fe9);_0x5f4406(null);};}for(var e in events){if(events[_0x4a0c('0x5')](e)){var event=events[e];UserNotification[_0x4a0c('0x6')](e,emitEvent(event));}}module[_0x4a0c('0x7')]=UserNotificationEvents;