mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-12-25 14:25:35 +00:00
Implemented testing of getUpdates and stuff.
This commit is contained in:
parent
ab16c44de5
commit
f49a9541a3
@ -133,6 +133,7 @@ class CommandLineController {
|
||||
val d = DownloadManager(client, CommandLineDownloadProgress())
|
||||
logger.debug("Calling DownloadManager.downloadMessages with limit {}", CommandLineOptions.val_limit_messages)
|
||||
d.downloadMessages(CommandLineOptions.val_limit_messages)
|
||||
UpdatesManager.update(client)
|
||||
logger.debug("CommandLineOptions.cmd_no_media: {}", CommandLineOptions.cmd_no_media)
|
||||
if (!CommandLineOptions.cmd_no_media) {
|
||||
logger.debug("Calling DownloadManager.downloadMedia")
|
||||
|
@ -0,0 +1,25 @@
|
||||
package de.fabianonline.telegram_backup
|
||||
|
||||
import com.github.badoualy.telegram.api.TelegramClient
|
||||
import com.github.badoualy.telegram.tl.api.updates.TLState
|
||||
import com.github.badoualy.telegram.tl.api.updates.TLAbsDifference
|
||||
|
||||
object UpdatesManager {
|
||||
fun update(client: TelegramClient) {
|
||||
val state: TLState = client.updatesGetState()
|
||||
|
||||
println("pts: ${state.pts}")
|
||||
println("qts: ${state.qts}")
|
||||
println("date: ${state.date}")
|
||||
println("seq: ${state.seq}")
|
||||
println("unreadCount: ${state.unreadCount}")
|
||||
|
||||
val pts = 1 //211282
|
||||
val date = 1515060280
|
||||
val qts = -1 // We don't support encryption. Setting qts to -1 signals this to telegram, so we won't get updates for encrypted messages.
|
||||
val diff = client.updatesGetDifference(pts, date, qts)
|
||||
|
||||
println("diff type: ${diff.javaClass}")
|
||||
println(diff.toPrettyJson())
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user