46972afeec03ca93cd4a3655b9f5be3b2029ddb8
[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 _0xd34e=['hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0x54f7c0,_0x27af83){var _0x245d03=function(_0x1ad6c4){while(--_0x1ad6c4){_0x54f7c0['push'](_0x54f7c0['shift']());}};_0x245d03(++_0x27af83);}(_0xd34e,0x1d6));var _0xed34=function(_0x10e957,_0x2fb59d){_0x10e957=_0x10e957-0x0;var _0x45f990=_0xd34e[_0x10e957];return _0x45f990;};'use strict';var EventEmitter=require(_0xed34('0x0'));var ChatInternalMessage=require(_0xed34('0x1'))['db'][_0xed34('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xed34('0x3')](0x0);var events={'afterCreate':_0xed34('0x4'),'afterUpdate':_0xed34('0x5'),'afterDestroy':'remove'};function emitEvent(_0x172df5){return function(_0x26a1c5,_0x54b1bc,_0xf02b9e){ChatInternalMessageEvents[_0xed34('0x6')](_0x172df5+':'+_0x26a1c5['id'],_0x26a1c5);ChatInternalMessageEvents[_0xed34('0x6')](_0x172df5,_0x26a1c5);_0xf02b9e(null);};}for(var e in events){if(events[_0xed34('0x7')](e)){var event=events[e];ChatInternalMessage[_0xed34('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;