Skip to content

Commit

Permalink
fix: send mult photos in topic group when use share
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao authored and NextAlone committed Oct 26, 2024
1 parent f611c9d commit d4f9f58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4526,7 4526,7 @@ SaveToDownloadReceiver. makeNotification(context,notificationId,messageObjects.s
break;
}
if (!sourceFile.exists()) {
sourceFile = FileLoader.getInstance(currentAccount.getCurrentAccount()).getPathToAttach(message.messageOwner, true);
sourceFile = FileLoader.getInstance(currentAccount.getCurrentAccount()).getPathToMessage(message.messageOwner);
FileLog.d("saving file: correcting path from " path " to " (sourceFile == null ? null : sourceFile.getAbsolutePath()));
}
if (sourceFile != null && sourceFile.exists()) {
Expand Down
13 changes: 6 additions & 7 deletions TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5996,15 5996,14 @@ public boolean didSelectDialogs(DialogsActivity dialogsFragment, ArrayList<Messa
ArrayList<String> 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;
Expand Down

0 comments on commit d4f9f58

Please sign in to comment.