Built motion from commit bab6f49e.|2.6.17
[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 _0xceef=['ChatGroup','setMaxListeners','update','emit','hook','exports'];(function(_0x1fc9a2,_0x5595f2){var _0x7ea5f3=function(_0x351e0e){while(--_0x351e0e){_0x1fc9a2['push'](_0x1fc9a2['shift']());}};_0x7ea5f3(++_0x5595f2);}(_0xceef,0xf6));var _0xfcee=function(_0x5d08e4,_0x1c1ba6){_0x5d08e4=_0x5d08e4-0x0;var _0x1c7d40=_0xceef[_0x5d08e4];return _0x1c7d40;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xfcee('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xfcee('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfcee('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3e58b0){return function(_0x216a76,_0x4eed34,_0x225f98){ChatGroupEvents[_0xfcee('0x3')](_0x3e58b0+':'+_0x216a76['id'],_0x216a76);ChatGroupEvents['emit'](_0x3e58b0,_0x216a76);_0x225f98(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xfcee('0x4')](e,emitEvent(event));}}module[_0xfcee('0x5')]=ChatGroupEvents;