Built motion from commit (unavailable).|2.5.4
[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 _0xcee8=['hasOwnProperty','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0x3e5325,_0x55af33){var _0x5a1c63=function(_0x545694){while(--_0x545694){_0x3e5325['push'](_0x3e5325['shift']());}};_0x5a1c63(++_0x55af33);}(_0xcee8,0xb1));var _0x8cee=function(_0x174c20,_0x474b2){_0x174c20=_0x174c20-0x0;var _0x5ecaec=_0xcee8[_0x174c20];return _0x5ecaec;};'use strict';var EventEmitter=require(_0x8cee('0x0'));var ChatInternalMessage=require(_0x8cee('0x1'))['db'][_0x8cee('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8cee('0x3')](0x0);var events={'afterCreate':_0x8cee('0x4'),'afterUpdate':_0x8cee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x127360){return function(_0x4e4143,_0xffd42d,_0x1ec415){ChatInternalMessageEvents['emit'](_0x127360+':'+_0x4e4143['id'],_0x4e4143);ChatInternalMessageEvents[_0x8cee('0x6')](_0x127360,_0x4e4143);_0x1ec415(null);};}for(var e in events){if(events[_0x8cee('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;