Built motion from commit da617fac.|2.6.6
[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 _0x1c2f=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hook'];(function(_0x2feb93,_0x572c96){var _0x3254e2=function(_0x573dbd){while(--_0x573dbd){_0x2feb93['push'](_0x2feb93['shift']());}};_0x3254e2(++_0x572c96);}(_0x1c2f,0x1c3));var _0xf1c2=function(_0x526889,_0x3f9043){_0x526889=_0x526889-0x0;var _0x21ad5e=_0x1c2f[_0x526889];return _0x21ad5e;};'use strict';var EventEmitter=require(_0xf1c2('0x0'));var ChatGroup=require(_0xf1c2('0x1'))['db'][_0xf1c2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf1c2('0x3')](0x0);var events={'afterCreate':_0xf1c2('0x4'),'afterUpdate':_0xf1c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a5c9b){return function(_0x229abd,_0x1a0233,_0x296405){ChatGroupEvents['emit'](_0x2a5c9b+':'+_0x229abd['id'],_0x229abd);ChatGroupEvents[_0xf1c2('0x6')](_0x2a5c9b,_0x229abd);_0x296405(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf1c2('0x7')](e,emitEvent(event));}}module[_0xf1c2('0x8')]=ChatGroupEvents;