Built motion from commit (unavailable).|2.5.29
[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 _0x15c1=['hasOwnProperty','hook','exports','events','MailQueue','save','update','remove','emit'];(function(_0x2998ba,_0x487fcb){var _0xbebeea=function(_0xc7118f){while(--_0xc7118f){_0x2998ba['push'](_0x2998ba['shift']());}};_0xbebeea(++_0x487fcb);}(_0x15c1,0x198));var _0x115c=function(_0x30fa41,_0x17ca22){_0x30fa41=_0x30fa41-0x0;var _0x42b1f7=_0x15c1[_0x30fa41];return _0x42b1f7;};'use strict';var EventEmitter=require(_0x115c('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x115c('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x115c('0x2'),'afterUpdate':_0x115c('0x3'),'afterDestroy':_0x115c('0x4')};function emitEvent(_0x5c3050){return function(_0x4e8f25,_0x59f84e,_0xe7045){MailQueueEvents[_0x115c('0x5')](_0x5c3050+':'+_0x4e8f25['id'],_0x4e8f25);MailQueueEvents[_0x115c('0x5')](_0x5c3050,_0x4e8f25);_0xe7045(null);};}for(var e in events){if(events[_0x115c('0x6')](e)){var event=events[e];MailQueue[_0x115c('0x7')](e,emitEvent(event));}}module[_0x115c('0x8')]=MailQueueEvents;