Built motion from commit (unavailable).|2.4.4
[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 _0x2b06=['exports','../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x2baecd,_0x2b8b4e){var _0x3cafd3=function(_0x196f6b){while(--_0x196f6b){_0x2baecd['push'](_0x2baecd['shift']());}};_0x3cafd3(++_0x2b8b4e);}(_0x2b06,0x1ba));var _0x62b0=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0x2b06[_0x525798];return _0x57da9a;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x62b0('0x0'))['db'][_0x62b0('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x62b0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x62b0('0x3'),'afterDestroy':_0x62b0('0x4')};function emitEvent(_0x21750c){return function(_0x4c7cc4,_0x4dd45d,_0xdc9590){MailQueueEvents['emit'](_0x21750c+':'+_0x4c7cc4['id'],_0x4c7cc4);MailQueueEvents[_0x62b0('0x5')](_0x21750c,_0x4c7cc4);_0xdc9590(null);};}for(var e in events){if(events[_0x62b0('0x6')](e)){var event=events[e];MailQueue[_0x62b0('0x7')](e,emitEvent(event));}}module[_0x62b0('0x8')]=MailQueueEvents;