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 _0xdfb3=['emit','exports','../../mysqldb','remove'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0xdfb3,0xe2));var _0x3dfb=function(_0x5c9865,_0x1a299a){_0x5c9865=_0x5c9865-0x0;var _0x54c22b=_0xdfb3[_0x5c9865];return _0x54c22b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3dfb('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3dfb('0x1')};function emitEvent(_0x12dae5){return function(_0x4e17dc,_0xbcad90,_0x3297dd){ChatInternalMessageEvents[_0x3dfb('0x2')](_0x12dae5+':'+_0x4e17dc['id'],_0x4e17dc);ChatInternalMessageEvents[_0x3dfb('0x2')](_0x12dae5,_0x4e17dc);_0x3297dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3dfb('0x3')]=ChatInternalMessageEvents;