Built motion from commit (unavailable).|2.5.26
[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 _0x070a=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x4af17c,_0x1a798b){var _0x180765=function(_0x2785d2){while(--_0x2785d2){_0x4af17c['push'](_0x4af17c['shift']());}};_0x180765(++_0x1a798b);}(_0x070a,0x8b));var _0xa070=function(_0x5ab3f7,_0x3403d7){_0x5ab3f7=_0x5ab3f7-0x0;var _0x131219=_0x070a[_0x5ab3f7];return _0x131219;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xa070('0x0'))['db'][_0xa070('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa070('0x2')](0x0);var events={'afterCreate':_0xa070('0x3'),'afterUpdate':_0xa070('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45bd4e){return function(_0x3e711e,_0x1c2bbd,_0x963a89){MailQueueEvents[_0xa070('0x5')](_0x45bd4e+':'+_0x3e711e['id'],_0x3e711e);MailQueueEvents[_0xa070('0x5')](_0x45bd4e,_0x3e711e);_0x963a89(null);};}for(var e in events){if(events[_0xa070('0x6')](e)){var event=events[e];MailQueue[_0xa070('0x7')](e,emitEvent(event));}}module[_0xa070('0x8')]=MailQueueEvents;