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 _0x1bfa=['emit','hasOwnProperty','hook','events','setMaxListeners','save','update','remove'];(function(_0x36d90a,_0x5b54ba){var _0x26b31f=function(_0x1f185f){while(--_0x1f185f){_0x36d90a['push'](_0x36d90a['shift']());}};_0x26b31f(++_0x5b54ba);}(_0x1bfa,0x19b));var _0xa1bf=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x1bfa[_0x61b3ab];return _0x57097f;};'use strict';var EventEmitter=require(_0xa1bf('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa1bf('0x1')](0x0);var events={'afterCreate':_0xa1bf('0x2'),'afterUpdate':_0xa1bf('0x3'),'afterDestroy':_0xa1bf('0x4')};function emitEvent(_0x5eeabd){return function(_0x42ecef,_0x550563,_0x13aa42){MailQueueEvents[_0xa1bf('0x5')](_0x5eeabd+':'+_0x42ecef['id'],_0x42ecef);MailQueueEvents[_0xa1bf('0x5')](_0x5eeabd,_0x42ecef);_0x13aa42(null);};}for(var e in events){if(events[_0xa1bf('0x6')](e)){var event=events[e];MailQueue[_0xa1bf('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;