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 _0x535f=['hook','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x1d7bcf,_0x3f0376){var _0x4fe730=function(_0x1984fc){while(--_0x1984fc){_0x1d7bcf['push'](_0x1d7bcf['shift']());}};_0x4fe730(++_0x3f0376);}(_0x535f,0x111));var _0xf535=function(_0xe59674,_0x28b7a5){_0xe59674=_0xe59674-0x0;var _0x6181ea=_0x535f[_0xe59674];return _0x6181ea;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xf535('0x0'))['db'][_0xf535('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf535('0x2'),'afterUpdate':_0xf535('0x3'),'afterDestroy':_0xf535('0x4')};function emitEvent(_0x19ec32){return function(_0x4ff0b3,_0xd1ee93,_0x24a323){ChatWebsiteEvents[_0xf535('0x5')](_0x19ec32+':'+_0x4ff0b3['id'],_0x4ff0b3);ChatWebsiteEvents[_0xf535('0x5')](_0x19ec32,_0x4ff0b3);_0x24a323(null);};}for(var e in events){if(events[_0xf535('0x6')](e)){var event=events[e];ChatWebsite[_0xf535('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;