Built motion from commit (unavailable).|2.5.19
[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 _0x0fac=['hook','exports','events','MailQueue','save','remove','emit','hasOwnProperty'];(function(_0x203721,_0x167f37){var _0x1e2894=function(_0x4e11fd){while(--_0x4e11fd){_0x203721['push'](_0x203721['shift']());}};_0x1e2894(++_0x167f37);}(_0x0fac,0x1ea));var _0xc0fa=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0fac[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0xc0fa('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xc0fa('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc0fa('0x2'),'afterUpdate':'update','afterDestroy':_0xc0fa('0x3')};function emitEvent(_0x164f9e){return function(_0x5a57bb,_0x1e7c0e,_0x497161){MailQueueEvents[_0xc0fa('0x4')](_0x164f9e+':'+_0x5a57bb['id'],_0x5a57bb);MailQueueEvents[_0xc0fa('0x4')](_0x164f9e,_0x5a57bb);_0x497161(null);};}for(var e in events){if(events[_0xc0fa('0x5')](e)){var event=events[e];MailQueue[_0xc0fa('0x6')](e,emitEvent(event));}}module[_0xc0fa('0x7')]=MailQueueEvents;