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 _0xe2c1=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x10291b,_0x518773){var _0x1d5fbe=function(_0x24df58){while(--_0x24df58){_0x10291b['push'](_0x10291b['shift']());}};_0x1d5fbe(++_0x518773);}(_0xe2c1,0x1c3));var _0x1e2c=function(_0x2c65ba,_0x58b5c9){_0x2c65ba=_0x2c65ba-0x0;var _0x485dd9=_0xe2c1[_0x2c65ba];return _0x485dd9;};'use strict';var EventEmitter=require(_0x1e2c('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1e2c('0x1')](0x0);var events={'afterCreate':_0x1e2c('0x2'),'afterUpdate':_0x1e2c('0x3'),'afterDestroy':_0x1e2c('0x4')};function emitEvent(_0x5ac3fe){return function(_0x2204e0,_0x127c78,_0x202d47){WhatsappQueueEvents[_0x1e2c('0x5')](_0x5ac3fe+':'+_0x2204e0['id'],_0x2204e0);WhatsappQueueEvents['emit'](_0x5ac3fe,_0x2204e0);_0x202d47(null);};}for(var e in events){if(events[_0x1e2c('0x6')](e)){var event=events[e];WhatsappQueue[_0x1e2c('0x7')](e,emitEvent(event));}}module[_0x1e2c('0x8')]=WhatsappQueueEvents;