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 _0xa4a2=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x39c7ef,_0x3fa4be){var _0x4260d8=function(_0x5263fb){while(--_0x5263fb){_0x39c7ef['push'](_0x39c7ef['shift']());}};_0x4260d8(++_0x3fa4be);}(_0xa4a2,0x18b));var _0x2a4a=function(_0x4d2020,_0x4ae4a0){_0x4d2020=_0x4d2020-0x0;var _0x4e5137=_0xa4a2[_0x4d2020];return _0x4e5137;};'use strict';var EventEmitter=require(_0x2a4a('0x0'));var WhatsappQueue=require(_0x2a4a('0x1'))['db'][_0x2a4a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2a4a('0x3')](0x0);var events={'afterCreate':_0x2a4a('0x4'),'afterUpdate':_0x2a4a('0x5'),'afterDestroy':_0x2a4a('0x6')};function emitEvent(_0x4227fd){return function(_0x3370e9,_0x5a7c7c,_0x552d15){WhatsappQueueEvents[_0x2a4a('0x7')](_0x4227fd+':'+_0x3370e9['id'],_0x3370e9);WhatsappQueueEvents['emit'](_0x4227fd,_0x3370e9);_0x552d15(null);};}for(var e in events){if(events[_0x2a4a('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x2a4a('0x9')]=WhatsappQueueEvents;