f3d6773e7dd6474db147e6d045ff3f462b159477
[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 _0x05de=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x19dc82,_0x26e762){var _0xfa8836=function(_0x4f5f49){while(--_0x4f5f49){_0x19dc82['push'](_0x19dc82['shift']());}};_0xfa8836(++_0x26e762);}(_0x05de,0xe3));var _0xe05d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x05de[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0xe05d('0x0'));var ChatInternalMessage=require(_0xe05d('0x1'))['db'][_0xe05d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe05d('0x3')](0x0);var events={'afterCreate':_0xe05d('0x4'),'afterUpdate':'update','afterDestroy':_0xe05d('0x5')};function emitEvent(_0x2a1b70){return function(_0x54973d,_0x6356e5,_0x455301){ChatInternalMessageEvents['emit'](_0x2a1b70+':'+_0x54973d['id'],_0x54973d);ChatInternalMessageEvents[_0xe05d('0x6')](_0x2a1b70,_0x54973d);_0x455301(null);};}for(var e in events){if(events[_0xe05d('0x7')](e)){var event=events[e];ChatInternalMessage[_0xe05d('0x8')](e,emitEvent(event));}}module[_0xe05d('0x9')]=ChatInternalMessageEvents;