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 _0x3308=['hook','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x20ac35,_0x278bff){var _0x147230=function(_0xe5cc5c){while(--_0xe5cc5c){_0x20ac35['push'](_0x20ac35['shift']());}};_0x147230(++_0x278bff);}(_0x3308,0x12e));var _0x8330=function(_0x2ac6f6,_0x41fe18){_0x2ac6f6=_0x2ac6f6-0x0;var _0x52796b=_0x3308[_0x2ac6f6];return _0x52796b;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8330('0x0')](0x0);var events={'afterCreate':_0x8330('0x1'),'afterUpdate':_0x8330('0x2'),'afterDestroy':_0x8330('0x3')};function emitEvent(_0x508fce){return function(_0x5f52e6,_0x28d8af,_0x1e706f){ChatWebsiteEvents[_0x8330('0x4')](_0x508fce+':'+_0x5f52e6['id'],_0x5f52e6);ChatWebsiteEvents[_0x8330('0x4')](_0x508fce,_0x5f52e6);_0x1e706f(null);};}for(var e in events){if(events[_0x8330('0x5')](e)){var event=events[e];ChatWebsite[_0x8330('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;