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 _0x497f=['events','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x497f,0xf3));var _0xf497=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x497f[_0x456bd2];return _0x2218c1;};'use strict';var EventEmitter=require(_0xf497('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xf497('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf497('0x2')](0x0);var events={'afterCreate':_0xf497('0x3'),'afterUpdate':_0xf497('0x4'),'afterDestroy':_0xf497('0x5')};function emitEvent(_0x89a19d){return function(_0x431f34,_0x4400cb,_0x19576c){WhatsappQueueEvents[_0xf497('0x6')](_0x89a19d+':'+_0x431f34['id'],_0x431f34);WhatsappQueueEvents[_0xf497('0x6')](_0x89a19d,_0x431f34);_0x19576c(null);};}for(var e in events){if(events[_0xf497('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xf497('0x8')]=WhatsappQueueEvents;