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 _0xf320=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf320,0xc2));var _0x0f32=function(_0x500f5d,_0x5433a3){_0x500f5d=_0x500f5d-0x0;var _0x1f7498=_0xf320[_0x500f5d];return _0x1f7498;};'use strict';var EventEmitter=require(_0x0f32('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x0f32('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0f32('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f32('0x3'),'afterDestroy':_0x0f32('0x4')};function emitEvent(_0x54f29d){return function(_0x1981ea,_0x496452,_0x311568){WhatsappQueueEvents[_0x0f32('0x5')](_0x54f29d+':'+_0x1981ea['id'],_0x1981ea);WhatsappQueueEvents[_0x0f32('0x5')](_0x54f29d,_0x1981ea);_0x311568(null);};}for(var e in events){if(events[_0x0f32('0x6')](e)){var event=events[e];WhatsappQueue[_0x0f32('0x7')](e,emitEvent(event));}}module[_0x0f32('0x8')]=WhatsappQueueEvents;