Built motion from commit 25580385.|2.6.2
[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 _0xc95e=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x57590e,_0x44252f){var _0x3b05df=function(_0x2a0d2d){while(--_0x2a0d2d){_0x57590e['push'](_0x57590e['shift']());}};_0x3b05df(++_0x44252f);}(_0xc95e,0x9f));var _0xec95=function(_0x4694b2,_0x43c850){_0x4694b2=_0x4694b2-0x0;var _0x1ff744=_0xc95e[_0x4694b2];return _0x1ff744;};'use strict';var EventEmitter=require(_0xec95('0x0'));var UserNotification=require(_0xec95('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xec95('0x2')](0x0);var events={'afterCreate':_0xec95('0x3'),'afterUpdate':_0xec95('0x4'),'afterDestroy':_0xec95('0x5')};function emitEvent(_0x33a3ba){return function(_0x1ef5c4,_0x2f5cb0,_0x35866a){UserNotificationEvents[_0xec95('0x6')](_0x33a3ba+':'+_0x1ef5c4['id'],_0x1ef5c4);UserNotificationEvents[_0xec95('0x6')](_0x33a3ba,_0x1ef5c4);_0x35866a(null);};}for(var e in events){if(events[_0xec95('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xec95('0x8')]=UserNotificationEvents;