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 _0x63c4=['update','remove','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x63c4,0x134));var _0x463c=function(_0x1325d9,_0x5222ed){_0x1325d9=_0x1325d9-0x0;var _0x4f4e4a=_0x63c4[_0x1325d9];return _0x4f4e4a;};'use strict';var EventEmitter=require(_0x463c('0x0'));var MailMessage=require(_0x463c('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x463c('0x2')](0x0);var events={'afterCreate':_0x463c('0x3'),'afterUpdate':_0x463c('0x4'),'afterDestroy':_0x463c('0x5')};function emitEvent(_0x32db58){return function(_0x57037f,_0x141f89,_0x3826c0){MailMessageEvents['emit'](_0x32db58+':'+_0x57037f['id'],_0x57037f);MailMessageEvents['emit'](_0x32db58,_0x57037f);_0x3826c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x463c('0x6')](e,emitEvent(event));}}module[_0x463c('0x7')]=MailMessageEvents;