From c783e25d6968bc137cdef6ba444846e26b6c2dd4 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Sat, 5 Apr 2014 00:18:46 +0400 Subject: [PATCH] partly revert last commit, fixed infinite updating --- TMessagesProj/build.gradle | 2 +- TMessagesProj/src/main/AndroidManifest.xml | 1 + .../java/org/telegram/messenger/MessagesController.java | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 2f802b636..1ae6e9c20 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -82,7 +82,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 223 + versionCode 224 versionName "1.4.10" } } diff --git a/TMessagesProj/src/main/AndroidManifest.xml b/TMessagesProj/src/main/AndroidManifest.xml index b167ae595..b2e98731d 100644 --- a/TMessagesProj/src/main/AndroidManifest.xml +++ b/TMessagesProj/src/main/AndroidManifest.xml @@ -52,6 +52,7 @@ android:name="org.telegram.ui.LaunchActivity" android:windowSoftInputMode="adjustResize" android:hardwareAccelerated="true" + android:launchMode="singleTask" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"> diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 80c77d25a..cbe28efbf 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -3441,7 +3441,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (missingData) { needGetDiff = true; } else { - if (MessagesStorage.lastSeqValue + 1 == updates.seq && !gettingDifference) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq) { TLRPC.TL_message message = new TLRPC.TL_message(); message.from_id = updates.from_id; message.id = updates.id; @@ -3503,7 +3503,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (missingData) { needGetDiff = true; } else { - if (MessagesStorage.lastSeqValue + 1 == updates.seq && !gettingDifference) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq) { TLRPC.TL_message message = new TLRPC.TL_message(); message.from_id = updates.from_id; message.id = updates.id; @@ -3562,7 +3562,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } } } else if (updates instanceof TLRPC.TL_updatesCombined) { - if ((MessagesStorage.lastSeqValue + 1 == updates.seq_start || MessagesStorage.lastSeqValue == updates.seq_start) && !gettingDifference) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq_start || MessagesStorage.lastSeqValue == updates.seq_start) { MessagesStorage.getInstance().putUsersAndChats(updates.users, updates.chats, true, true); int lastPtsValue = MessagesStorage.lastPtsValue; int lastQtsValue = MessagesStorage.lastQtsValue; @@ -3592,7 +3592,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } } } else if (updates instanceof TLRPC.TL_updates) { - if ((MessagesStorage.lastSeqValue + 1 == updates.seq || updates.seq == 0 || updates.seq == MessagesStorage.lastSeqValue) && !gettingDifference) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq || updates.seq == 0 || updates.seq == MessagesStorage.lastSeqValue) { MessagesStorage.getInstance().putUsersAndChats(updates.users, updates.chats, true, true); int lastPtsValue = MessagesStorage.lastPtsValue; int lastQtsValue = MessagesStorage.lastQtsValue;