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 _0xfc35=['ChatMessage','setMaxListeners','save','remove','emit','exports','events','../../mysqldb'];(function(_0x301ea6,_0x202cf3){var _0x3bd1ae=function(_0xc27c01){while(--_0xc27c01){_0x301ea6['push'](_0x301ea6['shift']());}};_0x3bd1ae(++_0x202cf3);}(_0xfc35,0x146));var _0x5fc3=function(_0x3958fc,_0x2b42cd){_0x3958fc=_0x3958fc-0x0;var _0x28fd60=_0xfc35[_0x3958fc];return _0x28fd60;};'use strict';var EventEmitter=require(_0x5fc3('0x0'));var ChatMessage=require(_0x5fc3('0x1'))['db'][_0x5fc3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5fc3('0x3')](0x0);var events={'afterCreate':_0x5fc3('0x4'),'afterUpdate':'update','afterDestroy':_0x5fc3('0x5')};function emitEvent(_0x3d0b03){return function(_0x16ca3d,_0x5343cc,_0x12a790){ChatMessageEvents[_0x5fc3('0x6')](_0x3d0b03+':'+_0x16ca3d['id'],_0x16ca3d);ChatMessageEvents['emit'](_0x3d0b03,_0x16ca3d);_0x12a790(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5fc3('0x7')]=ChatMessageEvents;