Built motion from commit (unavailable).|2.5.13
[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 _0xbe3e=['exports','MailQueue','setMaxListeners','save','update','emit','hook'];(function(_0x593230,_0x3efd13){var _0x2bf310=function(_0x5cf5c4){while(--_0x5cf5c4){_0x593230['push'](_0x593230['shift']());}};_0x2bf310(++_0x3efd13);}(_0xbe3e,0xd3));var _0xebe3=function(_0x49926e,_0x31bf24){_0x49926e=_0x49926e-0x0;var _0xfdbb1f=_0xbe3e[_0x49926e];return _0xfdbb1f;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xebe3('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xebe3('0x1')](0x0);var events={'afterCreate':_0xebe3('0x2'),'afterUpdate':_0xebe3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6010c8){return function(_0x5a2b34,_0x3908db,_0x3b53bd){MailQueueEvents['emit'](_0x6010c8+':'+_0x5a2b34['id'],_0x5a2b34);MailQueueEvents[_0xebe3('0x4')](_0x6010c8,_0x5a2b34);_0x3b53bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xebe3('0x5')](e,emitEvent(event));}}module[_0xebe3('0x6')]=MailQueueEvents;