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 _0x72cb=['hook','exports','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x20b77a,_0x499f5f){var _0x143805=function(_0x1cab8a){while(--_0x1cab8a){_0x20b77a['push'](_0x20b77a['shift']());}};_0x143805(++_0x499f5f);}(_0x72cb,0x1f3));var _0xb72c=function(_0x6fc37a,_0x44c1e0){_0x6fc37a=_0x6fc37a-0x0;var _0x50fba8=_0x72cb[_0x6fc37a];return _0x50fba8;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb72c('0x0')](0x0);var events={'afterCreate':_0xb72c('0x1'),'afterUpdate':_0xb72c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1204d9){return function(_0x1cbd1e,_0x814a5a,_0x1a22ea){WhatsappQueueEvents[_0xb72c('0x3')](_0x1204d9+':'+_0x1cbd1e['id'],_0x1cbd1e);WhatsappQueueEvents[_0xb72c('0x3')](_0x1204d9,_0x1cbd1e);_0x1a22ea(null);};}for(var e in events){if(events[_0xb72c('0x4')](e)){var event=events[e];WhatsappQueue[_0xb72c('0x5')](e,emitEvent(event));}}module[_0xb72c('0x6')]=WhatsappQueueEvents;