Built motion from commit 3e059bc2.|2.5.32
[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 _0x1acb=['MailQueue','setMaxListeners','save','update','remove','hasOwnProperty','events'];(function(_0x337113,_0x4d9fad){var _0x14cb23=function(_0x15aa39){while(--_0x15aa39){_0x337113['push'](_0x337113['shift']());}};_0x14cb23(++_0x4d9fad);}(_0x1acb,0x7d));var _0xb1ac=function(_0x57abc5,_0x312a1c){_0x57abc5=_0x57abc5-0x0;var _0xc4d8c4=_0x1acb[_0x57abc5];return _0xc4d8c4;};'use strict';var EventEmitter=require(_0xb1ac('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xb1ac('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb1ac('0x2')](0x0);var events={'afterCreate':_0xb1ac('0x3'),'afterUpdate':_0xb1ac('0x4'),'afterDestroy':_0xb1ac('0x5')};function emitEvent(_0x4af0ac){return function(_0x53b36e,_0x45e06a,_0x32881b){MailQueueEvents['emit'](_0x4af0ac+':'+_0x53b36e['id'],_0x53b36e);MailQueueEvents['emit'](_0x4af0ac,_0x53b36e);_0x32881b(null);};}for(var e in events){if(events[_0xb1ac('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents;