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 _0xb28e=['emit','hasOwnProperty','hook','events','MailQueue','setMaxListeners','save','update'];(function(_0x47a371,_0x892e6a){var _0x50f139=function(_0x1d5556){while(--_0x1d5556){_0x47a371['push'](_0x47a371['shift']());}};_0x50f139(++_0x892e6a);}(_0xb28e,0x133));var _0xeb28=function(_0x169c09,_0x58cefe){_0x169c09=_0x169c09-0x0;var _0x245f3b=_0xb28e[_0x169c09];return _0x245f3b;};'use strict';var EventEmitter=require(_0xeb28('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xeb28('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xeb28('0x2')](0x0);var events={'afterCreate':_0xeb28('0x3'),'afterUpdate':_0xeb28('0x4'),'afterDestroy':'remove'};function emitEvent(_0x49dccd){return function(_0xbe4c11,_0x590149,_0x3684c2){MailQueueEvents[_0xeb28('0x5')](_0x49dccd+':'+_0xbe4c11['id'],_0xbe4c11);MailQueueEvents[_0xeb28('0x5')](_0x49dccd,_0xbe4c11);_0x3684c2(null);};}for(var e in events){if(events[_0xeb28('0x6')](e)){var event=events[e];MailQueue[_0xeb28('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;