1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xd2b2=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update'];(function(_0x2703b4,_0x327991){var _0x394cdf=function(_0x23c129){while(--_0x23c129){_0x2703b4['push'](_0x2703b4['shift']());}};_0x394cdf(++_0x327991);}(_0xd2b2,0x1ab));var _0x2d2b=function(_0x44d461,_0xb9f49f){_0x44d461=_0x44d461-0x0;var _0x7d5162=_0xd2b2[_0x44d461];return _0x7d5162;};'use strict';var EventEmitter=require(_0x2d2b('0x0'));var ChatInternalMessage=require(_0x2d2b('0x1'))['db'][_0x2d2b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2d2b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d2b('0x4'),'afterDestroy':_0x2d2b('0x5')};function emitEvent(_0x306d32){return function(_0x3c4b86,_0x30ee14,_0x4f6150){ChatInternalMessageEvents['emit'](_0x306d32+':'+_0x3c4b86['id'],_0x3c4b86);ChatInternalMessageEvents[_0x2d2b('0x6')](_0x306d32,_0x3c4b86);_0x4f6150(null);};}for(var e in events){if(events[_0x2d2b('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x2d2b('0x8')]=ChatInternalMessageEvents;