From 5b9de9d7cc327acadcd1940c80c64727cd481932 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Thu, 15 Sep 2016 06:36:39 +0200 Subject: [PATCH] The update check now also outputs the new version's description. --- .../de/fabianonline/telegram_backup/CommandLineRunner.java | 3 +++ src/main/java/de/fabianonline/telegram_backup/Utils.java | 2 +- src/main/java/de/fabianonline/telegram_backup/Version.java | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/fabianonline/telegram_backup/CommandLineRunner.java b/src/main/java/de/fabianonline/telegram_backup/CommandLineRunner.java index 2ec3e4c..deb9229 100644 --- a/src/main/java/de/fabianonline/telegram_backup/CommandLineRunner.java +++ b/src/main/java/de/fabianonline/telegram_backup/CommandLineRunner.java @@ -67,6 +67,9 @@ public class CommandLineRunner { System.out.println("Available: " + v.version); System.out.println("Get it here: " + v.url); System.out.println(); + System.out.println("Changes in this version:"); + System.out.println(v.body); + System.out.println(); } if (true || CommandLineOptions.cmd_console) { diff --git a/src/main/java/de/fabianonline/telegram_backup/Utils.java b/src/main/java/de/fabianonline/telegram_backup/Utils.java index b5c3117..a161d4a 100644 --- a/src/main/java/de/fabianonline/telegram_backup/Utils.java +++ b/src/main/java/de/fabianonline/telegram_backup/Utils.java @@ -90,7 +90,7 @@ public class Utils { int result = compareVersions(cur_v, new_v); - return new Version(new_v, newest_version.getAsJsonPrimitive("html_url").getAsString(), result == VERSION_2_NEWER); + return new Version(new_v, newest_version.getAsJsonPrimitive("html_url").getAsString(), newest_version.getAsJsonPrimitive("body").getAsString(), result == VERSION_2_NEWER); } return null; } catch(Exception e) { diff --git a/src/main/java/de/fabianonline/telegram_backup/Version.java b/src/main/java/de/fabianonline/telegram_backup/Version.java index e325dfa..3ec4908 100644 --- a/src/main/java/de/fabianonline/telegram_backup/Version.java +++ b/src/main/java/de/fabianonline/telegram_backup/Version.java @@ -19,11 +19,13 @@ package de.fabianonline.telegram_backup; public class Version { public final String version; public final String url; + public final String body; public final boolean isNewer; - public Version(String v, String u, boolean n) { + public Version(String v, String u, String b, boolean n) { this.version = v; this.url = u; + this.body = b; this.isNewer = n; } }