d4328f73f38db27411b3808de547292833900dc1
[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 _0x27c9=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x16443f,_0x34740a){var _0x3203e2=function(_0x42b1ab){while(--_0x42b1ab){_0x16443f['push'](_0x16443f['shift']());}};_0x3203e2(++_0x34740a);}(_0x27c9,0x1af));var _0x927c=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x27c9[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x927c('0x0'));var ChatInternalMessage=require(_0x927c('0x1'))['db'][_0x927c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x927c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x927c('0x4'),'afterDestroy':_0x927c('0x5')};function emitEvent(_0x591cb0){return function(_0x3a091e,_0x3ec1a0,_0x3c36f6){ChatInternalMessageEvents[_0x927c('0x6')](_0x591cb0+':'+_0x3a091e['id'],_0x3a091e);ChatInternalMessageEvents[_0x927c('0x6')](_0x591cb0,_0x3a091e);_0x3c36f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x927c('0x7')](e,emitEvent(event));}}module[_0x927c('0x8')]=ChatInternalMessageEvents;