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 _0xf03e=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf03e,0xe3));var _0xef03=function(_0x2b2438,_0x2f0a66){_0x2b2438=_0x2b2438-0x0;var _0x1b29da=_0xf03e[_0x2b2438];return _0x1b29da;};'use strict';var EventEmitter=require(_0xef03('0x0'));var WhatsappQueue=require(_0xef03('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef03('0x2'),'afterUpdate':_0xef03('0x3'),'afterDestroy':_0xef03('0x4')};function emitEvent(_0x4fbfd4){return function(_0x5effb5,_0x19ea93,_0x1970bd){WhatsappQueueEvents[_0xef03('0x5')](_0x4fbfd4+':'+_0x5effb5['id'],_0x5effb5);WhatsappQueueEvents[_0xef03('0x5')](_0x4fbfd4,_0x5effb5);_0x1970bd(null);};}for(var e in events){if(events[_0xef03('0x6')](e)){var event=events[e];WhatsappQueue[_0xef03('0x7')](e,emitEvent(event));}}module[_0xef03('0x8')]=WhatsappQueueEvents;