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 _0xc62f=['exports','WhatsappQueue','update','emit','hasOwnProperty','hook'];(function(_0x19f432,_0x4c6ceb){var _0x3bd347=function(_0x746415){while(--_0x746415){_0x19f432['push'](_0x19f432['shift']());}};_0x3bd347(++_0x4c6ceb);}(_0xc62f,0x1e1));var _0xfc62=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc62f[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0xfc62('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfc62('0x1'),'afterDestroy':'remove'};function emitEvent(_0x291369){return function(_0x56ab16,_0x313324,_0x37501d){WhatsappQueueEvents[_0xfc62('0x2')](_0x291369+':'+_0x56ab16['id'],_0x56ab16);WhatsappQueueEvents[_0xfc62('0x2')](_0x291369,_0x56ab16);_0x37501d(null);};}for(var e in events){if(events[_0xfc62('0x3')](e)){var event=events[e];WhatsappQueue[_0xfc62('0x4')](e,emitEvent(event));}}module[_0xfc62('0x5')]=WhatsappQueueEvents;