Built motion from commit 96f8de6d.|2.6.3
[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 _0x3c91=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatGroup'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x3c91,0x1af));var _0x13c9=function(_0x2105ed,_0x3d8ea2){_0x2105ed=_0x2105ed-0x0;var _0x8371e1=_0x3c91[_0x2105ed];return _0x8371e1;};'use strict';var EventEmitter=require(_0x13c9('0x0'));var ChatGroup=require(_0x13c9('0x1'))['db'][_0x13c9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x13c9('0x3'),'afterDestroy':_0x13c9('0x4')};function emitEvent(_0x3e955c){return function(_0x4eec3a,_0x305980,_0x45854a){ChatGroupEvents[_0x13c9('0x5')](_0x3e955c+':'+_0x4eec3a['id'],_0x4eec3a);ChatGroupEvents[_0x13c9('0x5')](_0x3e955c,_0x4eec3a);_0x45854a(null);};}for(var e in events){if(events[_0x13c9('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;