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 _0x6e41=['setMaxListeners','save','update','emit','exports','ChatInteraction'];(function(_0x5aea96,_0xea1e08){var _0x2cb3f1=function(_0x25711f){while(--_0x25711f){_0x5aea96['push'](_0x5aea96['shift']());}};_0x2cb3f1(++_0xea1e08);}(_0x6e41,0xbf));var _0x16e4=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x6e41[_0x4e9d3c];return _0x2d0825;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x16e4('0x0')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x16e4('0x1')](0x0);var events={'afterCreate':_0x16e4('0x2'),'afterUpdate':_0x16e4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4f6472){return function(_0x29c21c,_0x42c439,_0x460c28){ChatInteractionEvents[_0x16e4('0x4')](_0x4f6472+':'+_0x29c21c['id'],_0x29c21c);ChatInteractionEvents[_0x16e4('0x4')](_0x4f6472,_0x29c21c);_0x460c28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x16e4('0x5')]=ChatInteractionEvents;