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 _0x3e2d=['update','remove','emit','hook','exports','../../mysqldb','WhatsappQueue','save'];(function(_0x250af1,_0x56ed60){var _0x1af75a=function(_0x12ca4c){while(--_0x12ca4c){_0x250af1['push'](_0x250af1['shift']());}};_0x1af75a(++_0x56ed60);}(_0x3e2d,0x185));var _0xd3e2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3e2d[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xd3e2('0x0'))['db'][_0xd3e2('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3e2('0x2'),'afterUpdate':_0xd3e2('0x3'),'afterDestroy':_0xd3e2('0x4')};function emitEvent(_0x52bc0f){return function(_0x4c639a,_0x1d3ee5,_0x55b926){WhatsappQueueEvents[_0xd3e2('0x5')](_0x52bc0f+':'+_0x4c639a['id'],_0x4c639a);WhatsappQueueEvents['emit'](_0x52bc0f,_0x4c639a);_0x55b926(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xd3e2('0x6')](e,emitEvent(event));}}module[_0xd3e2('0x7')]=WhatsappQueueEvents;