Built motion from commit (unavailable).|2.5.27
[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 _0xd7cb=['events','../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4797fa,_0x3fe610){var _0x502b5b=function(_0x3efffc){while(--_0x3efffc){_0x4797fa['push'](_0x4797fa['shift']());}};_0x502b5b(++_0x3fe610);}(_0xd7cb,0x172));var _0xbd7c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd7cb[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xbd7c('0x0'));var MailQueue=require(_0xbd7c('0x1'))['db'][_0xbd7c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbd7c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd7c('0x4'),'afterDestroy':_0xbd7c('0x5')};function emitEvent(_0x523f0e){return function(_0xcd165,_0x222cbe,_0x5603a1){MailQueueEvents[_0xbd7c('0x6')](_0x523f0e+':'+_0xcd165['id'],_0xcd165);MailQueueEvents[_0xbd7c('0x6')](_0x523f0e,_0xcd165);_0x5603a1(null);};}for(var e in events){if(events[_0xbd7c('0x7')](e)){var event=events[e];MailQueue[_0xbd7c('0x8')](e,emitEvent(event));}}module[_0xbd7c('0x9')]=MailQueueEvents;