Built motion from commit (unavailable).|2.5.8
[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 _0xeb91=['hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','update','remove','emit'];(function(_0xa1e479,_0x5123de){var _0x18e569=function(_0x4c6bd6){while(--_0x4c6bd6){_0xa1e479['push'](_0xa1e479['shift']());}};_0x18e569(++_0x5123de);}(_0xeb91,0xd5));var _0x1eb9=function(_0x5b89c7,_0x22994c){_0x5b89c7=_0x5b89c7-0x0;var _0x332b50=_0xeb91[_0x5b89c7];return _0x332b50;};'use strict';var EventEmitter=require(_0x1eb9('0x0'));var MailQueue=require(_0x1eb9('0x1'))['db'][_0x1eb9('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1eb9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1eb9('0x4'),'afterDestroy':_0x1eb9('0x5')};function emitEvent(_0x1e05bb){return function(_0x4b15bf,_0x209c4b,_0x20f2c7){MailQueueEvents[_0x1eb9('0x6')](_0x1e05bb+':'+_0x4b15bf['id'],_0x4b15bf);MailQueueEvents[_0x1eb9('0x6')](_0x1e05bb,_0x4b15bf);_0x20f2c7(null);};}for(var e in events){if(events[_0x1eb9('0x7')](e)){var event=events[e];MailQueue[_0x1eb9('0x8')](e,emitEvent(event));}}module[_0x1eb9('0x9')]=MailQueueEvents;