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 _0x56ce=['../../mysqldb','MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5066f2,_0x1c8314){var _0x3e98ca=function(_0x46a5d3){while(--_0x46a5d3){_0x5066f2['push'](_0x5066f2['shift']());}};_0x3e98ca(++_0x1c8314);}(_0x56ce,0xb0));var _0xe56c=function(_0x28f97a,_0x273459){_0x28f97a=_0x28f97a-0x0;var _0x599a15=_0x56ce[_0x28f97a];return _0x599a15;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xe56c('0x0'))['db'][_0xe56c('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe56c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe56c('0x3')};function emitEvent(_0x5de20d){return function(_0x1c0b9c,_0x3a0d7e,_0x216732){MailMessageEvents[_0xe56c('0x4')](_0x5de20d+':'+_0x1c0b9c['id'],_0x1c0b9c);MailMessageEvents[_0xe56c('0x4')](_0x5de20d,_0x1c0b9c);_0x216732(null);};}for(var e in events){if(events[_0xe56c('0x5')](e)){var event=events[e];MailMessage[_0xe56c('0x6')](e,emitEvent(event));}}module[_0xe56c('0x7')]=MailMessageEvents;