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 _0x076a=['update','remove','emit','hook','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x3ac6a3,_0x3dc212){var _0x16951c=function(_0x3e3498){while(--_0x3e3498){_0x3ac6a3['push'](_0x3ac6a3['shift']());}};_0x16951c(++_0x3dc212);}(_0x076a,0xb4));var _0xa076=function(_0x2cf34f,_0x113909){_0x2cf34f=_0x2cf34f-0x0;var _0xe590ce=_0x076a[_0x2cf34f];return _0xe590ce;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xa076('0x0'))['db'][_0xa076('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa076('0x2')](0x0);var events={'afterCreate':_0xa076('0x3'),'afterUpdate':_0xa076('0x4'),'afterDestroy':_0xa076('0x5')};function emitEvent(_0x42cb05){return function(_0x201294,_0x127ebb,_0x149faa){WhatsappQueueEvents['emit'](_0x42cb05+':'+_0x201294['id'],_0x201294);WhatsappQueueEvents[_0xa076('0x6')](_0x42cb05,_0x201294);_0x149faa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xa076('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;