Built motion from commit (unavailable).|2.5.21
[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 _0xaa1d=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5b03f0,_0xf386bc){var _0x55f3ab=function(_0x5cb366){while(--_0x5cb366){_0x5b03f0['push'](_0x5b03f0['shift']());}};_0x55f3ab(++_0xf386bc);}(_0xaa1d,0xcf));var _0xdaa1=function(_0x5e0fff,_0x203fe0){_0x5e0fff=_0x5e0fff-0x0;var _0x2748c0=_0xaa1d[_0x5e0fff];return _0x2748c0;};'use strict';var EventEmitter=require(_0xdaa1('0x0'));var MailQueue=require(_0xdaa1('0x1'))['db'][_0xdaa1('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xdaa1('0x3')](0x0);var events={'afterCreate':_0xdaa1('0x4'),'afterUpdate':_0xdaa1('0x5'),'afterDestroy':_0xdaa1('0x6')};function emitEvent(_0x5a921e){return function(_0x387041,_0xe33303,_0x1a7069){MailQueueEvents['emit'](_0x5a921e+':'+_0x387041['id'],_0x387041);MailQueueEvents[_0xdaa1('0x7')](_0x5a921e,_0x387041);_0x1a7069(null);};}for(var e in events){if(events[_0xdaa1('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents;