Built motion from commit 3c2ce842.|2.6.31
[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 _0x448e=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x32b50a,_0x435ae9){var _0x3d9c2e=function(_0x3b6c4b){while(--_0x3b6c4b){_0x32b50a['push'](_0x32b50a['shift']());}};_0x3d9c2e(++_0x435ae9);}(_0x448e,0x88));var _0xe448=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x448e[_0x2650e9];return _0x3511c8;};'use strict';var EventEmitter=require(_0xe448('0x0'));var MailQueue=require(_0xe448('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe448('0x2')](0x0);var events={'afterCreate':_0xe448('0x3'),'afterUpdate':'update','afterDestroy':_0xe448('0x4')};function emitEvent(_0xf64b43){return function(_0x4f7344,_0x5b2089,_0x270dba){MailQueueEvents['emit'](_0xf64b43+':'+_0x4f7344['id'],_0x4f7344);MailQueueEvents[_0xe448('0x5')](_0xf64b43,_0x4f7344);_0x270dba(null);};}for(var e in events){if(events[_0xe448('0x6')](e)){var event=events[e];MailQueue[_0xe448('0x7')](e,emitEvent(event));}}module[_0xe448('0x8')]=MailQueueEvents;