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 _0x59eb=['hook','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x668bb5,_0x5eae15){var _0x52ed91=function(_0x366e9b){while(--_0x366e9b){_0x668bb5['push'](_0x668bb5['shift']());}};_0x52ed91(++_0x5eae15);}(_0x59eb,0x1e1));var _0xb59e=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x59eb[_0x485b5a];return _0xd2b34d;};'use strict';var EventEmitter=require(_0xb59e('0x0'));var ChatInteraction=require(_0xb59e('0x1'))['db'][_0xb59e('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb59e('0x3')](0x0);var events={'afterCreate':_0xb59e('0x4'),'afterUpdate':_0xb59e('0x5'),'afterDestroy':_0xb59e('0x6')};function emitEvent(_0x3ec553){return function(_0x3eb95f,_0x1eda8c,_0x22a5b1){ChatInteractionEvents['emit'](_0x3ec553+':'+_0x3eb95f['id'],_0x3eb95f);ChatInteractionEvents[_0xb59e('0x7')](_0x3ec553,_0x3eb95f);_0x22a5b1(null);};}for(var e in events){if(events[_0xb59e('0x8')](e)){var event=events[e];ChatInteraction[_0xb59e('0x9')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;