From 6ed460c1e5181d74cc556792e09b4a5da62fa17c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 4 Feb 2023 03:02:54 +0100 Subject: [PATCH] Bot Buttons: Follow-up (#2496) --- src/components/middle/composer/Composer.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/middle/composer/Composer.tsx b/src/components/middle/composer/Composer.tsx index 49ebafa8b..30fdfc1c2 100644 --- a/src/components/middle/composer/Composer.tsx +++ b/src/components/middle/composer/Composer.tsx @@ -62,6 +62,7 @@ import { isChatAdmin, isChatSuperGroup, isChatChannel, + isUserId, } from '../../../global/helpers'; import { formatMediaDuration, formatVoiceRecordDuration } from '../../../util/dateFormat'; import focusEditableElement from '../../../util/focusEditableElement'; @@ -1526,7 +1527,9 @@ export default memo(withGlobal( const chatBot = chatId !== REPLIES_USER_ID ? selectChatBot(global, chatId) : undefined; const isChatWithBot = Boolean(chatBot); const isChatWithSelf = selectIsChatWithSelf(global, chatId); - const messageWithActualBotKeyboard = selectNewestMessageWithBotKeyboardButtons(global, chatId, threadId); + const isChatWithUser = isUserId(chatId); + const messageWithActualBotKeyboard = (isChatWithBot || !isChatWithUser) + && selectNewestMessageWithBotKeyboardButtons(global, chatId, threadId); const scheduledIds = selectScheduledIds(global, chatId, threadId); const { language, shouldSuggestStickers, shouldSuggestCustomEmoji } = global.settings.byKey; const baseEmojiKeywords = global.emojiKeywords[BASE_EMOJI_KEYWORD_LANG];