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 _0x6b99=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','WhatsappQueue'];(function(_0x2cd3d1,_0x3d2d8e){var _0x291f5b=function(_0x5ec50e){while(--_0x5ec50e){_0x2cd3d1['push'](_0x2cd3d1['shift']());}};_0x291f5b(++_0x3d2d8e);}(_0x6b99,0x1ed));var _0x96b9=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x6b99[_0x500c0];return _0xdd146f;};'use strict';var EventEmitter=require(_0x96b9('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x96b9('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x96b9('0x2')](0x0);var events={'afterCreate':_0x96b9('0x3'),'afterUpdate':_0x96b9('0x4'),'afterDestroy':_0x96b9('0x5')};function emitEvent(_0x2ea82f){return function(_0x5f0f15,_0x5db3e2,_0x1770bc){WhatsappQueueEvents['emit'](_0x2ea82f+':'+_0x5f0f15['id'],_0x5f0f15);WhatsappQueueEvents[_0x96b9('0x6')](_0x2ea82f,_0x5f0f15);_0x1770bc(null);};}for(var e in events){if(events[_0x96b9('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x96b9('0x8')]=WhatsappQueueEvents;