Built motion from commit 9d1906d1.|2.5.40
[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 _0xe972=['save','emit','hook','../../mysqldb','setMaxListeners'];(function(_0x5088e9,_0x1ba8fa){var _0x49eb06=function(_0x5025be){while(--_0x5025be){_0x5088e9['push'](_0x5088e9['shift']());}};_0x49eb06(++_0x1ba8fa);}(_0xe972,0x193));var _0x2e97=function(_0x493a20,_0x9fbf06){_0x493a20=_0x493a20-0x0;var _0x4ca488=_0xe972[_0x493a20];return _0x4ca488;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x2e97('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2e97('0x1')](0x0);var events={'afterCreate':_0x2e97('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x39b5dd){return function(_0x5caeb9,_0x4b518f,_0x4f1468){MailQueueEvents[_0x2e97('0x3')](_0x39b5dd+':'+_0x5caeb9['id'],_0x5caeb9);MailQueueEvents[_0x2e97('0x3')](_0x39b5dd,_0x5caeb9);_0x4f1468(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x2e97('0x4')](e,emitEvent(event));}}module['exports']=MailQueueEvents;