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 _0x4f99=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x7206d7,_0x66d125){var _0xe682f9=function(_0x572e25){while(--_0x572e25){_0x7206d7['push'](_0x7206d7['shift']());}};_0xe682f9(++_0x66d125);}(_0x4f99,0x157));var _0x94f9=function(_0x5bfbc4,_0xceeb1){_0x5bfbc4=_0x5bfbc4-0x0;var _0x1489d3=_0x4f99[_0x5bfbc4];return _0x1489d3;};'use strict';var EventEmitter=require(_0x94f9('0x0'));var ChatInternalMessage=require(_0x94f9('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x94f9('0x2')](0x0);var events={'afterCreate':_0x94f9('0x3'),'afterUpdate':_0x94f9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15ff7c){return function(_0x879bc2,_0x560634,_0x1b4831){ChatInternalMessageEvents[_0x94f9('0x5')](_0x15ff7c+':'+_0x879bc2['id'],_0x879bc2);ChatInternalMessageEvents[_0x94f9('0x5')](_0x15ff7c,_0x879bc2);_0x1b4831(null);};}for(var e in events){if(events[_0x94f9('0x6')](e)){var event=events[e];ChatInternalMessage[_0x94f9('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;