From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.su>
Date: Fri, 17 Jul 2026 21:03:06 +0400
Subject: Update forward bar count after deselecting messages in forward options

---
 .../src/main/java/org/telegram/ui/ChatActivity.java        | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
@@ -15191,6 +15191,13 @@ public class ChatActivity extends BaseFragment implements
                 if (messagePreviewParams.isEmpty() && editingMessageObject == null) {
                     messagePreviewParams = null;
                 }
+                if (messagePreviewParams != null && messagePreviewParams.forwardMessages != null) {
+                    ArrayList<MessageObject> selectedToForward = new ArrayList<>();
+                    messagePreviewParams.forwardMessages.getSelectedMessages(selectedToForward);
+                    if (!selectedToForward.isEmpty() && selectedToForward.size() < messageObjectsToForward.size()) {
+                        messageObjectsToForward = selectedToForward;
+                    }
+                }
                 editingMessageObject = null;
                 chatActivityEnterView.setEditingMessageObject(null, null, false);
                 forbidForwardingWithDismiss = false;
