From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.su>
Date: Thu, 21 May 2026 21:41:24 +0400
Subject: fix scroll positioning when admin log entries load

---
 .../org/telegram/ui/ChannelAdminLogActivity.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java
@@ -4314,7 +4314,7 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
         }
     }
 
-    private long savedScrollEventId;
+    private int savedScrollStableId;
     private int savedScrollPosition = -1;
     private int savedScrollOffset;
     public void saveScrollPosition(boolean fromTop) {
@@ -4332,13 +4332,13 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
                 }
             }
             if (view != null) {
-                long eventId = 0;
+                int stableId = 0;
                 if (view instanceof ChatMessageCell) {
-                    eventId = ((ChatMessageCell) view).getMessageObject().eventId;
+                    stableId = ((ChatMessageCell) view).getMessageObject().stableId;
                 } else if (view instanceof ChatActionCell) {
-                    eventId = ((ChatActionCell) view).getMessageObject().eventId;
+                    stableId = ((ChatActionCell) view).getMessageObject().stableId;
                 }
-                savedScrollEventId = eventId;
+                savedScrollStableId = stableId;
                 savedScrollPosition = position;
                 savedScrollOffset = getScrollingOffsetForView(view);
             }
@@ -4352,10 +4352,10 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
     public void applyScrolledPosition() {
         if (chatListView != null && chatLayoutManager != null && savedScrollPosition >= 0) {
             int adaptedPosition = savedScrollPosition;
-            if (savedScrollEventId != 0) {
+            if (savedScrollStableId != 0) {
                 for (int i = 0; i < chatAdapter.getItemCount(); ++i) {
                     MessageObject msg = chatAdapter.getMessageObject(i);
-                    if (msg != null && msg.eventId == savedScrollEventId) {
+                    if (msg != null && msg.stableId == savedScrollStableId) {
                         adaptedPosition = i;
                         break;
                     }
@@ -4363,7 +4363,7 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
             }
             chatLayoutManager.scrollToPositionWithOffset(adaptedPosition, savedScrollOffset, true);
             savedScrollPosition = -1;
-            savedScrollEventId = 0;
+            savedScrollStableId = 0;
         }
     }
 
