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 _0xdd73=['events','../../mysqldb','ChatOfflineMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xdd73,0x14a));var _0x3dd7=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0xdd73[_0x4fc80b];return _0x119dba;};'use strict';var EventEmitter=require(_0x3dd7('0x0'));var ChatOfflineMessage=require(_0x3dd7('0x1'))['db'][_0x3dd7('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3dd7('0x3'),'afterUpdate':_0x3dd7('0x4'),'afterDestroy':_0x3dd7('0x5')};function emitEvent(_0x31753b){return function(_0x527539,_0x45916f,_0x87da1e){ChatOfflineMessageEvents[_0x3dd7('0x6')](_0x31753b+':'+_0x527539['id'],_0x527539);ChatOfflineMessageEvents[_0x3dd7('0x6')](_0x31753b,_0x527539);_0x87da1e(null);};}for(var e in events){if(events[_0x3dd7('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x3dd7('0x8')](e,emitEvent(event));}}module[_0x3dd7('0x9')]=ChatOfflineMessageEvents;