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 _0x7e56=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x319cae,_0x23efa1){var _0x44c9d6=function(_0x2559b2){while(--_0x2559b2){_0x319cae['push'](_0x319cae['shift']());}};_0x44c9d6(++_0x23efa1);}(_0x7e56,0x1aa));var _0x67e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e56[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x67e5('0x0'));var MailQueue=require(_0x67e5('0x1'))['db'][_0x67e5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x67e5('0x3')](0x0);var events={'afterCreate':_0x67e5('0x4'),'afterUpdate':_0x67e5('0x5'),'afterDestroy':_0x67e5('0x6')};function emitEvent(_0x1992e6){return function(_0xffba83,_0x3130c4,_0x1ba1b8){MailQueueEvents['emit'](_0x1992e6+':'+_0xffba83['id'],_0xffba83);MailQueueEvents[_0x67e5('0x7')](_0x1992e6,_0xffba83);_0x1ba1b8(null);};}for(var e in events){if(events[_0x67e5('0x8')](e)){var event=events[e];MailQueue[_0x67e5('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents;