From 051c0a31aff32a7c6a4a1e1a4bc7c4847f51219d Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 15 Jul 2016 06:35:06 +0200 Subject: [PATCH] Cleanup --- .../de/fabianonline/telegram_backup/DownloadManager.java | 5 ++--- .../telegram_backup/TelegramUpdateHandler.java | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java b/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java index 99c8422..0b0cafc 100644 --- a/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java +++ b/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java @@ -173,7 +173,7 @@ public class DownloadManager { TLAbsMessages response = client.messagesGetMessages(vector); prog.onMessageDownloaded(response.getMessages().size()); - db.saveMessages(response.getMessages(), Config.API_LAYER); + db.saveMessages(response.getMessages(), Kotlogram.API_LAYER); db.saveChats(response.getChats()); db.saveUsers(response.getUsers()); Log.debug("Sleeping"); @@ -286,8 +286,7 @@ public class DownloadManager { fos = new FileOutputStream(temp_filename, true); TLFile response; do { - int block_size = Config.FILE_DOWNLOAD_BLOCK_SIZES[new Random().nextInt(Config.FILE_DOWNLOAD_BLOCK_SIZES.length)]; - block_size = size; + int block_size = size; Log.debug("offset: %8d block_size: %7d size: %8d", offset, block_size, size); TLRequestUploadGetFile req = new TLRequestUploadGetFile(loc, offset, block_size); if (dcID==null) { diff --git a/src/main/java/de/fabianonline/telegram_backup/TelegramUpdateHandler.java b/src/main/java/de/fabianonline/telegram_backup/TelegramUpdateHandler.java index 57c2272..501a10e 100644 --- a/src/main/java/de/fabianonline/telegram_backup/TelegramUpdateHandler.java +++ b/src/main/java/de/fabianonline/telegram_backup/TelegramUpdateHandler.java @@ -18,6 +18,7 @@ package de.fabianonline.telegram_backup; import com.github.badoualy.telegram.api.UpdateCallback; import com.github.badoualy.telegram.api.TelegramClient; +import com.github.badoualy.telegram.api.Kotlogram; import com.github.badoualy.telegram.tl.api.*; import com.github.badoualy.telegram.tl.core.TLVector; @@ -85,7 +86,7 @@ class TelegramUpdateHandler implements UpdateCallback { null); TLVector vector = new TLVector(TLAbsMessage.class); vector.add(msg); - db.saveMessages(vector, Config.API_LAYER); + db.saveMessages(vector, Kotlogram.API_LAYER); System.out.print('.'); } @@ -121,7 +122,7 @@ class TelegramUpdateHandler implements UpdateCallback { null); TLVector vector = new TLVector(TLAbsMessage.class); vector.add(msg); - db.saveMessages(vector, Config.API_LAYER); + db.saveMessages(vector, Kotlogram.API_LAYER); System.out.print('.'); } @@ -133,7 +134,7 @@ class TelegramUpdateHandler implements UpdateCallback { TLAbsMessage abs_msg = ((TLUpdateNewMessage)update).getMessage(); TLVector vector = new TLVector(TLAbsMessage.class); vector.add(abs_msg); - db.saveMessages(vector, Config.API_LAYER); + db.saveMessages(vector, Kotlogram.API_LAYER); System.out.print('.'); if (abs_msg instanceof TLMessage) { AbstractMediaFileManager fm = FileManagerFactory.getFileManager((TLMessage)abs_msg, user, client);