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 _0x531a=['remove','emit','hook','exports','events','../../mysqldb','WhatsappQueue','save','update'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0x531a,0x15a));var _0xa531=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x531a[_0x531d15];return _0x271a18;};'use strict';var EventEmitter=require(_0xa531('0x0'));var WhatsappQueue=require(_0xa531('0x1'))['db'][_0xa531('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa531('0x3'),'afterUpdate':_0xa531('0x4'),'afterDestroy':_0xa531('0x5')};function emitEvent(_0x196e5a){return function(_0x14d0a4,_0x12917a,_0x4da500){WhatsappQueueEvents[_0xa531('0x6')](_0x196e5a+':'+_0x14d0a4['id'],_0x14d0a4);WhatsappQueueEvents[_0xa531('0x6')](_0x196e5a,_0x14d0a4);_0x4da500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xa531('0x7')](e,emitEvent(event));}}module[_0xa531('0x8')]=WhatsappQueueEvents;