Skip to content

Commit

Permalink
more difference handling
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed May 27, 2019
1 parent 5a15dfc commit 7a46624
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -3617,6 +3627,11 @@ public void fetchFromDifference(TLRPC.InputChannel peer, long dialog_id, boolean
}
}
}

if (error != null) {
storeDifference(dialog_id, finalMessages);
stopFetch(id, end);
}
});
}

Expand Down

0 comments on commit 7a46624

Please sign in to comment.