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 _0xaa3f=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x2c765a,_0x129729){_0x2c765a=_0x2c765a-0x0;var _0x3570c1=_0xaa3f[_0x2c765a];return _0x3570c1;};'use strict';var EventEmitter=require(_0xfaa3('0x0'));var ChatOfflineMessage=require(_0xfaa3('0x1'))['db'][_0xfaa3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xfaa3('0x3')](0x0);var events={'afterCreate':_0xfaa3('0x4'),'afterUpdate':_0xfaa3('0x5'),'afterDestroy':_0xfaa3('0x6')};function emitEvent(_0x2b1aaf){return function(_0x32f4e1,_0x5123a3,_0x513eea){ChatOfflineMessageEvents[_0xfaa3('0x7')](_0x2b1aaf+':'+_0x32f4e1['id'],_0x32f4e1);ChatOfflineMessageEvents['emit'](_0x2b1aaf,_0x32f4e1);_0x513eea(null);};}for(var e in events){if(events[_0xfaa3('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xfaa3('0x9')](e,emitEvent(event));}}module[_0xfaa3('0xa')]=ChatOfflineMessageEvents;