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 _0x5db2=['events','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x385962,_0x5670d2){var _0x332b58=function(_0x5cb34f){while(--_0x5cb34f){_0x385962['push'](_0x385962['shift']());}};_0x332b58(++_0x5670d2);}(_0x5db2,0xf3));var _0x25db=function(_0x4416f4,_0x5c538a){_0x4416f4=_0x4416f4-0x0;var _0x33280f=_0x5db2[_0x4416f4];return _0x33280f;};'use strict';var EventEmitter=require(_0x25db('0x0'));var ChatInternalMessage=require(_0x25db('0x1'))['db'][_0x25db('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25db('0x3'),'afterUpdate':_0x25db('0x4'),'afterDestroy':_0x25db('0x5')};function emitEvent(_0x10ff30){return function(_0x201231,_0xefcecd,_0x40e4bc){ChatInternalMessageEvents[_0x25db('0x6')](_0x10ff30+':'+_0x201231['id'],_0x201231);ChatInternalMessageEvents[_0x25db('0x6')](_0x10ff30,_0x201231);_0x40e4bc(null);};}for(var e in events){if(events[_0x25db('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x25db('0x8')]=ChatInternalMessageEvents;