Skip to content

Commit 977c1d0

Browse files
authored
Merge pull request #2185 from dallo28/fix/persistent-bot-keyboard-back
Fix system Back being ignored when a bot keyboard is persistent
2 parents 8de8133 + 14d8316 commit 977c1d0

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
@@ -34770,7 +34770,7 @@ public boolean onBackPressed(boolean invoked) {
3477034770
} else if (actionBar != null && actionBar.isActionModeShowed()) {
3477134771
if (invoked) clearSelectionMode();
3477234772
return false;
34773-
} else if (chatActivityEnterView != null && chatActivityEnterView.isPopupShowing()) {
34773+
} else if (chatActivityEnterView != null && chatActivityEnterView.canHidePopupByBackButton()) {
3477434774
if (invoked) chatActivityEnterView.hidePopup(true);
3477534775
return false;
3477634776
// } 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)