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 _0xc1ff=['hasOwnProperty','hook','exports','WhatsappQueue','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1ff,0x105));var _0xfc1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1ff[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0xfc1f('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfc1f('0x1')};function emitEvent(_0x49fe2a){return function(_0x5a68ea,_0x2e1bbe,_0x51c825){WhatsappQueueEvents['emit'](_0x49fe2a+':'+_0x5a68ea['id'],_0x5a68ea);WhatsappQueueEvents[_0xfc1f('0x2')](_0x49fe2a,_0x5a68ea);_0x51c825(null);};}for(var e in events){if(events[_0xfc1f('0x3')](e)){var event=events[e];WhatsappQueue[_0xfc1f('0x4')](e,emitEvent(event));}}module[_0xfc1f('0x5')]=WhatsappQueueEvents;