Built motion from commit (unavailable).|2.5.30
[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 _0x5636=['hook','exports','events','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x2dbac1,_0x44db3b){var _0x8c4e86=function(_0x1544ef){while(--_0x1544ef){_0x2dbac1['push'](_0x2dbac1['shift']());}};_0x8c4e86(++_0x44db3b);}(_0x5636,0x102));var _0x6563=function(_0x32e9a8,_0x39ae3d){_0x32e9a8=_0x32e9a8-0x0;var _0x5174a5=_0x5636[_0x32e9a8];return _0x5174a5;};'use strict';var EventEmitter=require(_0x6563('0x0'));var UserNotification=require(_0x6563('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6563('0x2'),'afterDestroy':_0x6563('0x3')};function emitEvent(_0x115cc1){return function(_0x4ac653,_0x166a58,_0x12f62f){UserNotificationEvents[_0x6563('0x4')](_0x115cc1+':'+_0x4ac653['id'],_0x4ac653);UserNotificationEvents[_0x6563('0x4')](_0x115cc1,_0x4ac653);_0x12f62f(null);};}for(var e in events){if(events[_0x6563('0x5')](e)){var event=events[e];UserNotification[_0x6563('0x6')](e,emitEvent(event));}}module[_0x6563('0x7')]=UserNotificationEvents;