8fa681f5c3a9150234b322a85c38756b2cd75724
[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 _0x9589=['events','../../mysqldb','MailQueue','update','hasOwnProperty'];(function(_0x510266,_0x28bbff){var _0x207f66=function(_0x6b6bda){while(--_0x6b6bda){_0x510266['push'](_0x510266['shift']());}};_0x207f66(++_0x28bbff);}(_0x9589,0x82));var _0x9958=function(_0x4e612b,_0x415738){_0x4e612b=_0x4e612b-0x0;var _0x46dec7=_0x9589[_0x4e612b];return _0x46dec7;};'use strict';var EventEmitter=require(_0x9958('0x0'));var MailQueue=require(_0x9958('0x1'))['db'][_0x9958('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9958('0x3'),'afterDestroy':'remove'};function emitEvent(_0x435e08){return function(_0x25afb4,_0x27a88e,_0x470e69){MailQueueEvents['emit'](_0x435e08+':'+_0x25afb4['id'],_0x25afb4);MailQueueEvents['emit'](_0x435e08,_0x25afb4);_0x470e69(null);};}for(var e in events){if(events[_0x9958('0x4')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents;