Fix Web Bot attachments (#1845)

This commit is contained in:
Alexander Zinchuk 2022-04-26 17:08:58 +02:00
parent 364352815d
commit eca1e05379

View File

@ -612,7 +612,7 @@ addActionHandler('openChatByUsername', async (global, actions, payload) => {
const chat = selectCurrentChat(global); const chat = selectCurrentChat(global);
if (!commentId) { if (!commentId) {
if (chat && chat.username === username) { if (chat && chat.username === username && !startAttach) {
actions.focusMessage({ chatId: chat.id, messageId }); actions.focusMessage({ chatId: chat.id, messageId });
return; return;
} }
@ -1340,6 +1340,7 @@ async function openChatByUsername(
if (!chat) return; if (!chat) return;
const global = getGlobal(); const global = getGlobal();
const user = selectUser(global, chat.id); const user = selectUser(global, chat.id);
if (!user) return; if (!user) return;
const isBot = isUserBot(user); const isBot = isUserBot(user);
if (!isBot || !user.isAttachMenuBot) { if (!isBot || !user.isAttachMenuBot) {