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 _0xe533=['events','../../mysqldb','setMaxListeners','remove','emit','hook','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe533,0x181));var _0x3e53=function(_0x549b9e,_0x4711fe){_0x549b9e=_0x549b9e-0x0;var _0x46857a=_0xe533[_0x549b9e];return _0x46857a;};'use strict';var EventEmitter=require(_0x3e53('0x0'));var ChatInternalMessage=require(_0x3e53('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3e53('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3e53('0x3')};function emitEvent(_0x297443){return function(_0x27111f,_0x156e9e,_0x4ee05c){ChatInternalMessageEvents[_0x3e53('0x4')](_0x297443+':'+_0x27111f['id'],_0x27111f);ChatInternalMessageEvents[_0x3e53('0x4')](_0x297443,_0x27111f);_0x4ee05c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x3e53('0x5')](e,emitEvent(event));}}module[_0x3e53('0x6')]=ChatInternalMessageEvents;