Built motion from commit 52c8a02d.|2.6.29
[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 _0xfa3c=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x22f75e,_0x4a9e06){var _0x1f6ab3=function(_0x1479d4){while(--_0x1479d4){_0x22f75e['push'](_0x22f75e['shift']());}};_0x1f6ab3(++_0x4a9e06);}(_0xfa3c,0x74));var _0xcfa3=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0xfa3c[_0x399d76];return _0x3b19a1;};'use strict';var EventEmitter=require(_0xcfa3('0x0'));var MailQueue=require(_0xcfa3('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcfa3('0x2')](0x0);var events={'afterCreate':_0xcfa3('0x3'),'afterUpdate':'update','afterDestroy':_0xcfa3('0x4')};function emitEvent(_0x2bc6c0){return function(_0x523f3e,_0x232d73,_0x265a9c){MailQueueEvents['emit'](_0x2bc6c0+':'+_0x523f3e['id'],_0x523f3e);MailQueueEvents[_0xcfa3('0x5')](_0x2bc6c0,_0x523f3e);_0x265a9c(null);};}for(var e in events){if(events[_0xcfa3('0x6')](e)){var event=events[e];MailQueue[_0xcfa3('0x7')](e,emitEvent(event));}}module[_0xcfa3('0x8')]=MailQueueEvents;