Built motion from commit 14588770.|2.5.38
[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 _0xab78=['exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3102e6,_0x5e7c4a){var _0x22b325=function(_0x527c1b){while(--_0x527c1b){_0x3102e6['push'](_0x3102e6['shift']());}};_0x22b325(++_0x5e7c4a);}(_0xab78,0xe7));var _0x8ab7=function(_0x5d4efd,_0x884216){_0x5d4efd=_0x5d4efd-0x0;var _0x2ecd43=_0xab78[_0x5d4efd];return _0x2ecd43;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x8ab7('0x0'))['db'][_0x8ab7('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8ab7('0x2')](0x0);var events={'afterCreate':_0x8ab7('0x3'),'afterUpdate':_0x8ab7('0x4'),'afterDestroy':_0x8ab7('0x5')};function emitEvent(_0x162202){return function(_0x329c02,_0x2620c5,_0x3dc19a){MailQueueEvents[_0x8ab7('0x6')](_0x162202+':'+_0x329c02['id'],_0x329c02);MailQueueEvents[_0x8ab7('0x6')](_0x162202,_0x329c02);_0x3dc19a(null);};}for(var e in events){if(events[_0x8ab7('0x7')](e)){var event=events[e];MailQueue[_0x8ab7('0x8')](e,emitEvent(event));}}module[_0x8ab7('0x9')]=MailQueueEvents;