From 34cca18009e8cc1dded42f037496ec0d36addbce Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Wed, 31 Aug 2016 06:55:22 +0200 Subject: [PATCH] The check for the last message ID should ignore channels, because they have their own numbering system which could result in numbers larger than your own message IDs which leads to downloads of lots of empty messages which then block further backups. --- .../java/de/fabianonline/telegram_backup/DownloadManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java b/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java index 217dd9c..c0977e7 100644 --- a/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java +++ b/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java @@ -103,8 +103,8 @@ public class DownloadManager { dialog_limit); logger.debug("Got {} dialogs", dialogs.getDialogs().size()); for (TLDialog d : dialogs.getDialogs()) { - if (d.getTopMessage() > max_message_id) { - logger.trace("Updating top message id: {} => {}", max_message_id, d.getTopMessage()); + if (d.getTopMessage() > max_message_id && ! (d.getPeer() instanceof TLPeerChannel)) { + logger.trace("Updating top message id: {} => {}. Dialog type: {}", max_message_id, d.getTopMessage(), d.getPeer().getClass().getName()); max_message_id = d.getTopMessage(); } }