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 _0x71f7=['hook','setMaxListeners','remove','emit'];(function(_0x3ddda7,_0x39eaf3){var _0x38f5b4=function(_0x49be31){while(--_0x49be31){_0x3ddda7['push'](_0x3ddda7['shift']());}};_0x38f5b4(++_0x39eaf3);}(_0x71f7,0x155));var _0x771f=function(_0x158e13,_0x23dbd5){_0x158e13=_0x158e13-0x0;var _0x1cda0b=_0x71f7[_0x158e13];return _0x1cda0b;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x771f('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x771f('0x1')};function emitEvent(_0x58a007){return function(_0x53e135,_0x35ad25,_0x4d0b8c){MailQueueEvents[_0x771f('0x2')](_0x58a007+':'+_0x53e135['id'],_0x53e135);MailQueueEvents[_0x771f('0x2')](_0x58a007,_0x53e135);_0x4d0b8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x771f('0x3')](e,emitEvent(event));}}module['exports']=MailQueueEvents;