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 _0x0d29=['events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x3da312,_0x391ccd){var _0x28fb08=function(_0x1792bf){while(--_0x1792bf){_0x3da312['push'](_0x3da312['shift']());}};_0x28fb08(++_0x391ccd);}(_0x0d29,0xb4));var _0x90d2=function(_0x413a0e,_0x46c5fc){_0x413a0e=_0x413a0e-0x0;var _0x2c2a98=_0x0d29[_0x413a0e];return _0x2c2a98;};'use strict';var EventEmitter=require(_0x90d2('0x0'));var WhatsappQueue=require(_0x90d2('0x1'))['db'][_0x90d2('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x90d2('0x3')](0x0);var events={'afterCreate':_0x90d2('0x4'),'afterUpdate':_0x90d2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x35be37){return function(_0x2623b2,_0x2cd663,_0x1116b7){WhatsappQueueEvents[_0x90d2('0x6')](_0x35be37+':'+_0x2623b2['id'],_0x2623b2);WhatsappQueueEvents[_0x90d2('0x6')](_0x35be37,_0x2623b2);_0x1116b7(null);};}for(var e in events){if(events[_0x90d2('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x90d2('0x8')]=WhatsappQueueEvents;