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 _0x4c4e=['remove','emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x4c4e,0x152));var _0xe4c4=function(_0x272d75,_0x11c64f){_0x272d75=_0x272d75-0x0;var _0x1f81b5=_0x4c4e[_0x272d75];return _0x1f81b5;};'use strict';var EventEmitter=require(_0xe4c4('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xe4c4('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe4c4('0x2')](0x0);var events={'afterCreate':_0xe4c4('0x3'),'afterUpdate':'update','afterDestroy':_0xe4c4('0x4')};function emitEvent(_0x7d7655){return function(_0x1a4483,_0x4cd652,_0x2d3bb7){ChatInternalMessageEvents['emit'](_0x7d7655+':'+_0x1a4483['id'],_0x1a4483);ChatInternalMessageEvents[_0xe4c4('0x5')](_0x7d7655,_0x1a4483);_0x2d3bb7(null);};}for(var e in events){if(events[_0xe4c4('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe4c4('0x7')](e,emitEvent(event));}}module[_0xe4c4('0x8')]=ChatInternalMessageEvents;