bcfcc576d786561109ba9a92cc1f25842ce9028e
[motion2.git] / server / api / chatInternalMessage / chatInternalMessage.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 _0x9bbd=['emit','hasOwnProperty','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x2b6512,_0x13f30e){var _0x437e2b=function(_0x320267){while(--_0x320267){_0x2b6512['push'](_0x2b6512['shift']());}};_0x437e2b(++_0x13f30e);}(_0x9bbd,0x198));var _0xd9bb=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9bbd[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xd9bb('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd9bb('0x1')](0x0);var events={'afterCreate':_0xd9bb('0x2'),'afterUpdate':_0xd9bb('0x3'),'afterDestroy':_0xd9bb('0x4')};function emitEvent(_0xfbb10){return function(_0x1b989d,_0x416085,_0x2e808b){ChatInternalMessageEvents[_0xd9bb('0x5')](_0xfbb10+':'+_0x1b989d['id'],_0x1b989d);ChatInternalMessageEvents[_0xd9bb('0x5')](_0xfbb10,_0x1b989d);_0x2e808b(null);};}for(var e in events){if(events[_0xd9bb('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;