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 _0xa1e3=['save','hasOwnProperty','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0xa1e3,0x1a0));var _0x3a1e=function(_0x3361be,_0x544435){_0x3361be=_0x3361be-0x0;var _0x39114e=_0xa1e3[_0x3361be];return _0x39114e;};'use strict';var EventEmitter=require(_0x3a1e('0x0'));var WhatsappQueue=require(_0x3a1e('0x1'))['db'][_0x3a1e('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3a1e('0x3')](0x0);var events={'afterCreate':_0x3a1e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x42bdad){return function(_0x5e36b1,_0x137d90,_0x1d717a){WhatsappQueueEvents['emit'](_0x42bdad+':'+_0x5e36b1['id'],_0x5e36b1);WhatsappQueueEvents['emit'](_0x42bdad,_0x5e36b1);_0x1d717a(null);};}for(var e in events){if(events[_0x3a1e('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;