Built motion from commit 9d0783e6.|2.6.13
[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 _0x565d=['../../mysqldb','UserNotification','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4e1592,_0x48a9b7){var _0x26d3f2=function(_0x308f8e){while(--_0x308f8e){_0x4e1592['push'](_0x4e1592['shift']());}};_0x26d3f2(++_0x48a9b7);}(_0x565d,0x10d));var _0xd565=function(_0x3591c9,_0x419b51){_0x3591c9=_0x3591c9-0x0;var _0x5f3d06=_0x565d[_0x3591c9];return _0x5f3d06;};'use strict';var EventEmitter=require(_0xd565('0x0'));var UserNotification=require(_0xd565('0x1'))['db'][_0xd565('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd565('0x3'),'afterDestroy':_0xd565('0x4')};function emitEvent(_0x463249){return function(_0x5a4ec2,_0x2d93ad,_0x5ae3de){UserNotificationEvents[_0xd565('0x5')](_0x463249+':'+_0x5a4ec2['id'],_0x5a4ec2);UserNotificationEvents[_0xd565('0x5')](_0x463249,_0x5a4ec2);_0x5ae3de(null);};}for(var e in events){if(events[_0xd565('0x6')](e)){var event=events[e];UserNotification[_0xd565('0x7')](e,emitEvent(event));}}module[_0xd565('0x8')]=UserNotificationEvents;