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 _0xf277=['hook','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x425f52,_0xa6d6ba){var _0x3c437e=function(_0x59edab){while(--_0x59edab){_0x425f52['push'](_0x425f52['shift']());}};_0x3c437e(++_0xa6d6ba);}(_0xf277,0x1e1));var _0x7f27=function(_0x28dd45,_0x2abfa0){_0x28dd45=_0x28dd45-0x0;var _0x4c8525=_0xf277[_0x28dd45];return _0x4c8525;};'use strict';var EventEmitter=require(_0x7f27('0x0'));var ChatGroup=require(_0x7f27('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7f27('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f27('0x3'),'afterDestroy':_0x7f27('0x4')};function emitEvent(_0x2a861c){return function(_0x23f63b,_0x490cb8,_0x5121fb){ChatGroupEvents[_0x7f27('0x5')](_0x2a861c+':'+_0x23f63b['id'],_0x23f63b);ChatGroupEvents['emit'](_0x2a861c,_0x23f63b);_0x5121fb(null);};}for(var e in events){if(events[_0x7f27('0x6')](e)){var event=events[e];ChatGroup[_0x7f27('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;