5ece1cb93df48afcb17a7a4556606f945227b446
[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 _0x71bf=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x71bf,0x8e));var _0xf71b=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0x71bf[_0x3c38c7];return _0x4aa4b1;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xf71b('0x0'))['db'][_0xf71b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf71b('0x2')](0x0);var events={'afterCreate':_0xf71b('0x3'),'afterUpdate':_0xf71b('0x4'),'afterDestroy':_0xf71b('0x5')};function emitEvent(_0x4c5bb8){return function(_0x4614f9,_0x5d38b9,_0x3b877a){ChatInternalMessageEvents['emit'](_0x4c5bb8+':'+_0x4614f9['id'],_0x4614f9);ChatInternalMessageEvents['emit'](_0x4c5bb8,_0x4614f9);_0x3b877a(null);};}for(var e in events){if(events[_0xf71b('0x6')](e)){var event=events[e];ChatInternalMessage[_0xf71b('0x7')](e,emitEvent(event));}}module[_0xf71b('0x8')]=ChatInternalMessageEvents;