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 _0xc49f=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','remove'];(function(_0x4ffe20,_0x5c3ec8){var _0x1ee257=function(_0x332192){while(--_0x332192){_0x4ffe20['push'](_0x4ffe20['shift']());}};_0x1ee257(++_0x5c3ec8);}(_0xc49f,0x11b));var _0xfc49=function(_0x13940c,_0x4dc2a9){_0x13940c=_0x13940c-0x0;var _0x200095=_0xc49f[_0x13940c];return _0x200095;};'use strict';var EventEmitter=require(_0xfc49('0x0'));var ChatInternalMessage=require(_0xfc49('0x1'))['db'][_0xfc49('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfc49('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfc49('0x4')};function emitEvent(_0x3cfb0d){return function(_0x4094b5,_0x5865ff,_0xe7e2a6){ChatInternalMessageEvents['emit'](_0x3cfb0d+':'+_0x4094b5['id'],_0x4094b5);ChatInternalMessageEvents[_0xfc49('0x5')](_0x3cfb0d,_0x4094b5);_0xe7e2a6(null);};}for(var e in events){if(events[_0xfc49('0x6')](e)){var event=events[e];ChatInternalMessage[_0xfc49('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;