a525cfaf5429847cc60b56509e166a3c42529666
[motion2.git] / server / api / mailQueue / mailQueue.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x4ca4=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x11c9d4,_0x3d4daa){var _0x44e9a6=function(_0x532b90){while(--_0x532b90){_0x11c9d4['push'](_0x11c9d4['shift']());}};_0x44e9a6(++_0x3d4daa);}(_0x4ca4,0x17c));var _0x44ca=function(_0x5ace90,_0x2fc112){_0x5ace90=_0x5ace90-0x0;var _0x64e38c=_0x4ca4[_0x5ace90];return _0x64e38c;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x44ca('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x44ca('0x1')](0x0);var events={'afterCreate':_0x44ca('0x2'),'afterUpdate':_0x44ca('0x3'),'afterDestroy':_0x44ca('0x4')};function emitEvent(_0x431217){return function(_0x435ffd,_0x473da7,_0x1e64c5){MailQueueEvents[_0x44ca('0x5')](_0x431217+':'+_0x435ffd['id'],_0x435ffd);MailQueueEvents['emit'](_0x431217,_0x435ffd);_0x1e64c5(null);};}for(var e in events){if(events[_0x44ca('0x6')](e)){var event=events[e];MailQueue[_0x44ca('0x7')](e,emitEvent(event));}}module[_0x44ca('0x8')]=MailQueueEvents;