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 _0x1e75=['update','emit','hasOwnProperty','exports','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1e75,0x8c));var _0x51e7=function(_0x11892d,_0x163e1a){_0x11892d=_0x11892d-0x0;var _0x3dbc66=_0x1e75[_0x11892d];return _0x3dbc66;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x51e7('0x0'))['db'][_0x51e7('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x51e7('0x2')](0x0);var events={'afterCreate':_0x51e7('0x3'),'afterUpdate':_0x51e7('0x4'),'afterDestroy':'remove'};function emitEvent(_0xfbe65e){return function(_0x5e0500,_0x72321f,_0x415afc){MailQueueEvents[_0x51e7('0x5')](_0xfbe65e+':'+_0x5e0500['id'],_0x5e0500);MailQueueEvents[_0x51e7('0x5')](_0xfbe65e,_0x5e0500);_0x415afc(null);};}for(var e in events){if(events[_0x51e7('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x51e7('0x7')]=MailQueueEvents;