Built motion from commit 0900f080.|2.5.45
[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 _0x72fb=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x72fb,0x10b));var _0xb72f=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0x72fb[_0x409fb8];return _0x278270;};'use strict';var EventEmitter=require(_0xb72f('0x0'));var UserNotification=require(_0xb72f('0x1'))['db'][_0xb72f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb72f('0x3')](0x0);var events={'afterCreate':_0xb72f('0x4'),'afterUpdate':_0xb72f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3684ce){return function(_0xcb4ab3,_0x333553,_0x23965b){UserNotificationEvents[_0xb72f('0x6')](_0x3684ce+':'+_0xcb4ab3['id'],_0xcb4ab3);UserNotificationEvents['emit'](_0x3684ce,_0xcb4ab3);_0x23965b(null);};}for(var e in events){if(events[_0xb72f('0x7')](e)){var event=events[e];UserNotification[_0xb72f('0x8')](e,emitEvent(event));}}module[_0xb72f('0x9')]=UserNotificationEvents;