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 _0x6c7b=['hasOwnProperty','events','../../mysqldb','MailQueue','save','update','emit'];(function(_0x4bb8a,_0x4dab63){var _0x3ef06c=function(_0x5a0d8f){while(--_0x5a0d8f){_0x4bb8a['push'](_0x4bb8a['shift']());}};_0x3ef06c(++_0x4dab63);}(_0x6c7b,0x13c));var _0xb6c7=function(_0x20de73,_0x2cbf6e){_0x20de73=_0x20de73-0x0;var _0x4d315c=_0x6c7b[_0x20de73];return _0x4d315c;};'use strict';var EventEmitter=require(_0xb6c7('0x0'));var MailQueue=require(_0xb6c7('0x1'))['db'][_0xb6c7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6c7('0x3'),'afterUpdate':_0xb6c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5b6d8f){return function(_0x178245,_0x4fca47,_0x3e4bbf){MailQueueEvents[_0xb6c7('0x5')](_0x5b6d8f+':'+_0x178245['id'],_0x178245);MailQueueEvents[_0xb6c7('0x5')](_0x5b6d8f,_0x178245);_0x3e4bbf(null);};}for(var e in events){if(events[_0xb6c7('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents;