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 _0x4a25=['remove','emit','hasOwnProperty','exports','events','ChatInternalMessage','save','update'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x4a25,0x1d4));var _0x54a2=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0x4a25[_0x311666];return _0x2bc692;};'use strict';var EventEmitter=require(_0x54a2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x54a2('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54a2('0x2'),'afterUpdate':_0x54a2('0x3'),'afterDestroy':_0x54a2('0x4')};function emitEvent(_0x3e5d5b){return function(_0x5c6c1f,_0x3031e9,_0x15f81b){ChatInternalMessageEvents[_0x54a2('0x5')](_0x3e5d5b+':'+_0x5c6c1f['id'],_0x5c6c1f);ChatInternalMessageEvents[_0x54a2('0x5')](_0x3e5d5b,_0x5c6c1f);_0x15f81b(null);};}for(var e in events){if(events[_0x54a2('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x54a2('0x7')]=ChatInternalMessageEvents;