Built motion from commit 0900f080.|2.5.45
[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 _0x6cc5=['../../mysqldb','MailQueue','save','remove','emit','hook','exports'];(function(_0x3a0ab8,_0x57339d){var _0x2e772e=function(_0x526f79){while(--_0x526f79){_0x3a0ab8['push'](_0x3a0ab8['shift']());}};_0x2e772e(++_0x57339d);}(_0x6cc5,0x1f1));var _0x56cc=function(_0x147259,_0x27b351){_0x147259=_0x147259-0x0;var _0x5383a0=_0x6cc5[_0x147259];return _0x5383a0;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x56cc('0x0'))['db'][_0x56cc('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x56cc('0x2'),'afterUpdate':'update','afterDestroy':_0x56cc('0x3')};function emitEvent(_0x4cfcca){return function(_0x18eeb7,_0x57dfa7,_0x10fc42){MailQueueEvents[_0x56cc('0x4')](_0x4cfcca+':'+_0x18eeb7['id'],_0x18eeb7);MailQueueEvents['emit'](_0x4cfcca,_0x18eeb7);_0x10fc42(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x56cc('0x5')](e,emitEvent(event));}}module[_0x56cc('0x6')]=MailQueueEvents;