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 _0xd522=['exports','WhatsappQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x394c4c,_0x201031){var _0x5bfa5a=function(_0x4a5eed){while(--_0x4a5eed){_0x394c4c['push'](_0x394c4c['shift']());}};_0x5bfa5a(++_0x201031);}(_0xd522,0x1e4));var _0x2d52=function(_0x4bc246,_0x153d94){_0x4bc246=_0x4bc246-0x0;var _0x2329cd=_0xd522[_0x4bc246];return _0x2329cd;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x2d52('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2d52('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d52('0x2'),'afterDestroy':_0x2d52('0x3')};function emitEvent(_0x11adc8){return function(_0x1460a0,_0x2b1854,_0x26c57d){WhatsappQueueEvents['emit'](_0x11adc8+':'+_0x1460a0['id'],_0x1460a0);WhatsappQueueEvents[_0x2d52('0x4')](_0x11adc8,_0x1460a0);_0x26c57d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x2d52('0x5')](e,emitEvent(event));}}module[_0x2d52('0x6')]=WhatsappQueueEvents;