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 _0x4c02=['../../mysqldb','ChatMessage','remove','hasOwnProperty','hook'];(function(_0x5bded2,_0x1f3f68){var _0x3ed8e2=function(_0x340d7e){while(--_0x340d7e){_0x5bded2['push'](_0x5bded2['shift']());}};_0x3ed8e2(++_0x1f3f68);}(_0x4c02,0x1f4));var _0x24c0=function(_0x21c0de,_0x4a9720){_0x21c0de=_0x21c0de-0x0;var _0x32229e=_0x4c02[_0x21c0de];return _0x32229e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x24c0('0x0'))['db'][_0x24c0('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x24c0('0x2')};function emitEvent(_0x32ac54){return function(_0x21cfdc,_0x3c48c4,_0xaf85ed){ChatMessageEvents['emit'](_0x32ac54+':'+_0x21cfdc['id'],_0x21cfdc);ChatMessageEvents['emit'](_0x32ac54,_0x21cfdc);_0xaf85ed(null);};}for(var e in events){if(events[_0x24c0('0x3')](e)){var event=events[e];ChatMessage[_0x24c0('0x4')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;