Built motion from commit 42801a18.|2.6.28
[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 _0x277d=['emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue','save','update','remove'];(function(_0x534154,_0x210efb){var _0x79cd80=function(_0x76e354){while(--_0x76e354){_0x534154['push'](_0x534154['shift']());}};_0x79cd80(++_0x210efb);}(_0x277d,0x8a));var _0xd277=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x277d[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0xd277('0x0'));var MailQueue=require(_0xd277('0x1'))['db'][_0xd277('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd277('0x3'),'afterUpdate':_0xd277('0x4'),'afterDestroy':_0xd277('0x5')};function emitEvent(_0x5996b1){return function(_0x2bece6,_0x367cf8,_0x493f02){MailQueueEvents[_0xd277('0x6')](_0x5996b1+':'+_0x2bece6['id'],_0x2bece6);MailQueueEvents[_0xd277('0x6')](_0x5996b1,_0x2bece6);_0x493f02(null);};}for(var e in events){if(events[_0xd277('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xd277('0x8')]=MailQueueEvents;