Built motion from commit 3c2ce842.|2.6.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 _0x338e=['update','remove','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners','save'];(function(_0x37f21d,_0x50049a){var _0x5da49b=function(_0x3763f8){while(--_0x3763f8){_0x37f21d['push'](_0x37f21d['shift']());}};_0x5da49b(++_0x50049a);}(_0x338e,0x1e2));var _0xe338=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x338e[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xe338('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xe338('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe338('0x2')](0x0);var events={'afterCreate':_0xe338('0x3'),'afterUpdate':_0xe338('0x4'),'afterDestroy':_0xe338('0x5')};function emitEvent(_0x14964b){return function(_0x282b3d,_0x4eab74,_0x4a07dc){UserNotificationEvents['emit'](_0x14964b+':'+_0x282b3d['id'],_0x282b3d);UserNotificationEvents['emit'](_0x14964b,_0x282b3d);_0x4a07dc(null);};}for(var e in events){if(events[_0xe338('0x6')](e)){var event=events[e];UserNotification[_0xe338('0x7')](e,emitEvent(event));}}module[_0xe338('0x8')]=UserNotificationEvents;