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 _0xe4cd=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','remove'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xe4cd,0x84));var _0xde4c=function(_0x24f664,_0x14dc5b){_0x24f664=_0x24f664-0x0;var _0x100986=_0xe4cd[_0x24f664];return _0x100986;};'use strict';var EventEmitter=require(_0xde4c('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xde4c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xde4c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xde4c('0x3')};function emitEvent(_0x390ebb){return function(_0x166526,_0x5d6596,_0x483947){ChatOfflineMessageEvents[_0xde4c('0x4')](_0x390ebb+':'+_0x166526['id'],_0x166526);ChatOfflineMessageEvents[_0xde4c('0x4')](_0x390ebb,_0x166526);_0x483947(null);};}for(var e in events){if(events[_0xde4c('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xde4c('0x6')](e,emitEvent(event));}}module[_0xde4c('0x7')]=ChatOfflineMessageEvents;