617749c3791a20a00602e8ccc720dce86de3f73b
[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 _0x4d1f=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5421eb,_0x426220){var _0x2a23e5=function(_0x565bc2){while(--_0x565bc2){_0x5421eb['push'](_0x5421eb['shift']());}};_0x2a23e5(++_0x426220);}(_0x4d1f,0x141));var _0xf4d1=function(_0x377899,_0xd248ce){_0x377899=_0x377899-0x0;var _0x3a494b=_0x4d1f[_0x377899];return _0x3a494b;};'use strict';var EventEmitter=require(_0xf4d1('0x0'));var ChatInternalMessage=require(_0xf4d1('0x1'))['db'][_0xf4d1('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf4d1('0x3')](0x0);var events={'afterCreate':_0xf4d1('0x4'),'afterUpdate':_0xf4d1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4edab4){return function(_0x1f04b3,_0x506c1c,_0xc4a5c3){ChatInternalMessageEvents['emit'](_0x4edab4+':'+_0x1f04b3['id'],_0x1f04b3);ChatInternalMessageEvents[_0xf4d1('0x6')](_0x4edab4,_0x1f04b3);_0xc4a5c3(null);};}for(var e in events){if(events[_0xf4d1('0x7')](e)){var event=events[e];ChatInternalMessage[_0xf4d1('0x8')](e,emitEvent(event));}}module[_0xf4d1('0x9')]=ChatInternalMessageEvents;