Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / chatInternalMessage / chatInternalMessage.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 _0x3c94=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x3308b7,_0x73df9c){var _0x3f89bd=function(_0x4da01a){while(--_0x4da01a){_0x3308b7['push'](_0x3308b7['shift']());}};_0x3f89bd(++_0x73df9c);}(_0x3c94,0x111));var _0x43c9=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0x3c94[_0x56d1b7];return _0x184d91;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x43c9('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x43c9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x43c9('0x2'),'afterDestroy':_0x43c9('0x3')};function emitEvent(_0x388344){return function(_0x37eb74,_0x1b8725,_0x5e6c3e){ChatInternalMessageEvents[_0x43c9('0x4')](_0x388344+':'+_0x37eb74['id'],_0x37eb74);ChatInternalMessageEvents[_0x43c9('0x4')](_0x388344,_0x37eb74);_0x5e6c3e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x43c9('0x5')](e,emitEvent(event));}}module[_0x43c9('0x6')]=ChatInternalMessageEvents;