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 _0xf567=['events','../../mysqldb','ChatGroup','save','update','emit','hasOwnProperty','hook'];(function(_0x235200,_0x3a1e32){var _0x121583=function(_0x154c9d){while(--_0x154c9d){_0x235200['push'](_0x235200['shift']());}};_0x121583(++_0x3a1e32);}(_0xf567,0x118));var _0x7f56=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf567[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x7f56('0x0'));var ChatGroup=require(_0x7f56('0x1'))['db'][_0x7f56('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7f56('0x3'),'afterUpdate':_0x7f56('0x4'),'afterDestroy':'remove'};function emitEvent(_0x548b5b){return function(_0x26ecb0,_0x271ddb,_0xe30bba){ChatGroupEvents['emit'](_0x548b5b+':'+_0x26ecb0['id'],_0x26ecb0);ChatGroupEvents[_0x7f56('0x5')](_0x548b5b,_0x26ecb0);_0xe30bba(null);};}for(var e in events){if(events[_0x7f56('0x6')](e)){var event=events[e];ChatGroup[_0x7f56('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;