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 _0x08e2=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08e2,0x8c));var _0x208e=function(_0x5a0bec,_0x21786c){_0x5a0bec=_0x5a0bec-0x0;var _0xa577a8=_0x08e2[_0x5a0bec];return _0xa577a8;};'use strict';var EventEmitter=require(_0x208e('0x0'));var ChatGroup=require(_0x208e('0x1'))['db'][_0x208e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x208e('0x3')](0x0);var events={'afterCreate':_0x208e('0x4'),'afterUpdate':'update','afterDestroy':_0x208e('0x5')};function emitEvent(_0x2f960c){return function(_0x19e7a4,_0x925327,_0x13411f){ChatGroupEvents[_0x208e('0x6')](_0x2f960c+':'+_0x19e7a4['id'],_0x19e7a4);ChatGroupEvents[_0x208e('0x6')](_0x2f960c,_0x19e7a4);_0x13411f(null);};}for(var e in events){if(events[_0x208e('0x7')](e)){var event=events[e];ChatGroup[_0x208e('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;