From: David ‘Bombe’ Roden Date: Wed, 27 Oct 2021 12:26:17 +0000 (+0200) Subject: 🔊 Add more debug logging X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=845acd1b9805e5cb84ba03f6a493014a38b9e798;p=xudocci.git 🔊 Add more debug logging Because I still can't see shit of what's happening! --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index ea04286..db64416 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -892,28 +892,33 @@ public class Core extends AbstractExecutionThreadService { if (!network.isPresent()) { return; } + eventBus.post(new GenericMessage("a")); Set openDownloads = downloads.values().stream() .filter(download -> download.bot().name().equalsIgnoreCase(dccSendReceived.source().nick().orNull())) .filter(download -> download.dccReceiver() == null) .collect(toSet()); + eventBus.post(new GenericMessage("b")); if (openDownloads.isEmpty()) { /* I don't think we requested this. */ eventBus.post(new GenericMessage(format("Ignoring offer for %s, no open download from %s.", dccSendReceived.filename(), dccSendReceived.source()))); return; } + eventBus.post(new GenericMessage("c")); /* check if it’s already downloading. */ if (downloads.values().stream().anyMatch(download -> download.filename().equals(dccSendReceived.filename()) && download.dccReceiver() != null)) { eventBus.post(new GenericMessage(format("Ignoring offer for %s, it’s already being downloaded.", dccSendReceived.filename()))); return; } + eventBus.post(new GenericMessage("d")); Download download = openDownloads.stream() .filter(it -> it.filename().equals(dccSendReceived.filename())) .findFirst() .orElse(openDownloads.iterator().next()); + eventBus.post(new GenericMessage("e")); eventBus.post(new GenericMessage(format("Downloading %s from %s as %s.", dccSendReceived.filename(), dccSendReceived.source(), download.filename()))); /* check if the file already exists. */