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 _0x1ad7=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','save','update','remove','emit'];(function(_0x4f160c,_0x254c0e){var _0x59b2bc=function(_0x29b9ed){while(--_0x29b9ed){_0x4f160c['push'](_0x4f160c['shift']());}};_0x59b2bc(++_0x254c0e);}(_0x1ad7,0x125));var _0x71ad=function(_0x1aa289,_0x47d758){_0x1aa289=_0x1aa289-0x0;var _0xb7f13f=_0x1ad7[_0x1aa289];return _0xb7f13f;};'use strict';var EventEmitter=require(_0x71ad('0x0'));var WhatsappQueue=require(_0x71ad('0x1'))['db'][_0x71ad('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x71ad('0x3'),'afterUpdate':_0x71ad('0x4'),'afterDestroy':_0x71ad('0x5')};function emitEvent(_0x4b0eee){return function(_0x10eafc,_0x30cf30,_0x59fb23){WhatsappQueueEvents[_0x71ad('0x6')](_0x4b0eee+':'+_0x10eafc['id'],_0x10eafc);WhatsappQueueEvents[_0x71ad('0x6')](_0x4b0eee,_0x10eafc);_0x59fb23(null);};}for(var e in events){if(events[_0x71ad('0x7')](e)){var event=events[e];WhatsappQueue[_0x71ad('0x8')](e,emitEvent(event));}}module[_0x71ad('0x9')]=WhatsappQueueEvents;