Skip to content

Commit

Permalink
woops²
Browse files Browse the repository at this point in the history
  • Loading branch information
Difegue committed Sep 14, 2024
1 parent 204b96a commit d9ccbfb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/com/difegue/doujinsoft/wc24/WiiConnect24Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public String sendMails(List<MailItem> mails) throws IOException {
// Log full multipart request, if thou must
// It makes the logs gigantic
if (System.getenv().containsKey("WC24_DEBUG")) {

try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
builder.build().writeTo(baos);
Expand Down Expand Up @@ -123,16 +123,17 @@ public void receiveMails() throws Exception {
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();

if (System.getenv().containsKey("WC24_DEBUG")) {
Logger log = Logger.getLogger("WC24 Debug");
log.log(Level.INFO, responseText);
}

if (entity != null)
try (InputStream inStream = entity.getContent()) {

String responseText = new BufferedReader(new InputStreamReader(inStream)).lines()
.collect(Collectors.joining("\n"));

if (System.getenv().containsKey("WC24_DEBUG")) {
Logger log = Logger.getLogger("WC24 Debug");
log.log(Level.INFO, responseText);
}

new MailItemParser(application).consumeEmails(responseText);
}
}
Expand Down

0 comments on commit d9ccbfb

Please sign in to comment.