From d703afa8ee42fc6983a773097b65bb59cceaebd5 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:36:25 +0000 Subject: [PATCH] fix: send mult photos in topic group when use share --- .../telegram/messenger/FingerprintController.java | 5 ++++- .../main/java/org/telegram/ui/LaunchActivity.java | 13 ++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FingerprintController.java b/TMessagesProj/src/main/java/org/telegram/messenger/FingerprintController.java index ac56341e6a..76680f4e39 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/FingerprintController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/FingerprintController.java @@ -110,7 +110,10 @@ public static void checkKeyReady(boolean notifyCheckFingerprint) { public static boolean isKeyReady() { try { - return getKeyStore().containsAlias(KEY_ALIAS); + var ks = getKeyStore(); + if (ks != null) { + return ks.containsAlias(KEY_ALIAS); + } } catch (KeyStoreException e) { FileLog.e(e); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index 7a80cef04d..98c9d1f7da 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -5996,15 +5996,14 @@ public boolean didSelectDialogs(DialogsActivity dialogsFragment, ArrayList arrayList = new ArrayList<>(); arrayList.add(videoPath); SendMessagesHelper.prepareSendingDocuments(accountInstance, arrayList, arrayList, null, captionToSend, null, did, replyToMsg, replyToMsg, null, null, null, notify, scheduleDate, null, null, 0, 0, false); + } else if (photoPathsArray != null && photoPathsArray.size() > 0 && !photosEditorOpened) { + if (sendingText != null && sendingText.length() <= 1024 && photoPathsArray.size() == 1) { + photoPathsArray.get(0).caption = sendingText; + sendingText = null; + } + SendMessagesHelper.prepareSendingMedia(accountInstance, photoPathsArray, did, replyToMsg, replyToMsg, null, null, false, false, null, notify, scheduleDate, 0, false, null, null, 0, 0, false); } } - if (photoPathsArray != null && !photosEditorOpened) { - if (sendingText != null && sendingText.length() <= 1024 && photoPathsArray.size() == 1) { - photoPathsArray.get(0).caption = sendingText; - sendingText = null; - } - SendMessagesHelper.prepareSendingMedia(accountInstance, photoPathsArray, did, replyToMsg, replyToMsg, null, null, false, false, null, notify, scheduleDate, 0, false, null, null, 0, 0, false); - } if (documentsPathsArray != null || documentsUrisArray != null) { if (sendingText != null && sendingText.length() <= 1024 && ((documentsPathsArray != null ? documentsPathsArray.size() : 0) + (documentsUrisArray != null ? documentsUrisArray.size() : 0)) == 1) { captionToSend = sendingText;