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 _0x8ae2=['hook','events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4c9821,_0x4611d8){var _0x48bd5e=function(_0x37f937){while(--_0x37f937){_0x4c9821['push'](_0x4c9821['shift']());}};_0x48bd5e(++_0x4611d8);}(_0x8ae2,0x143));var _0x28ae=function(_0x16546c,_0x172705){_0x16546c=_0x16546c-0x0;var _0x342df8=_0x8ae2[_0x16546c];return _0x342df8;};'use strict';var EventEmitter=require(_0x28ae('0x0'));var ChatGroup=require(_0x28ae('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x28ae('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x28ae('0x3'),'afterDestroy':'remove'};function emitEvent(_0xeb0ff2){return function(_0x30ced7,_0x402180,_0x4db371){ChatGroupEvents['emit'](_0xeb0ff2+':'+_0x30ced7['id'],_0x30ced7);ChatGroupEvents[_0x28ae('0x4')](_0xeb0ff2,_0x30ced7);_0x4db371(null);};}for(var e in events){if(events[_0x28ae('0x5')](e)){var event=events[e];ChatGroup[_0x28ae('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;