Skip to content

Commit 14d8316

Browse files
dallo28claude
andcommitted
Fix system Back being ignored when a bot keyboard is persistent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f2908b1 commit 14d8316

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34643,7 +34643,7 @@ public boolean onBackPressed(boolean invoked) {
3464334643
} else if (actionBar != null && actionBar.isActionModeShowed()) {
3464434644
if (invoked) clearSelectionMode();
3464534645
return false;
34646-
} else if (chatActivityEnterView != null && chatActivityEnterView.isPopupShowing()) {
34646+
} else if (chatActivityEnterView != null && chatActivityEnterView.canHidePopupByBackButton()) {
3464734647
if (invoked) chatActivityEnterView.hidePopup(true);
3464834648
return false;
3464934649
// } else if (chatActivityEnterView != null && chatActivityEnterView.hasBotWebView() && chatActivityEnterView.botCommandsMenuIsShowing() && chatActivityEnterView.onBotWebViewBackPressed()) {

‎TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13141,6 +13141,13 @@ public boolean isPopupShowing() {
1314113141
return emojiViewVisible || botKeyboardViewVisible;
1314213142
}
1314313143

13144+
public boolean canHidePopupByBackButton() {
13145+
if (!isPopupShowing()) {
13146+
return false;
13147+
}
13148+
return !(currentPopupContentType == POPUP_CONTENT_BOT_KEYBOARD && botReplyMarkup != null && botReplyMarkup.is_persistent && botButtonsMessageObject != null);
13149+
}
13150+
1314413151
public boolean closeCreationLinkDialog(boolean invoked) {
1314513152
return messageEditText != null && messageEditText.closeCreationLinkDialog(invoked);
1314613153
}

0 commit comments

Comments
 (0)