Built motion from commit ffdca78c.|2.6.24
[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 _0xc6bc=['exports','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x28ae0a,_0x5baa23){var _0x5102b2=function(_0x1ad4be){while(--_0x1ad4be){_0x28ae0a['push'](_0x28ae0a['shift']());}};_0x5102b2(++_0x5baa23);}(_0xc6bc,0x106));var _0xcc6b=function(_0x136e5e,_0x2d5726){_0x136e5e=_0x136e5e-0x0;var _0x3427c1=_0xc6bc[_0x136e5e];return _0x3427c1;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xcc6b('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcc6b('0x1')](0x0);var events={'afterCreate':_0xcc6b('0x2'),'afterUpdate':_0xcc6b('0x3'),'afterDestroy':_0xcc6b('0x4')};function emitEvent(_0x37e86d){return function(_0x40bb52,_0x50d8a2,_0x36210a){MailQueueEvents[_0xcc6b('0x5')](_0x37e86d+':'+_0x40bb52['id'],_0x40bb52);MailQueueEvents[_0xcc6b('0x5')](_0x37e86d,_0x40bb52);_0x36210a(null);};}for(var e in events){if(events[_0xcc6b('0x6')](e)){var event=events[e];MailQueue[_0xcc6b('0x7')](e,emitEvent(event));}}module[_0xcc6b('0x8')]=MailQueueEvents;