Built motion from commit 994c64e1.|2.6.1
[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 _0x36af=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3be708,_0x43753d){var _0xaff8e9=function(_0x5935c3){while(--_0x5935c3){_0x3be708['push'](_0x3be708['shift']());}};_0xaff8e9(++_0x43753d);}(_0x36af,0x18b));var _0xf36a=function(_0xe0d420,_0x2f7904){_0xe0d420=_0xe0d420-0x0;var _0x2eee47=_0x36af[_0xe0d420];return _0x2eee47;};'use strict';var EventEmitter=require(_0xf36a('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xf36a('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf36a('0x2')](0x0);var events={'afterCreate':_0xf36a('0x3'),'afterUpdate':_0xf36a('0x4'),'afterDestroy':_0xf36a('0x5')};function emitEvent(_0xa5d872){return function(_0x3993aa,_0x35d7e7,_0x21c7d5){MailQueueEvents[_0xf36a('0x6')](_0xa5d872+':'+_0x3993aa['id'],_0x3993aa);MailQueueEvents['emit'](_0xa5d872,_0x3993aa);_0x21c7d5(null);};}for(var e in events){if(events[_0xf36a('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xf36a('0x8')]=MailQueueEvents;