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 _0xa44a=['hasOwnProperty','hook','exports','events','save','remove','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa44a,0x8f));var _0xaa44=function(_0x2b17f9,_0x23f737){_0x2b17f9=_0x2b17f9-0x0;var _0x2f13c9=_0xa44a[_0x2b17f9];return _0x2f13c9;};'use strict';var EventEmitter=require(_0xaa44('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaa44('0x1'),'afterUpdate':'update','afterDestroy':_0xaa44('0x2')};function emitEvent(_0x11d656){return function(_0x387b93,_0x4912f4,_0x908366){WhatsappQueueEvents['emit'](_0x11d656+':'+_0x387b93['id'],_0x387b93);WhatsappQueueEvents[_0xaa44('0x3')](_0x11d656,_0x387b93);_0x908366(null);};}for(var e in events){if(events[_0xaa44('0x4')](e)){var event=events[e];WhatsappQueue[_0xaa44('0x5')](e,emitEvent(event));}}module[_0xaa44('0x6')]=WhatsappQueueEvents;