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 _0xdebe=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x282fb7,_0x5a4048){var _0x5d03a0=function(_0x16a207){while(--_0x16a207){_0x282fb7['push'](_0x282fb7['shift']());}};_0x5d03a0(++_0x5a4048);}(_0xdebe,0x82));var _0xedeb=function(_0x4c8258,_0x3e1b49){_0x4c8258=_0x4c8258-0x0;var _0x2e9730=_0xdebe[_0x4c8258];return _0x2e9730;};'use strict';var EventEmitter=require(_0xedeb('0x0'));var MailQueue=require(_0xedeb('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xedeb('0x2')](0x0);var events={'afterCreate':_0xedeb('0x3'),'afterUpdate':_0xedeb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11a2ce){return function(_0x2697c8,_0x110a99,_0x49a7aa){MailQueueEvents[_0xedeb('0x5')](_0x11a2ce+':'+_0x2697c8['id'],_0x2697c8);MailQueueEvents[_0xedeb('0x5')](_0x11a2ce,_0x2697c8);_0x49a7aa(null);};}for(var e in events){if(events[_0xedeb('0x6')](e)){var event=events[e];MailQueue[_0xedeb('0x7')](e,emitEvent(event));}}module[_0xedeb('0x8')]=MailQueueEvents;