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 _0x2c18=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x2c18,0x177));var _0x82c1=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0x2c18[_0x134192];return _0x3cd080;};'use strict';var EventEmitter=require(_0x82c1('0x0'));var MailQueue=require(_0x82c1('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x82c1('0x2')](0x0);var events={'afterCreate':_0x82c1('0x3'),'afterUpdate':_0x82c1('0x4'),'afterDestroy':_0x82c1('0x5')};function emitEvent(_0x36735f){return function(_0x5183ed,_0x5b76a0,_0x5899d9){MailQueueEvents[_0x82c1('0x6')](_0x36735f+':'+_0x5183ed['id'],_0x5183ed);MailQueueEvents[_0x82c1('0x6')](_0x36735f,_0x5183ed);_0x5899d9(null);};}for(var e in events){if(events[_0x82c1('0x7')](e)){var event=events[e];MailQueue[_0x82c1('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents;