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 _0x9f17=['exports','../../mysqldb','MailMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9f17,0x13c));var _0x79f1=function(_0x4875d9,_0x5b4ca7){_0x4875d9=_0x4875d9-0x0;var _0x13e0df=_0x9f17[_0x4875d9];return _0x13e0df;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x79f1('0x0'))['db'][_0x79f1('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x79f1('0x2')](0x0);var events={'afterCreate':_0x79f1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1590bb){return function(_0x3d671a,_0x36b221,_0x145174){MailMessageEvents['emit'](_0x1590bb+':'+_0x3d671a['id'],_0x3d671a);MailMessageEvents[_0x79f1('0x4')](_0x1590bb,_0x3d671a);_0x145174(null);};}for(var e in events){if(events[_0x79f1('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x79f1('0x6')]=MailMessageEvents;