Built motion from commit (unavailable).|2.5.4
[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 _0x96a2=['exports','events','../../mysqldb','MailQueue','update','remove','emit','hasOwnProperty','hook'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x96a2,0x172));var _0x296a=function(_0x8a51a2,_0xa18f1){_0x8a51a2=_0x8a51a2-0x0;var _0x5b2a05=_0x96a2[_0x8a51a2];return _0x5b2a05;};'use strict';var EventEmitter=require(_0x296a('0x0'));var MailQueue=require(_0x296a('0x1'))['db'][_0x296a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x296a('0x3'),'afterDestroy':_0x296a('0x4')};function emitEvent(_0x1e6a69){return function(_0x16b81b,_0x501d7e,_0x7d5ee1){MailQueueEvents[_0x296a('0x5')](_0x1e6a69+':'+_0x16b81b['id'],_0x16b81b);MailQueueEvents[_0x296a('0x5')](_0x1e6a69,_0x16b81b);_0x7d5ee1(null);};}for(var e in events){if(events[_0x296a('0x6')](e)){var event=events[e];MailQueue[_0x296a('0x7')](e,emitEvent(event));}}module[_0x296a('0x8')]=MailQueueEvents;