Built motion from commit ac06311e.|2.6.28
[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 _0xca5c=['events','../../mysqldb','MailQueue','setMaxListeners','update','emit','exports'];(function(_0x1d4907,_0x1533a8){var _0x5661c3=function(_0x3a4f2d){while(--_0x3a4f2d){_0x1d4907['push'](_0x1d4907['shift']());}};_0x5661c3(++_0x1533a8);}(_0xca5c,0xa1));var _0xcca5=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xca5c[_0x4b12ae];return _0x16957b;};'use strict';var EventEmitter=require(_0xcca5('0x0'));var MailQueue=require(_0xcca5('0x1'))['db'][_0xcca5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcca5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcca5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3fef92){return function(_0xf9b05f,_0x23586b,_0x168ada){MailQueueEvents['emit'](_0x3fef92+':'+_0xf9b05f['id'],_0xf9b05f);MailQueueEvents[_0xcca5('0x5')](_0x3fef92,_0xf9b05f);_0x168ada(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xcca5('0x6')]=MailQueueEvents;