Built motion from commit eddce310.|2.6.12
[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 _0xb958=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x25e227,_0x56dbc0){var _0x3df0c2=function(_0x4a694f){while(--_0x4a694f){_0x25e227['push'](_0x25e227['shift']());}};_0x3df0c2(++_0x56dbc0);}(_0xb958,0x97));var _0x8b95=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xb958[_0x10004e];return _0x5af990;};'use strict';var EventEmitter=require(_0x8b95('0x0'));var UserNotification=require(_0x8b95('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b95('0x2'),'afterUpdate':_0x8b95('0x3'),'afterDestroy':_0x8b95('0x4')};function emitEvent(_0x236609){return function(_0x4a388d,_0x4a0a97,_0x13d9ea){UserNotificationEvents[_0x8b95('0x5')](_0x236609+':'+_0x4a388d['id'],_0x4a388d);UserNotificationEvents[_0x8b95('0x5')](_0x236609,_0x4a388d);_0x13d9ea(null);};}for(var e in events){if(events[_0x8b95('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x8b95('0x7')]=UserNotificationEvents;