Built motion from commit (unavailable).|2.4.19
[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 _0xc95e=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1b8c7a,_0xa96078){var _0x2f18ca=function(_0x5681c0){while(--_0x5681c0){_0x1b8c7a['push'](_0x1b8c7a['shift']());}};_0x2f18ca(++_0xa96078);}(_0xc95e,0x14d));var _0xec95=function(_0x1a8b45,_0x5c85e0){_0x1a8b45=_0x1a8b45-0x0;var _0x1f7afc=_0xc95e[_0x1a8b45];return _0x1f7afc;};'use strict';var EventEmitter=require(_0xec95('0x0'));var ChatInternalMessage=require(_0xec95('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xec95('0x2')](0x0);var events={'afterCreate':_0xec95('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x567348){return function(_0x6874f1,_0x5b9fd8,_0x1a3871){ChatInternalMessageEvents['emit'](_0x567348+':'+_0x6874f1['id'],_0x6874f1);ChatInternalMessageEvents[_0xec95('0x4')](_0x567348,_0x6874f1);_0x1a3871(null);};}for(var e in events){if(events[_0xec95('0x5')](e)){var event=events[e];ChatInternalMessage[_0xec95('0x6')](e,emitEvent(event));}}module[_0xec95('0x7')]=ChatInternalMessageEvents;