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 _0x03cc=['MailMessage','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0x03cc,0xda));var _0xc03c=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x03cc[_0x5f1391];return _0x50ebe3;};'use strict';var EventEmitter=require(_0xc03c('0x0'));var MailMessage=require(_0xc03c('0x1'))['db'][_0xc03c('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc03c('0x3')](0x0);var events={'afterCreate':_0xc03c('0x4'),'afterUpdate':_0xc03c('0x5'),'afterDestroy':_0xc03c('0x6')};function emitEvent(_0xe4b6fc){return function(_0x170283,_0x342174,_0x58578b){MailMessageEvents[_0xc03c('0x7')](_0xe4b6fc+':'+_0x170283['id'],_0x170283);MailMessageEvents[_0xc03c('0x7')](_0xe4b6fc,_0x170283);_0x58578b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xc03c('0x8')](e,emitEvent(event));}}module[_0xc03c('0x9')]=MailMessageEvents;