eed9b9541eeba2469e23f99ebb6cb6f290ab3e2f
[motion2.git] / server / api / chatGroup / chatGroup.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xd397=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd397,0x113));var _0x7d39=function(_0x1f76bc,_0x1e5e8b){_0x1f76bc=_0x1f76bc-0x0;var _0x4d2ef3=_0xd397[_0x1f76bc];return _0x4d2ef3;};'use strict';var EventEmitter=require(_0x7d39('0x0'));var ChatGroup=require(_0x7d39('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7d39('0x2')](0x0);var events={'afterCreate':_0x7d39('0x3'),'afterUpdate':_0x7d39('0x4'),'afterDestroy':_0x7d39('0x5')};function emitEvent(_0x5ac116){return function(_0x36487d,_0x49d2de,_0x13aafc){ChatGroupEvents[_0x7d39('0x6')](_0x5ac116+':'+_0x36487d['id'],_0x36487d);ChatGroupEvents[_0x7d39('0x6')](_0x5ac116,_0x36487d);_0x13aafc(null);};}for(var e in events){if(events[_0x7d39('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x7d39('0x8')]=ChatGroupEvents;