96ec920b349ede9f1bbc09439be1998cb5b84079
[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 _0xcffe=['MailQueue','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x35f621,_0x4542b0){var _0x4d175c=function(_0x2df1c4){while(--_0x2df1c4){_0x35f621['push'](_0x35f621['shift']());}};_0x4d175c(++_0x4542b0);}(_0xcffe,0xce));var _0xecff=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xcffe[_0x1a7846];return _0x48049;};'use strict';var EventEmitter=require(_0xecff('0x0'));var MailQueue=require(_0xecff('0x1'))['db'][_0xecff('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xecff('0x3'),'afterUpdate':_0xecff('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5cbf00){return function(_0x36ff94,_0x109c17,_0x306bc7){MailQueueEvents['emit'](_0x5cbf00+':'+_0x36ff94['id'],_0x36ff94);MailQueueEvents[_0xecff('0x5')](_0x5cbf00,_0x36ff94);_0x306bc7(null);};}for(var e in events){if(events[_0xecff('0x6')](e)){var event=events[e];MailQueue[_0xecff('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;