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 _0xfb96=['update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage','setMaxListeners'];(function(_0x5257b7,_0x4f42d6){var _0x5a8139=function(_0x4adfe2){while(--_0x4adfe2){_0x5257b7['push'](_0x5257b7['shift']());}};_0x5a8139(++_0x4f42d6);}(_0xfb96,0x17e));var _0x6fb9=function(_0x23d970,_0x469b14){_0x23d970=_0x23d970-0x0;var _0x178ccb=_0xfb96[_0x23d970];return _0x178ccb;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x6fb9('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6fb9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6fb9('0x2'),'afterDestroy':_0x6fb9('0x3')};function emitEvent(_0x481f51){return function(_0x27169e,_0x2e29b8,_0x146ed6){ChatInternalMessageEvents[_0x6fb9('0x4')](_0x481f51+':'+_0x27169e['id'],_0x27169e);ChatInternalMessageEvents['emit'](_0x481f51,_0x27169e);_0x146ed6(null);};}for(var e in events){if(events[_0x6fb9('0x5')](e)){var event=events[e];ChatInternalMessage[_0x6fb9('0x6')](e,emitEvent(event));}}module[_0x6fb9('0x7')]=ChatInternalMessageEvents;