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 _0xf518=['remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x5800a0,_0x2a0b06){var _0x58422a=function(_0x3d3e4a){while(--_0x3d3e4a){_0x5800a0['push'](_0x5800a0['shift']());}};_0x58422a(++_0x2a0b06);}(_0xf518,0xd4));var _0x8f51=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0xf518[_0x71e493];return _0x3d40ab;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x8f51('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8f51('0x1')](0x0);var events={'afterCreate':_0x8f51('0x2'),'afterUpdate':_0x8f51('0x3'),'afterDestroy':_0x8f51('0x4')};function emitEvent(_0x110007){return function(_0x2d9493,_0x385d10,_0x4fa230){ChatWebsiteEvents[_0x8f51('0x5')](_0x110007+':'+_0x2d9493['id'],_0x2d9493);ChatWebsiteEvents[_0x8f51('0x5')](_0x110007,_0x2d9493);_0x4fa230(null);};}for(var e in events){if(events[_0x8f51('0x6')](e)){var event=events[e];ChatWebsite[_0x8f51('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;