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 _0x5c1b=['events','../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x18586e,_0x29ebbb){var _0x1fd64d=function(_0x5058e4){while(--_0x5058e4){_0x18586e['push'](_0x18586e['shift']());}};_0x1fd64d(++_0x29ebbb);}(_0x5c1b,0x178));var _0xb5c1=function(_0x23dcc1,_0x59f1b7){_0x23dcc1=_0x23dcc1-0x0;var _0x581882=_0x5c1b[_0x23dcc1];return _0x581882;};'use strict';var EventEmitter=require(_0xb5c1('0x0'));var MailQueue=require(_0xb5c1('0x1'))['db'][_0xb5c1('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb5c1('0x3')](0x0);var events={'afterCreate':_0xb5c1('0x4'),'afterUpdate':'update','afterDestroy':_0xb5c1('0x5')};function emitEvent(_0x1e1a06){return function(_0x19a5e8,_0x7e2a27,_0x262b44){MailQueueEvents['emit'](_0x1e1a06+':'+_0x19a5e8['id'],_0x19a5e8);MailQueueEvents[_0xb5c1('0x6')](_0x1e1a06,_0x19a5e8);_0x262b44(null);};}for(var e in events){if(events[_0xb5c1('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents;