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 _0x29d4=['save','update','remove','emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x29d4,0x1a1));var _0x429d=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x29d4[_0x5e3b04];return _0x1fc44d;};'use strict';var EventEmitter=require(_0x429d('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x429d('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x429d('0x2')](0x0);var events={'afterCreate':_0x429d('0x3'),'afterUpdate':_0x429d('0x4'),'afterDestroy':_0x429d('0x5')};function emitEvent(_0x4e287b){return function(_0xc3989d,_0x3f43f5,_0x36a3d8){UserNotificationEvents[_0x429d('0x6')](_0x4e287b+':'+_0xc3989d['id'],_0xc3989d);UserNotificationEvents[_0x429d('0x6')](_0x4e287b,_0xc3989d);_0x36a3d8(null);};}for(var e in events){if(events[_0x429d('0x7')](e)){var event=events[e];UserNotification[_0x429d('0x8')](e,emitEvent(event));}}module[_0x429d('0x9')]=UserNotificationEvents;