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 _0x5ccc=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x5ccc,0xcc));var _0xc5cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ccc[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc5cc('0x0'));var WhatsappQueue=require(_0xc5cc('0x1'))['db'][_0xc5cc('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc5cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc5cc('0x4'),'afterDestroy':_0xc5cc('0x5')};function emitEvent(_0x38a2b0){return function(_0x4b60a7,_0x45041f,_0x41c415){WhatsappQueueEvents['emit'](_0x38a2b0+':'+_0x4b60a7['id'],_0x4b60a7);WhatsappQueueEvents[_0xc5cc('0x6')](_0x38a2b0,_0x4b60a7);_0x41c415(null);};}for(var e in events){if(events[_0xc5cc('0x7')](e)){var event=events[e];WhatsappQueue[_0xc5cc('0x8')](e,emitEvent(event));}}module[_0xc5cc('0x9')]=WhatsappQueueEvents;