Built motion from commit (unavailable).|2.5.17
[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 _0xdf93=['exports','events','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x219505,_0x37a9b8){var _0x4e64ce=function(_0x3fd904){while(--_0x3fd904){_0x219505['push'](_0x219505['shift']());}};_0x4e64ce(++_0x37a9b8);}(_0xdf93,0x129));var _0x3df9=function(_0x392ce9,_0x381bcb){_0x392ce9=_0x392ce9-0x0;var _0x14dc0b=_0xdf93[_0x392ce9];return _0x14dc0b;};'use strict';var EventEmitter=require(_0x3df9('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3df9('0x1'),'afterUpdate':_0x3df9('0x2'),'afterDestroy':_0x3df9('0x3')};function emitEvent(_0x3252c9){return function(_0x4daaaf,_0x286967,_0x32e2b8){MailQueueEvents[_0x3df9('0x4')](_0x3252c9+':'+_0x4daaaf['id'],_0x4daaaf);MailQueueEvents[_0x3df9('0x4')](_0x3252c9,_0x4daaaf);_0x32e2b8(null);};}for(var e in events){if(events[_0x3df9('0x5')](e)){var event=events[e];MailQueue[_0x3df9('0x6')](e,emitEvent(event));}}module[_0x3df9('0x7')]=MailQueueEvents;