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 _0x0763=['exports','events','../../mysqldb','WhatsappQueue','save','update','emit','hook'];(function(_0x1bf75d,_0x1d3920){var _0x5cce12=function(_0x5b5170){while(--_0x5b5170){_0x1bf75d['push'](_0x1bf75d['shift']());}};_0x5cce12(++_0x1d3920);}(_0x0763,0x1e9));var _0x3076=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x0763[_0x30d87a];return _0x48f64b;};'use strict';var EventEmitter=require(_0x3076('0x0'));var WhatsappQueue=require(_0x3076('0x1'))['db'][_0x3076('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3076('0x3'),'afterUpdate':_0x3076('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ef9b8){return function(_0x32e1f0,_0x2fd892,_0x503079){WhatsappQueueEvents[_0x3076('0x5')](_0x1ef9b8+':'+_0x32e1f0['id'],_0x32e1f0);WhatsappQueueEvents[_0x3076('0x5')](_0x1ef9b8,_0x32e1f0);_0x503079(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x3076('0x6')](e,emitEvent(event));}}module[_0x3076('0x7')]=WhatsappQueueEvents;