1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x7f49=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7f49,0xcb));var _0x97f4=function(_0x11295b,_0x1fd250){_0x11295b=_0x11295b-0x0;var _0x61b20=_0x7f49[_0x11295b];return _0x61b20;};'use strict';var EventEmitter=require(_0x97f4('0x0'));var MailQueue=require(_0x97f4('0x1'))['db'][_0x97f4('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x97f4('0x3'),'afterUpdate':_0x97f4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x640952){return function(_0x410725,_0x50cdc7,_0x5b7fb4){MailQueueEvents['emit'](_0x640952+':'+_0x410725['id'],_0x410725);MailQueueEvents[_0x97f4('0x5')](_0x640952,_0x410725);_0x5b7fb4(null);};}for(var e in events){if(events[_0x97f4('0x6')](e)){var event=events[e];MailQueue[_0x97f4('0x7')](e,emitEvent(event));}}module[_0x97f4('0x8')]=MailQueueEvents;