1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-12-26 14:45:34 +00:00
This commit is contained in:
Fabian Schlenz 2016-07-15 06:35:06 +02:00
parent f460d2307a
commit 051c0a31af
2 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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<TLAbsMessage> vector = new TLVector<TLAbsMessage>(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<TLAbsMessage> vector = new TLVector<TLAbsMessage>(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<TLAbsMessage> vector = new TLVector<TLAbsMessage>(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);