Built motion from commit (unavailable).|2.5.10
[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 _0xbbf0=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save'];(function(_0x5e9a29,_0x563ab3){var _0x369038=function(_0x269276){while(--_0x269276){_0x5e9a29['push'](_0x5e9a29['shift']());}};_0x369038(++_0x563ab3);}(_0xbbf0,0x141));var _0x0bbf=function(_0x5eea86,_0x15b803){_0x5eea86=_0x5eea86-0x0;var _0x47fd0e=_0xbbf0[_0x5eea86];return _0x47fd0e;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x0bbf('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0bbf('0x1')](0x0);var events={'afterCreate':_0x0bbf('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x313a2c){return function(_0x16f2ee,_0x3c1b7a,_0x30e155){MailQueueEvents[_0x0bbf('0x3')](_0x313a2c+':'+_0x16f2ee['id'],_0x16f2ee);MailQueueEvents['emit'](_0x313a2c,_0x16f2ee);_0x30e155(null);};}for(var e in events){if(events[_0x0bbf('0x4')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x0bbf('0x5')]=MailQueueEvents;