Built motion from commit c738b9ac.|2.6.25
[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 _0xeff6=['setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xeff6,0x172));var _0x6eff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeff6[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x6eff('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6eff('0x1')](0x0);var events={'afterCreate':_0x6eff('0x2'),'afterUpdate':_0x6eff('0x3'),'afterDestroy':_0x6eff('0x4')};function emitEvent(_0x12cc5c){return function(_0x4d31f3,_0x56f1aa,_0x364ed5){MailQueueEvents[_0x6eff('0x5')](_0x12cc5c+':'+_0x4d31f3['id'],_0x4d31f3);MailQueueEvents[_0x6eff('0x5')](_0x12cc5c,_0x4d31f3);_0x364ed5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6eff('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents;