Built motion from commit ddca4d0d.|2.5.47
[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 _0xe3cd=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xe3cd,0x1e0));var _0xde3c=function(_0x119cc6,_0x251543){_0x119cc6=_0x119cc6-0x0;var _0x502c2f=_0xe3cd[_0x119cc6];return _0x502c2f;};'use strict';var EventEmitter=require(_0xde3c('0x0'));var ChatGroup=require(_0xde3c('0x1'))['db'][_0xde3c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xde3c('0x3')};function emitEvent(_0x3efe6c){return function(_0xa5918c,_0x215a40,_0x120d61){ChatGroupEvents['emit'](_0x3efe6c+':'+_0xa5918c['id'],_0xa5918c);ChatGroupEvents[_0xde3c('0x4')](_0x3efe6c,_0xa5918c);_0x120d61(null);};}for(var e in events){if(events[_0xde3c('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xde3c('0x6')]=ChatGroupEvents;