From 7a46624abfb02963251bb1606aeedbd5a8ac1204 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 27 May 2019 22:03:12 +0200 Subject: [PATCH] more difference handling --- .../telegram/messenger/MessagesController.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 1710727dbd..da2d669b35 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -3579,6 +3579,16 @@ public void fetchFromDifference(TLRPC.InputChannel peer, long dialog_id, boolean ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> { if (response != null) { + if (response instanceof TLRPC.TL_updates_channelDifferenceTooLong) { + TLRPC.TL_updates_channelDifferenceTooLong res = (TLRPC.TL_updates_channelDifferenceTooLong) response; + + finalMessages.messages.addAll(res.new_messages); + finalMessages.chats.addAll(res.chats); + finalMessages.users.addAll(res.users); + + fetchFromDifference(peer, dialog_id, false, true, res.pts, end, finalMessages, finalDepth); + } + if (response instanceof TLRPC.TL_updates_channelDifference) { TLRPC.TL_updates_channelDifference res = (TLRPC.TL_updates_channelDifference) response; @@ -3617,6 +3627,11 @@ public void fetchFromDifference(TLRPC.InputChannel peer, long dialog_id, boolean } } } + + if (error != null) { + storeDifference(dialog_id, finalMessages); + stopFetch(id, end); + } }); }