0ba99964feef302a4029ec16f7d2214f6b14b9ac
[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 _0xd98c=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x49aed9,_0x4a7b44){var _0x5c913e=function(_0x454bf7){while(--_0x454bf7){_0x49aed9['push'](_0x49aed9['shift']());}};_0x5c913e(++_0x4a7b44);}(_0xd98c,0xe3));var _0xcd98=function(_0x1f68e1,_0x206dc8){_0x1f68e1=_0x1f68e1-0x0;var _0x35d201=_0xd98c[_0x1f68e1];return _0x35d201;};'use strict';var EventEmitter=require(_0xcd98('0x0'));var ChatInternalMessage=require(_0xcd98('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcd98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd98('0x3'),'afterDestroy':_0xcd98('0x4')};function emitEvent(_0x2c4b4b){return function(_0x526bc9,_0x5c245c,_0x2c69b5){ChatInternalMessageEvents[_0xcd98('0x5')](_0x2c4b4b+':'+_0x526bc9['id'],_0x526bc9);ChatInternalMessageEvents['emit'](_0x2c4b4b,_0x526bc9);_0x2c69b5(null);};}for(var e in events){if(events[_0xcd98('0x6')](e)){var event=events[e];ChatInternalMessage[_0xcd98('0x7')](e,emitEvent(event));}}module[_0xcd98('0x8')]=ChatInternalMessageEvents;