019229f2f5aa1666296dd6da502f91099467aed4
[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 _0xf110=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x46216e,_0x121aa6){var _0x21a004=function(_0x2c2772){while(--_0x2c2772){_0x46216e['push'](_0x46216e['shift']());}};_0x21a004(++_0x121aa6);}(_0xf110,0x134));var _0x0f11=function(_0x38d4ac,_0x19cf87){_0x38d4ac=_0x38d4ac-0x0;var _0x3497fb=_0xf110[_0x38d4ac];return _0x3497fb;};'use strict';var EventEmitter=require(_0x0f11('0x0'));var ChatInternalMessage=require(_0x0f11('0x1'))['db'][_0x0f11('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0f11('0x3')](0x0);var events={'afterCreate':_0x0f11('0x4'),'afterUpdate':_0x0f11('0x5'),'afterDestroy':_0x0f11('0x6')};function emitEvent(_0x1b1698){return function(_0x17090c,_0x2d99fc,_0x737dca){ChatInternalMessageEvents[_0x0f11('0x7')](_0x1b1698+':'+_0x17090c['id'],_0x17090c);ChatInternalMessageEvents[_0x0f11('0x7')](_0x1b1698,_0x17090c);_0x737dca(null);};}for(var e in events){if(events[_0x0f11('0x8')](e)){var event=events[e];ChatInternalMessage[_0x0f11('0x9')](e,emitEvent(event));}}module[_0x0f11('0xa')]=ChatInternalMessageEvents;