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 _0xec8a=['emit','hasOwnProperty','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove'];(function(_0x57f149,_0x148461){var _0x24d481=function(_0x5041d7){while(--_0x5041d7){_0x57f149['push'](_0x57f149['shift']());}};_0x24d481(++_0x148461);}(_0xec8a,0xaa));var _0xaec8=function(_0x731feb,_0x2a6924){_0x731feb=_0x731feb-0x0;var _0x87949f=_0xec8a[_0x731feb];return _0x87949f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xaec8('0x0'))['db'][_0xaec8('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaec8('0x2')](0x0);var events={'afterCreate':_0xaec8('0x3'),'afterUpdate':'update','afterDestroy':_0xaec8('0x4')};function emitEvent(_0x4e3106){return function(_0x133676,_0x16fddf,_0x1fed9d){WhatsappQueueEvents[_0xaec8('0x5')](_0x4e3106+':'+_0x133676['id'],_0x133676);WhatsappQueueEvents[_0xaec8('0x5')](_0x4e3106,_0x133676);_0x1fed9d(null);};}for(var e in events){if(events[_0xaec8('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;