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 _0xc863=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x53038a,_0x5511e2){var _0x57a08c=function(_0x23b413){while(--_0x23b413){_0x53038a['push'](_0x53038a['shift']());}};_0x57a08c(++_0x5511e2);}(_0xc863,0x1ea));var _0x3c86=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xc863[_0x234ae1];return _0x227ba0;};'use strict';var EventEmitter=require(_0x3c86('0x0'));var ChatInternalMessage=require(_0x3c86('0x1'))['db'][_0x3c86('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c86('0x3'),'afterUpdate':_0x3c86('0x4'),'afterDestroy':_0x3c86('0x5')};function emitEvent(_0x34ff53){return function(_0x2df100,_0x215fcb,_0x588257){ChatInternalMessageEvents[_0x3c86('0x6')](_0x34ff53+':'+_0x2df100['id'],_0x2df100);ChatInternalMessageEvents['emit'](_0x34ff53,_0x2df100);_0x588257(null);};}for(var e in events){if(events[_0x3c86('0x7')](e)){var event=events[e];ChatInternalMessage[_0x3c86('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;