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 _0x18f8=['MailMessage','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0x18f8,0x103));var _0x818f=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x18f8[_0x44bcb0];return _0xfaf881;};'use strict';var EventEmitter=require(_0x818f('0x0'));var MailMessage=require(_0x818f('0x1'))['db'][_0x818f('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x818f('0x3'),'afterDestroy':_0x818f('0x4')};function emitEvent(_0x1a76b2){return function(_0x3fde88,_0x889350,_0x1c19f0){MailMessageEvents['emit'](_0x1a76b2+':'+_0x3fde88['id'],_0x3fde88);MailMessageEvents[_0x818f('0x5')](_0x1a76b2,_0x3fde88);_0x1c19f0(null);};}for(var e in events){if(events[_0x818f('0x6')](e)){var event=events[e];MailMessage[_0x818f('0x7')](e,emitEvent(event));}}module[_0x818f('0x8')]=MailMessageEvents;