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 _0xab3f=['save','update','remove','emit','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x3d1478,_0x3c9cb3){var _0x2b32d3=function(_0x5af15b){while(--_0x5af15b){_0x3d1478['push'](_0x3d1478['shift']());}};_0x2b32d3(++_0x3c9cb3);}(_0xab3f,0x72));var _0xfab3=function(_0x48af58,_0x27a297){_0x48af58=_0x48af58-0x0;var _0x55468d=_0xab3f[_0x48af58];return _0x55468d;};'use strict';var EventEmitter=require(_0xfab3('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xfab3('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfab3('0x2')](0x0);var events={'afterCreate':_0xfab3('0x3'),'afterUpdate':_0xfab3('0x4'),'afterDestroy':_0xfab3('0x5')};function emitEvent(_0x12c3ab){return function(_0x394308,_0x4387f8,_0x3e2de2){MailMessageEvents[_0xfab3('0x6')](_0x12c3ab+':'+_0x394308['id'],_0x394308);MailMessageEvents[_0xfab3('0x6')](_0x12c3ab,_0x394308);_0x3e2de2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xfab3('0x7')](e,emitEvent(event));}}module[_0xfab3('0x8')]=MailMessageEvents;