1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x914f=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0xf8ca48,_0xdf121){var _0x536825=function(_0x4027b8){while(--_0x4027b8){_0xf8ca48['push'](_0xf8ca48['shift']());}};_0x536825(++_0xdf121);}(_0x914f,0x158));var _0xf914=function(_0xa9dd3e,_0x218069){_0xa9dd3e=_0xa9dd3e-0x0;var _0x4f03a1=_0x914f[_0xa9dd3e];return _0x4f03a1;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xf914('0x0'))['db'][_0xf914('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf914('0x2')](0x0);var events={'afterCreate':_0xf914('0x3'),'afterUpdate':_0xf914('0x4'),'afterDestroy':_0xf914('0x5')};function emitEvent(_0x1d9a1b){return function(_0x168dbc,_0x1ab35d,_0x2bc5e6){ChatInternalMessageEvents[_0xf914('0x6')](_0x1d9a1b+':'+_0x168dbc['id'],_0x168dbc);ChatInternalMessageEvents[_0xf914('0x6')](_0x1d9a1b,_0x168dbc);_0x2bc5e6(null);};}for(var e in events){if(events[_0xf914('0x7')](e)){var event=events[e];ChatInternalMessage[_0xf914('0x8')](e,emitEvent(event));}}module[_0xf914('0x9')]=ChatInternalMessageEvents;