From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.su>
Date: Thu, 23 Apr 2026 21:22:31 +0300
Subject: hiding pinned panel from the chat

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

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
@@ -441,7 +441,7 @@ public class ChatActivity extends BaseFragment implements
     private ComposeDrawable otherIcon;
     private ActionBarMenu.LazyItem attachItem;
     private ActionBarMenuItem.Item savedChatsItem, savedChatsGap;;
-    private ActionBarMenuItem headerItem;
+    public ActionBarMenuItem headerItem;
     private ActionBarMenu.LazyItem editTextItem;
     protected ActionBarMenuItem searchItem;
     protected ActionBarMenuItem topicCreateItem;
@@ -734,13 +734,13 @@ public class ChatActivity extends BaseFragment implements
 
     private Runnable checkPaddingsRunnable;
 
-    private boolean wasManualScroll;
+    public boolean wasManualScroll;
     private boolean fixPaddingsInLayout;
     private boolean globalIgnoreLayout;
 
     private int topViewWasVisible;
 
-    private ArrayList<Integer> pinnedMessageIds = new ArrayList<>();
+    public ArrayList<Integer> pinnedMessageIds = new ArrayList<>();
     private int maxPinnedMessageId;
     private HashMap<Integer, MessageObject> pinnedMessageObjects = new HashMap<>();
     private SparseArray<Boolean> loadingPinnedMessages = new SparseArray<>();
@@ -11512,6 +11512,7 @@ public class ChatActivity extends BaseFragment implements
         pinnedListButton.setBackgroundDrawable(Theme.createSelectorDrawable(getThemedColor(Theme.key_inappPlayerClose) & 0x19ffffff));
         pinnedMessageView.addView(pinnedListButton, LayoutHelper.createFrame(36, 48, Gravity.RIGHT | Gravity.TOP, 0, 0, 7, 0));
         pinnedListButton.setOnClickListener(v -> openPinnedMessagesList(false));
+        pinnedListButton.setOnLongClickListener(v -> ChatActionsHelper.onPinnedPanelLongPressed(ChatActivity.this));
 
         closePinned = new ImageView(getContext());
         closePinned.setImageResource(R.drawable.miniplayer_close);
@@ -11564,6 +11565,7 @@ public class ChatActivity extends BaseFragment implements
                 updatePinnedMessageView(true);
             }
         });
+        closePinned.setOnLongClickListener(v -> desu.inugram.helpers.chat.ChatActionsHelper.onPinnedPanelLongPressed(ChatActivity.this));
 
         updatePinnedListButton(false);
     }
@@ -28188,7 +28190,7 @@ public class ChatActivity extends BaseFragment implements
         return false;
     }
 
-    private void updatePinnedMessageView(boolean animated) {
+    public void updatePinnedMessageView(boolean animated) {
         updatePinnedMessageView(animated, 0);
     }
 
@@ -28306,6 +28308,7 @@ public class ChatActivity extends BaseFragment implements
         if (currentEncryptedChat != null || chatMode != 0) {
             return;
         }
+        ChatActionsHelper.updateShowPinnedMenuItem(this, !pinnedMessageIds.isEmpty());
         int pinned_msg_id;
         boolean changed = false;
         MessageObject pinnedMessageObject;
