From a5939ccb348b70854459cacd3526838b61ba7ce2 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Sat, 17 Apr 2021 17:25:35 +0300 Subject: [PATCH] Update to 7.7.2 (2293) --- TMessagesProj/build.gradle | 4 ++-- TMessagesProj/jni/audio.c | 2 +- .../java/org/telegram/messenger/BuildVars.java | 2 +- .../telegram/messenger/LocaleController.java | 7 +++++-- .../telegram/messenger/MessagesStorage.java | 18 +++++++++++------- .../java/org/telegram/ui/ChatActivity.java | 2 +- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index d96dab83a..5ea3733fd 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -300,7 +300,7 @@ android { } } - defaultConfig.versionCode = 2291 + defaultConfig.versionCode = 2293 applicationVariants.all { variant -> variant.outputs.all { output -> @@ -319,7 +319,7 @@ android { defaultConfig { minSdkVersion 16 targetSdkVersion 29 - versionName "7.7.1" + versionName "7.7.2" vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] diff --git a/TMessagesProj/jni/audio.c b/TMessagesProj/jni/audio.c index 5fb72a6d8..f77c92727 100644 --- a/TMessagesProj/jni/audio.c +++ b/TMessagesProj/jni/audio.c @@ -219,7 +219,7 @@ static int writeOggPage(ogg_page *page, FILE *os) { return written; } -const opus_int32 bitrate = 25000; +const opus_int32 bitrate = 30 * 1024; const opus_int32 frame_size = 960; const int with_cvbr = 1; const int max_ogg_delay = 0; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java index b726cef90..d134334fa 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java @@ -18,7 +18,7 @@ public class BuildVars { public static boolean LOGS_ENABLED = false; public static boolean USE_CLOUD_STRINGS = true; public static boolean CHECK_UPDATES = true; - public static int BUILD_VERSION = 2291; + public static int BUILD_VERSION = 2293; public static String BUILD_VERSION_STRING = "7.7.0"; public static int APP_ID = 4; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java b/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java index ba45a73a9..476f5b0a9 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java @@ -1214,8 +1214,11 @@ public class LocaleController { } String result = (discount ? "-" : "") + format.format(doubleAmount); int idx = result.indexOf(type); - if (idx >= 0 && result.charAt(idx + type.length()) != ' ') { - result = result.substring(0, idx + type.length()) + " " + result.substring(idx + type.length()); + if (idx >= 0) { + idx += type.length(); + if (idx < result.length() && result.charAt(idx + type.length()) != ' ') { + result = result.substring(0, idx + type.length()) + " " + result.substring(idx + type.length()); + } } return result; } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java index effd95114..a38b8e9fd 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java @@ -6686,14 +6686,18 @@ public class MessagesStorage extends BaseController { } cursor.dispose(); } - if (messageIdsToFix != null) { //TODO remove later + if (messageIdsToFix != null) { SQLitePreparedStatement state = database.executeFast("UPDATE messages SET mid = ? WHERE mid = ?"); - for (int a = 0, N = messageIdsToFix.size(); a < N; a++) { - long id = messageIdsToFix.get(a); - state.requery(); - state.bindLong(1, (int) id); - state.bindLong(2, id); - state.step(); + try { + for (int a = 0, N = messageIdsToFix.size(); a < N; a++) { + long id = messageIdsToFix.get(a); + state.requery(); + state.bindLong(1, (int) id); + state.bindLong(2, id); + state.step(); + } + } catch (Exception e) { + FileLog.e(e); } state.dispose(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index fd42f62f1..052fee6a2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -17743,7 +17743,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not CharSequence draftMessage = null; MessageObject replyMessage = null; boolean searchWebpage = true; - if (!ignoreAttachOnPause && chatActivityEnterView != null && bottomOverlayChat.getVisibility() != View.VISIBLE) { + if (!ignoreAttachOnPause && chatActivityEnterView != null && bottomOverlayChat != null && bottomOverlayChat.getVisibility() != View.VISIBLE) { chatActivityEnterView.onPause(); replyMessage = replyingMessageObject; if (!chatActivityEnterView.isEditingMessage()) {