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 _0xbcc1=['MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x67b075,_0x43557d){var _0x39d030=function(_0x4f25e1){while(--_0x4f25e1){_0x67b075['push'](_0x67b075['shift']());}};_0x39d030(++_0x43557d);}(_0xbcc1,0x7d));var _0x1bcc=function(_0x2590fc,_0x5950b1){_0x2590fc=_0x2590fc-0x0;var _0x31aef1=_0xbcc1[_0x2590fc];return _0x31aef1;};'use strict';var EventEmitter=require(_0x1bcc('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x1bcc('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1bcc('0x2')](0x0);var events={'afterCreate':_0x1bcc('0x3'),'afterUpdate':_0x1bcc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f5d89){return function(_0x1d6361,_0x120441,_0x52d896){MailMessageEvents[_0x1bcc('0x5')](_0x2f5d89+':'+_0x1d6361['id'],_0x1d6361);MailMessageEvents[_0x1bcc('0x5')](_0x2f5d89,_0x1d6361);_0x52d896(null);};}for(var e in events){if(events[_0x1bcc('0x6')](e)){var event=events[e];MailMessage[_0x1bcc('0x7')](e,emitEvent(event));}}module[_0x1bcc('0x8')]=MailMessageEvents;