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 _0x87a4=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5115e0,_0x253705){var _0x51607d=function(_0x28a0ba){while(--_0x28a0ba){_0x5115e0['push'](_0x5115e0['shift']());}};_0x51607d(++_0x253705);}(_0x87a4,0x120));var _0x487a=function(_0x9557d3,_0x8a27cd){_0x9557d3=_0x9557d3-0x0;var _0x2b6f64=_0x87a4[_0x9557d3];return _0x2b6f64;};'use strict';var EventEmitter=require(_0x487a('0x0'));var MailQueue=require(_0x487a('0x1'))['db'][_0x487a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x487a('0x3')](0x0);var events={'afterCreate':_0x487a('0x4'),'afterUpdate':_0x487a('0x5'),'afterDestroy':_0x487a('0x6')};function emitEvent(_0x5eae6d){return function(_0x3b3803,_0x2a63ac,_0x1eba6b){MailQueueEvents['emit'](_0x5eae6d+':'+_0x3b3803['id'],_0x3b3803);MailQueueEvents[_0x487a('0x7')](_0x5eae6d,_0x3b3803);_0x1eba6b(null);};}for(var e in events){if(events[_0x487a('0x8')](e)){var event=events[e];MailQueue[_0x487a('0x9')](e,emitEvent(event));}}module[_0x487a('0xa')]=MailQueueEvents;