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 _0x4e4c=['update','remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x416f26,_0x59684d){var _0x2de305=function(_0x381ffe){while(--_0x381ffe){_0x416f26['push'](_0x416f26['shift']());}};_0x2de305(++_0x59684d);}(_0x4e4c,0x176));var _0xc4e4=function(_0x22c50b,_0x753061){_0x22c50b=_0x22c50b-0x0;var _0x4220c5=_0x4e4c[_0x22c50b];return _0x4220c5;};'use strict';var EventEmitter=require(_0xc4e4('0x0'));var ChatInternalMessage=require(_0xc4e4('0x1'))['db'][_0xc4e4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc4e4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc4e4('0x4'),'afterDestroy':_0xc4e4('0x5')};function emitEvent(_0x160e6c){return function(_0x544e91,_0x28fd96,_0x5a94ce){ChatInternalMessageEvents[_0xc4e4('0x6')](_0x160e6c+':'+_0x544e91['id'],_0x544e91);ChatInternalMessageEvents[_0xc4e4('0x6')](_0x160e6c,_0x544e91);_0x5a94ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc4e4('0x7')](e,emitEvent(event));}}module[_0xc4e4('0x8')]=ChatInternalMessageEvents;