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 _0xfc82=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x58e8eb,_0x2ac0c7){var _0x168540=function(_0x47ad20){while(--_0x47ad20){_0x58e8eb['push'](_0x58e8eb['shift']());}};_0x168540(++_0x2ac0c7);}(_0xfc82,0xab));var _0x2fc8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xfc82[_0x2d7f0e];return _0x110b07;};'use strict';var EventEmitter=require(_0x2fc8('0x0'));var WhatsappQueue=require(_0x2fc8('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2fc8('0x2')](0x0);var events={'afterCreate':_0x2fc8('0x3'),'afterUpdate':_0x2fc8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c7516){return function(_0x438b0d,_0x4154e8,_0x56ab2b){WhatsappQueueEvents[_0x2fc8('0x5')](_0x1c7516+':'+_0x438b0d['id'],_0x438b0d);WhatsappQueueEvents[_0x2fc8('0x5')](_0x1c7516,_0x438b0d);_0x56ab2b(null);};}for(var e in events){if(events[_0x2fc8('0x6')](e)){var event=events[e];WhatsappQueue[_0x2fc8('0x7')](e,emitEvent(event));}}module[_0x2fc8('0x8')]=WhatsappQueueEvents;