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 _0xa518=['emit','hook','exports','../../mysqldb','ChatOfflineMessage','save','update'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xa518,0x1f4));var _0x8a51=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0xa518[_0x2c9b79];return _0x265032;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x8a51('0x0'))['db'][_0x8a51('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8a51('0x2'),'afterUpdate':_0x8a51('0x3'),'afterDestroy':'remove'};function emitEvent(_0x52b851){return function(_0x4b6ae3,_0x47d378,_0x513bfc){ChatOfflineMessageEvents[_0x8a51('0x4')](_0x52b851+':'+_0x4b6ae3['id'],_0x4b6ae3);ChatOfflineMessageEvents[_0x8a51('0x4')](_0x52b851,_0x4b6ae3);_0x513bfc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x8a51('0x5')](e,emitEvent(event));}}module[_0x8a51('0x6')]=ChatOfflineMessageEvents;