Built motion from commit 58b0471d.|2.6.29
[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 _0x67ce=['hook','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x67ce,0xdd));var _0xe67c=function(_0x345901,_0x187c05){_0x345901=_0x345901-0x0;var _0xd4fd06=_0x67ce[_0x345901];return _0xd4fd06;};'use strict';var EventEmitter=require(_0xe67c('0x0'));var MailQueue=require(_0xe67c('0x1'))['db'][_0xe67c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe67c('0x3')](0x0);var events={'afterCreate':_0xe67c('0x4'),'afterUpdate':_0xe67c('0x5'),'afterDestroy':_0xe67c('0x6')};function emitEvent(_0x9cd88){return function(_0x211ff9,_0x539174,_0x142fc0){MailQueueEvents[_0xe67c('0x7')](_0x9cd88+':'+_0x211ff9['id'],_0x211ff9);MailQueueEvents[_0xe67c('0x7')](_0x9cd88,_0x211ff9);_0x142fc0(null);};}for(var e in events){if(events[_0xe67c('0x8')](e)){var event=events[e];MailQueue[_0xe67c('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents;