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 _0x20ec=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x20ec,0x12f));var _0xc20e=function(_0x2c0529,_0x5ec1ca){_0x2c0529=_0x2c0529-0x0;var _0x3d990f=_0x20ec[_0x2c0529];return _0x3d990f;};'use strict';var EventEmitter=require(_0xc20e('0x0'));var ChatInternalMessage=require(_0xc20e('0x1'))['db'][_0xc20e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc20e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc20e('0x4')};function emitEvent(_0x883cb7){return function(_0x249c75,_0x178122,_0x11c188){ChatInternalMessageEvents[_0xc20e('0x5')](_0x883cb7+':'+_0x249c75['id'],_0x249c75);ChatInternalMessageEvents[_0xc20e('0x5')](_0x883cb7,_0x249c75);_0x11c188(null);};}for(var e in events){if(events[_0xc20e('0x6')](e)){var event=events[e];ChatInternalMessage[_0xc20e('0x7')](e,emitEvent(event));}}module[_0xc20e('0x8')]=ChatInternalMessageEvents;