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 _0x6e71=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e71,0xec));var _0x16e7=function(_0x5a33c6,_0x42c547){_0x5a33c6=_0x5a33c6-0x0;var _0x3d55b9=_0x6e71[_0x5a33c6];return _0x3d55b9;};'use strict';var EventEmitter=require(_0x16e7('0x0'));var MailQueue=require(_0x16e7('0x1'))['db'][_0x16e7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x16e7('0x3')](0x0);var events={'afterCreate':_0x16e7('0x4'),'afterUpdate':_0x16e7('0x5'),'afterDestroy':_0x16e7('0x6')};function emitEvent(_0x12627c){return function(_0x5cd765,_0x50e3bc,_0x47cf99){MailQueueEvents[_0x16e7('0x7')](_0x12627c+':'+_0x5cd765['id'],_0x5cd765);MailQueueEvents[_0x16e7('0x7')](_0x12627c,_0x5cd765);_0x47cf99(null);};}for(var e in events){if(events[_0x16e7('0x8')](e)){var event=events[e];MailQueue[_0x16e7('0x9')](e,emitEvent(event));}}module[_0x16e7('0xa')]=MailQueueEvents;