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 _0xdb4b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x4494bd,_0x5d4c66){_0x4494bd=_0x4494bd-0x0;var _0x49ede9=_0xdb4b[_0x4494bd];return _0x49ede9;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xbdb4('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbdb4('0x1')](0x0);var events={'afterCreate':_0xbdb4('0x2'),'afterUpdate':_0xbdb4('0x3'),'afterDestroy':_0xbdb4('0x4')};function emitEvent(_0x47a78c){return function(_0x3cc8c2,_0x40e5ca,_0x6c86d4){ChatWebsiteEvents[_0xbdb4('0x5')](_0x47a78c+':'+_0x3cc8c2['id'],_0x3cc8c2);ChatWebsiteEvents[_0xbdb4('0x5')](_0x47a78c,_0x3cc8c2);_0x6c86d4(null);};}for(var e in events){if(events[_0xbdb4('0x6')](e)){var event=events[e];ChatWebsite[_0xbdb4('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;