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 _0xae2f=['events','../../mysqldb','WhatsappQueue','save','remove','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae2f,0x70));var _0xfae2=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0xae2f[_0x1139d0];return _0xcc01a6;};'use strict';var EventEmitter=require(_0xfae2('0x0'));var WhatsappQueue=require(_0xfae2('0x1'))['db'][_0xfae2('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfae2('0x3'),'afterUpdate':'update','afterDestroy':_0xfae2('0x4')};function emitEvent(_0x45ce86){return function(_0x473aff,_0x2eeaa4,_0x2d09e1){WhatsappQueueEvents[_0xfae2('0x5')](_0x45ce86+':'+_0x473aff['id'],_0x473aff);WhatsappQueueEvents[_0xfae2('0x5')](_0x45ce86,_0x473aff);_0x2d09e1(null);};}for(var e in events){if(events[_0xfae2('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xfae2('0x7')]=WhatsappQueueEvents;