Built motion from commit (unavailable).|2.5.31
[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 _0xee14=['hook','exports','UserNotification','setMaxListeners','save','update','remove','emit'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xee14,0x13a));var _0x4ee1=function(_0x32c8c8,_0x3f4935){_0x32c8c8=_0x32c8c8-0x0;var _0x47c8ea=_0xee14[_0x32c8c8];return _0x47c8ea;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x4ee1('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4ee1('0x1')](0x0);var events={'afterCreate':_0x4ee1('0x2'),'afterUpdate':_0x4ee1('0x3'),'afterDestroy':_0x4ee1('0x4')};function emitEvent(_0x236ccd){return function(_0x34a0ae,_0x1e5fb6,_0x3ccbc6){UserNotificationEvents['emit'](_0x236ccd+':'+_0x34a0ae['id'],_0x34a0ae);UserNotificationEvents[_0x4ee1('0x5')](_0x236ccd,_0x34a0ae);_0x3ccbc6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x4ee1('0x6')](e,emitEvent(event));}}module[_0x4ee1('0x7')]=UserNotificationEvents;