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 _0x95b5=['ChatInternalMessage','emit','events'];(function(_0x31257f,_0x2cde2f){var _0x4dfd9c=function(_0x14eee2){while(--_0x14eee2){_0x31257f['push'](_0x31257f['shift']());}};_0x4dfd9c(++_0x2cde2f);}(_0x95b5,0x143));var _0x595b=function(_0x42eb51,_0xafa7f2){_0x42eb51=_0x42eb51-0x0;var _0x403569=_0x95b5[_0x42eb51];return _0x403569;};'use strict';var EventEmitter=require(_0x595b('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x595b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x51d0e0){return function(_0x4cb5e0,_0x2ed85e,_0x2fc380){ChatInternalMessageEvents[_0x595b('0x2')](_0x51d0e0+':'+_0x4cb5e0['id'],_0x4cb5e0);ChatInternalMessageEvents[_0x595b('0x2')](_0x51d0e0,_0x4cb5e0);_0x2fc380(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;