diff --git a/MessengerProj/src/main/java/com/b44t/messenger/MediaController.java b/MessengerProj/src/main/java/com/b44t/messenger/MediaController.java index 381578ccf..6b54866fe 100644 --- a/MessengerProj/src/main/java/com/b44t/messenger/MediaController.java +++ b/MessengerProj/src/main/java/com/b44t/messenger/MediaController.java @@ -2664,7 +2664,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener, if (send == 1) { HashMap params = new HashMap<>(); params.put("mr_time_ms", ""+recordTimeCount); - SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, recordingAudioFileToSend.getAbsolutePath(), recordDialogId, recordReplyingMessageObject, params); + SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, recordingAudioFileToSend.getAbsolutePath(), recordDialogId, params); } NotificationCenter.getInstance().postNotificationName(NotificationCenter.audioDidSent, send == 2 ? audioToSend : null, send == 2 ? recordingAudioFileToSend.getAbsolutePath() : null); } else { diff --git a/MessengerProj/src/main/java/com/b44t/messenger/SendMessagesHelper.java b/MessengerProj/src/main/java/com/b44t/messenger/SendMessagesHelper.java index dbce5ce39..b2e8d2e3a 100644 --- a/MessengerProj/src/main/java/com/b44t/messenger/SendMessagesHelper.java +++ b/MessengerProj/src/main/java/com/b44t/messenger/SendMessagesHelper.java @@ -391,11 +391,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter MessagesController.getInstance().deleteMessages(messages, null, null, object.messageOwner.to_id.channel_id); } - public void sendSticker(TLRPC.Document document, long peer, MessageObject replyingMessageObject) { + public void sendSticker(TLRPC.Document document, long peer) { if (document == null) { return; } - SendMessagesHelper.getInstance().sendMessageDocument((TLRPC.TL_document) document, null, null, peer, replyingMessageObject, null); + SendMessagesHelper.getInstance().sendMessageDocument((TLRPC.TL_document) document, null, null, peer, null); } public void sendMessageContact(int contact_id, int dialog_id) { @@ -410,7 +410,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter SendMessagesHelper.getInstance().sendMessageText(msg, dialog_id, null); } - public void sendMessageDocument(TLRPC.TL_document document, VideoEditedInfo videoEditedInfo, String path, long peer, MessageObject reply_to_msg, HashMap params) { + public void sendMessageDocument(TLRPC.TL_document document, VideoEditedInfo videoEditedInfo, String path, long peer, HashMap params) { sendMessage__(null, null, videoEditedInfo, document, peer, path, params); } @@ -418,7 +418,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter sendMessage__(message, null, null, null, peer, null, params); } - public void sendMessagePhoto(TLRPC.TL_photo photo, String path, long peer, MessageObject reply_to_msg, HashMap params) { + public void sendMessagePhoto(TLRPC.TL_photo photo, String path, long peer, HashMap params) { sendMessage__(null, photo, null, null, peer, path, params); } @@ -754,7 +754,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter } } - private static boolean prepareSendingDocumentInternal(String path, String originalPath, Uri uri, String mime, final long dialog_id, final MessageObject reply_to_msg, String caption) { + private static boolean prepareSendingDocumentInternal(String path, String originalPath, Uri uri, String mime, final long dialog_id, String caption) { if ((path == null || path.length() == 0) && uri == null) { return false; } @@ -914,13 +914,13 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { - SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, reply_to_msg, params); + SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, params); } }); return true; } - public static void prepareSendingDocument(String path, String originalPath, Uri uri, String mine, long dialog_id, MessageObject reply_to_msg) { + public static void prepareSendingDocument(String path, String originalPath, Uri uri, String mine, long dialog_id) { if ((path == null || originalPath == null) && uri == null) { return; } @@ -932,10 +932,10 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter } paths.add(path); originalPaths.add(originalPath); - prepareSendingDocuments(paths, originalPaths, uris, mine, dialog_id, reply_to_msg); + prepareSendingDocuments(paths, originalPaths, uris, mine, dialog_id); } - public static void prepareSendingAudioDocuments(final ArrayList messageObjects, final long dialog_id, final MessageObject reply_to_msg) { + public static void prepareSendingAudioDocuments(final ArrayList messageObjects, final long dialog_id) { new Thread(new Runnable() { @Override public void run() { @@ -987,7 +987,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { - SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, messageObject.messageOwner.attachPath, dialog_id, reply_to_msg, params); + SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, messageObject.messageOwner.attachPath, dialog_id, params); } }); } @@ -995,7 +995,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter }).start(); } - public static void prepareSendingDocuments(final ArrayList paths, final ArrayList originalPaths, final ArrayList uris, final String mime, final long dialog_id, final MessageObject reply_to_msg) { + public static void prepareSendingDocuments(final ArrayList paths, final ArrayList originalPaths, final ArrayList uris, final String mime, final long dialog_id) { if (paths == null && originalPaths == null && uris == null || paths != null && originalPaths != null && paths.size() != originalPaths.size()) { return; } @@ -1005,14 +1005,14 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter boolean error = false; if (paths != null) { for (int a = 0; a < paths.size(); a++) { - if (!prepareSendingDocumentInternal(paths.get(a), originalPaths.get(a), null, mime, dialog_id, reply_to_msg, null)) { + if (!prepareSendingDocumentInternal(paths.get(a), originalPaths.get(a), null, mime, dialog_id, null)) { error = true; } } } if (uris != null) { for (int a = 0; a < uris.size(); a++) { - if (!prepareSendingDocumentInternal(null, null, uris.get(a), mime, dialog_id, reply_to_msg, null)) { + if (!prepareSendingDocumentInternal(null, null, uris.get(a), mime, dialog_id, null)) { error = true; } } @@ -1034,7 +1034,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter }).start(); } - public static void prepareSendingPhoto(String imageFilePath, Uri imageUri, long dialog_id, MessageObject reply_to_msg, CharSequence caption) { + public static void prepareSendingPhoto(String imageFilePath, Uri imageUri, long dialog_id, CharSequence caption) { ArrayList paths = null; ArrayList uris = null; ArrayList captions = null; @@ -1050,10 +1050,10 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter captions = new ArrayList<>(); captions.add(caption.toString()); } - prepareSendingPhotos(paths, uris, dialog_id, reply_to_msg, captions); + prepareSendingPhotos(paths, uris, dialog_id, captions); } - public static void prepareSendingPhotosSearch(final ArrayList photos, final long dialog_id, final MessageObject reply_to_msg) { + public static void prepareSendingPhotosSearch(final ArrayList photos, final long dialog_id) { if (photos == null || photos.isEmpty()) { return; } @@ -1149,7 +1149,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { - SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, reply_to_msg, params); + SendMessagesHelper.getInstance().sendMessageDocument(documentFinal, null, pathFinal, dialog_id, params); } }); } else { @@ -1199,7 +1199,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { - SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, needDownloadHttpFinal ? searchImage.imageUrl : null, dialog_id, reply_to_msg, params); + SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, needDownloadHttpFinal ? searchImage.imageUrl : null, dialog_id, params); } }); } @@ -1253,7 +1253,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter */ } - public static void prepareSendingPhotos(ArrayList paths, ArrayList uris, final long dialog_id, final MessageObject reply_to_msg, final ArrayList captions) { + public static void prepareSendingPhotos(ArrayList paths, ArrayList uris, final long dialog_id, final ArrayList captions) { if (paths == null && uris == null || paths != null && paths.isEmpty() || uris != null && uris.isEmpty()) { return; } @@ -1351,7 +1351,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { - SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, null, dialog_id, reply_to_msg, params); + SendMessagesHelper.getInstance().sendMessagePhoto(photoFinal, null, dialog_id, params); } }); } @@ -1359,14 +1359,14 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter } if (sendAsDocuments != null && !sendAsDocuments.isEmpty()) { for (int a = 0; a < sendAsDocuments.size(); a++) { - prepareSendingDocumentInternal(sendAsDocuments.get(a), sendAsDocumentsOriginal.get(a), null, extension, dialog_id, reply_to_msg, sendAsDocumentsCaptions.get(a)); + prepareSendingDocumentInternal(sendAsDocuments.get(a), sendAsDocumentsOriginal.get(a), null, extension, dialog_id, sendAsDocumentsCaptions.get(a)); } } } }).start(); } - public static void prepareSendingVideo(final String videoPath, final long estimatedSize, final long duration, final int width, final int height, final VideoEditedInfo videoEditedInfo, final long dialog_id, final MessageObject reply_to_msg) { + public static void prepareSendingVideo(final String videoPath, final long estimatedSize, final long duration, final int width, final int height, final VideoEditedInfo videoEditedInfo, final long dialog_id) { if (videoPath == null || videoPath.length() == 0) { return; } @@ -1480,11 +1480,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { - SendMessagesHelper.getInstance().sendMessageDocument(videoFinal, videoEditedInfo, finalPath, dialog_id, reply_to_msg, params); + SendMessagesHelper.getInstance().sendMessageDocument(videoFinal, videoEditedInfo, finalPath, dialog_id, params); } }); } else { - prepareSendingDocumentInternal(videoPath, videoPath, null, null, dialog_id, reply_to_msg, null); + prepareSendingDocumentInternal(videoPath, videoPath, null, null, dialog_id, null); } } }).start(); diff --git a/MessengerProj/src/main/java/com/b44t/ui/ChatActivity.java b/MessengerProj/src/main/java/com/b44t/ui/ChatActivity.java index d7c78cf83..6c67eee7d 100644 --- a/MessengerProj/src/main/java/com/b44t/ui/ChatActivity.java +++ b/MessengerProj/src/main/java/com/b44t/ui/ChatActivity.java @@ -1144,7 +1144,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not photoEntry.thumbPath = null; photoEntry.caption = null; } - SendMessagesHelper.prepareSendingPhotos(photos, null, dialog_id, null, captions); + SendMessagesHelper.prepareSendingPhotos(photos, null, dialog_id, captions); m_mrChat.cleanDraft(); } return; @@ -1205,8 +1205,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not fragment.setDelegate(new PhotoAlbumPickerActivity.PhotoAlbumPickerActivityDelegate() { @Override public void didSelectPhotos(ArrayList photos, ArrayList captions, ArrayList webPhotos) { - SendMessagesHelper.prepareSendingPhotos(photos, null, dialog_id, null, captions); - SendMessagesHelper.prepareSendingPhotosSearch(webPhotos, dialog_id, null); + SendMessagesHelper.prepareSendingPhotos(photos, null, dialog_id, captions); + SendMessagesHelper.prepareSendingPhotosSearch(webPhotos, dialog_id); m_mrChat.cleanDraft(); } @@ -1234,7 +1234,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (Build.VERSION.SDK_INT >= 16) { return !openVideoEditor(path, true, true); } else { - SendMessagesHelper.prepareSendingVideo(path, 0, 0, 0, 0, null, dialog_id, null); + SendMessagesHelper.prepareSendingVideo(path, 0, 0, 0, 0, null, dialog_id); m_mrChat.cleanDraft(); return true; } @@ -1267,7 +1267,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not @Override public void didSelectFiles(DocumentSelectActivity activity, ArrayList files) { activity.finishFragment(); - SendMessagesHelper.prepareSendingDocuments(files, files, null, null, dialog_id, null); + SendMessagesHelper.prepareSendingDocuments(files, files, null, null, dialog_id); m_mrChat.cleanDraft(); } @@ -1293,7 +1293,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not fragment.setDelegate(new AudioSelectActivity.AudioSelectActivityDelegate() { @Override public void didSelectAudio(ArrayList audios) { - SendMessagesHelper.prepareSendingAudioDocuments(audios, dialog_id, null); + SendMessagesHelper.prepareSendingAudioDocuments(audios, dialog_id); m_mrChat.cleanDraft(); } }); @@ -1652,13 +1652,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not videoEditedInfo.resultWidth = resultWidth; videoEditedInfo.resultHeight = resultHeight; videoEditedInfo.originalPath = videoPath; - SendMessagesHelper.prepareSendingVideo(videoPath, estimatedSize, estimatedDuration, resultWidth, resultHeight, videoEditedInfo, dialog_id, null); + SendMessagesHelper.prepareSendingVideo(videoPath, estimatedSize, estimatedDuration, resultWidth, resultHeight, videoEditedInfo, dialog_id); m_mrChat.cleanDraft(); } }); if (parentLayout == null || !fragment.onFragmentCreate()) { - SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id, null); + SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id); m_mrChat.cleanDraft(); return false; } @@ -1731,10 +1731,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not openVideoEditor(videoPath, false, false); } } else { - SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id, null); + SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id); } } else { - SendMessagesHelper.prepareSendingPhoto(null, uri, dialog_id, null, null); + SendMessagesHelper.prepareSendingPhoto(null, uri, dialog_id, null); } m_mrChat.cleanDraft(); } else if (requestCode == RC2_CHAT_VIDEO_CAPTURE) { @@ -1774,7 +1774,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not openVideoEditor(videoPath, false, false); } } else { - SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id, null); + SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id); m_mrChat.cleanDraft(); } } else if (requestCode == RC21_CHAT_PICK_WO_COMPR) { @@ -1808,7 +1808,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not showAttachmentError(); return; } - SendMessagesHelper.prepareSendingDocument(tempPath, originalPath, null, null, dialog_id, null); + SendMessagesHelper.prepareSendingDocument(tempPath, originalPath, null, null, dialog_id); m_mrChat.cleanDraft(); } } @@ -2609,10 +2609,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not // PhotoViewerProvider public void sendPhoto(MediaController.PhotoEntry photoEntry) { if (photoEntry.imagePath != null) { - SendMessagesHelper.prepareSendingPhoto(photoEntry.imagePath, null, dialog_id, null, photoEntry.caption); + SendMessagesHelper.prepareSendingPhoto(photoEntry.imagePath, null, dialog_id, photoEntry.caption); m_mrChat.cleanDraft(); } else if (photoEntry.path != null) { - SendMessagesHelper.prepareSendingPhoto(photoEntry.path, null, dialog_id, null, photoEntry.caption); + SendMessagesHelper.prepareSendingPhoto(photoEntry.path, null, dialog_id, photoEntry.caption); m_mrChat.cleanDraft(); } } diff --git a/MessengerProj/src/main/java/com/b44t/ui/Components/ChatActivityEnterView.java b/MessengerProj/src/main/java/com/b44t/ui/Components/ChatActivityEnterView.java index 82c2f09bb..8b32df634 100644 --- a/MessengerProj/src/main/java/com/b44t/ui/Components/ChatActivityEnterView.java +++ b/MessengerProj/src/main/java/com/b44t/ui/Components/ChatActivityEnterView.java @@ -1225,7 +1225,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe if (playing != null && playing == audioToSendMessageObject) { MediaController.getInstance().cleanupPlayer(true, true); } - SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, audioToSendPath, dialog_id, replyingMessageObject, null); + SendMessagesHelper.getInstance().sendMessageDocument(audioToSend, null, audioToSendPath, dialog_id, null); if (delegate != null) { delegate.onMessageSend(null); } diff --git a/MessengerProj/src/main/java/com/b44t/ui/LaunchActivity.java b/MessengerProj/src/main/java/com/b44t/ui/LaunchActivity.java index a3380560b..8080e3f8b 100644 --- a/MessengerProj/src/main/java/com/b44t/ui/LaunchActivity.java +++ b/MessengerProj/src/main/java/com/b44t/ui/LaunchActivity.java @@ -1104,7 +1104,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa captions.add(sendingText); sendingText = null; } - SendMessagesHelper.prepareSendingPhotos(null, photoPathsArray, dialog_id, null, captions); + SendMessagesHelper.prepareSendingPhotos(null, photoPathsArray, dialog_id, captions); } if (sendingText != null) { @@ -1112,7 +1112,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa } if (documentsPathsArray != null || documentsUrisArray != null) { - SendMessagesHelper.prepareSendingDocuments(documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, documentsMimeType, dialog_id, null); + SendMessagesHelper.prepareSendingDocuments(documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, documentsMimeType, dialog_id); } if (contactsToSend != null && !contactsToSend.isEmpty()) { for (int user_id : contactsToSend) {