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 _0x0c4f=['hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0c4f,0x6f));var _0xf0c4=function(_0x106214,_0x454b8d){_0x106214=_0x106214-0x0;var _0x5f5cea=_0x0c4f[_0x106214];return _0x5f5cea;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xf0c4('0x0'))['db'][_0xf0c4('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf0c4('0x2')](0x0);var events={'afterCreate':_0xf0c4('0x3'),'afterUpdate':_0xf0c4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2958d7){return function(_0x26ebe7,_0x94bd1b,_0x413a7a){MailMessageEvents[_0xf0c4('0x5')](_0x2958d7+':'+_0x26ebe7['id'],_0x26ebe7);MailMessageEvents[_0xf0c4('0x5')](_0x2958d7,_0x26ebe7);_0x413a7a(null);};}for(var e in events){if(events[_0xf0c4('0x6')](e)){var event=events[e];MailMessage[_0xf0c4('0x7')](e,emitEvent(event));}}module[_0xf0c4('0x8')]=MailMessageEvents;