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 _0x7e08=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x219a12,_0x1e70c2){var _0x3a5a0b=function(_0x32ae6e){while(--_0x32ae6e){_0x219a12['push'](_0x219a12['shift']());}};_0x3a5a0b(++_0x1e70c2);}(_0x7e08,0xb3));var _0x87e0=function(_0xed9e57,_0x2d8ac8){_0xed9e57=_0xed9e57-0x0;var _0x4c4190=_0x7e08[_0xed9e57];return _0x4c4190;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x87e0('0x0'))['db'][_0x87e0('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x87e0('0x2')](0x0);var events={'afterCreate':_0x87e0('0x3'),'afterUpdate':_0x87e0('0x4'),'afterDestroy':_0x87e0('0x5')};function emitEvent(_0x50ab34){return function(_0x19560c,_0x28a7a5,_0x30a7dd){MailQueueEvents['emit'](_0x50ab34+':'+_0x19560c['id'],_0x19560c);MailQueueEvents[_0x87e0('0x6')](_0x50ab34,_0x19560c);_0x30a7dd(null);};}for(var e in events){if(events[_0x87e0('0x7')](e)){var event=events[e];MailQueue[_0x87e0('0x8')](e,emitEvent(event));}}module[_0x87e0('0x9')]=MailQueueEvents;