🔊 Add more debug logging
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 27 Oct 2021 12:26:17 +0000 (14:26 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 27 Oct 2021 12:26:17 +0000 (14:26 +0200)
Because I still can't see shit of what's happening!

src/main/java/net/pterodactylus/xdcc/core/Core.java

index ea04286..db64416 100644 (file)
@@ -892,28 +892,33 @@ public class Core extends AbstractExecutionThreadService {
                if (!network.isPresent()) {
                        return;
                }
+               eventBus.post(new GenericMessage("a"));
 
                Set<Download> 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. */