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 _0x4e6e=['remove','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x4e6e,0x70));var _0xe4e6=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x4e6e[_0x2aec52];return _0x3b8835;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe4e6('0x0'))['db'][_0xe4e6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe4e6('0x2')](0x0);var events={'afterCreate':_0xe4e6('0x3'),'afterUpdate':_0xe4e6('0x4'),'afterDestroy':_0xe4e6('0x5')};function emitEvent(_0x13edeb){return function(_0x29c069,_0x11cb6f,_0x12c81c){ChatInternalMessageEvents['emit'](_0x13edeb+':'+_0x29c069['id'],_0x29c069);ChatInternalMessageEvents['emit'](_0x13edeb,_0x29c069);_0x12c81c(null);};}for(var e in events){if(events[_0xe4e6('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe4e6('0x7')](e,emitEvent(event));}}module[_0xe4e6('0x8')]=ChatInternalMessageEvents;